Branch: Tag:

2001-06-19

2001-06-19 14:45:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Use the new deferred backtrace by default.

Rev: src/builtin.cmod:1.36
Rev: src/builtin_functions.c:1.378

1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.35 2001/06/19 13:12:03 grubba Exp $ +  * $Id: builtin.cmod,v 1.36 2001/06/19 14:45:52 grubba Exp $    */      #include "global.h"
837:   /*! @endclass    */    - /*! Deferred backtrace. + /*! @decl array(array) backtrace() +  *! +  *! Get a description of the current call stack. +  *! +  *! The description is returned as an array with one entry for each call +  *! frame on the stack. +  *! +  *! Each entry has this format: +  *! @array +  *! @elem string file +  *! A string with the filename if known, else zero. +  *! @elem int line +  *! An integer containing the linenumber if known, else zero. +  *! @elem function fun +  *! The function that was called at this level. +  *! @elem mixed|void ... args +  *! The arguments that the function was called with. +  *! @endarray +  *! +  *! The current call frame will be last in the array. +  *! +  *! @note +  *! Please note that the frame order may be reversed in a later version +  *! (than 7.1) of Pike to accomodate for deferred backtraces. +  *! +  *! Note that the arguments reported in the backtrace are the current +  *! values of the variables, and not the ones that were at call-time. +  *! This can be used to hide sensitive information from backtraces +  *! (eg passwords). +  *! +  *! @seealso +  *! @[catch()], @[throw()]    */ - PIKEFUN array(object) new_backtrace() -  /* efun; */ + PMOD_EXPORT + PIKEFUN array(mixed) backtrace() +  efun; +  optflags OPT_EXTERNAL_DEPEND;   {    struct pike_frame *f;    int size = 0;    -  for (f = Pike_fp->next; f; f = f->next) { +  for (f = (Pike_fp?Pike_fp->next:NULL); f; f = f->next) {    struct object *o = low_clone(backtrace_frame_program);    struct backtrace_frame_struct *bf;