pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.370 2006/02/28 13:10:13 mast Exp $ + || $Id: interpret.c,v 1.371 2006/02/28 13:51:53 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"
pike.git/src/interpret.c:795: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG   void print_return_value(void)   {    if(Pike_interpreter.trace_level>3)    {    char *s;    dynamic_buffer save_buf;       init_buf(&save_buf); -  describe_svalue(Pike_sp-1,0,0); +  safe_describe_svalue(Pike_sp-1,0,0);    s=simple_free_buf(&save_buf);    if((size_t)strlen(s) > (size_t)TRACE_LEN)    {    s[TRACE_LEN]=0;    s[TRACE_LEN-1]='.';    s[TRACE_LEN-2]='.';    s[TRACE_LEN-3]='.';    }    fprintf(stderr,"- value: %s\n",s);    free(s);
pike.git/src/interpret.c:1536:   static void do_trace_call(INT32 args, dynamic_buffer *old_buf)   {    struct pike_string *filep = NULL;    char *file, *s;    INT32 linep,e;       my_strcat("(");    for(e=0;e<args;e++)    {    if(e) my_strcat(","); -  describe_svalue(Pike_sp-args+e,0,0); +  safe_describe_svalue(Pike_sp-args+e,0,0);    }    my_strcat(")");       s=simple_free_buf(old_buf);    if((size_t)strlen(s) > (size_t)TRACE_LEN)    {    s[TRACE_LEN]=0;    s[TRACE_LEN-1]='.';    s[TRACE_LEN-2]='.';    s[TRACE_LEN-3]='.';
pike.git/src/interpret.c:1610:   }      static void do_trace_return (int got_retval, dynamic_buffer *old_buf)   {    struct pike_string *filep = NULL;    char *file, *s;    INT32 linep;       if (got_retval) {    my_strcat ("returns: "); -  describe_svalue(Pike_sp-1,0,0); +  safe_describe_svalue(Pike_sp-1,0,0);    }    else    my_strcat ("returns with no value");       s=simple_free_buf(old_buf);    if((size_t)strlen(s) > (size_t)TRACE_LEN)    {    s[TRACE_LEN]=0;    s[TRACE_LEN-1]='.';    s[TRACE_LEN-2]='.';
pike.git/src/interpret.c:1854:    fun=s->subtype;    goto apply_low;    }    break;       case T_ARRAY:    if(Pike_interpreter.trace_level)    {    dynamic_buffer save_buf;    init_buf(&save_buf); -  describe_svalue(s,0,0); +  safe_describe_svalue(s,0,0);    do_trace_call(args, &save_buf);    }    apply_array(s->u.array,args);    break;       case T_PROGRAM:    if(Pike_interpreter.trace_level)    {    dynamic_buffer save_buf;    init_buf(&save_buf); -  describe_svalue(s,0,0); +  safe_describe_svalue(s,0,0);    do_trace_call(args, &save_buf);    }    push_object(clone_object(s->u.program,args));    break;       case T_OBJECT:    /* FIXME: Object subtypes! */    o=s->u.object;    if(o->prog == pike_trampoline_program)    {
pike.git/src/interpret.c:2252:    ONERROR tmp;    SET_ONERROR(tmp,exit_on_error,"Error in handle_error in master object!");    APPLY_MASTER("handle_error", 1);    UNSET_ONERROR(tmp);    }    else {    dynamic_buffer save_buf;    char *s;    fprintf (stderr, "There's no master to handle the error. Dumping it raw:\n");    init_buf(&save_buf); -  describe_svalue (Pike_sp - 1, 0, 0); +  safe_describe_svalue (Pike_sp - 1, 0, 0);    s=simple_free_buf(&save_buf);    fprintf(stderr,"%s\n",s);    free(s);    if (Pike_sp[-1].type == PIKE_T_OBJECT && Pike_sp[-1].u.object->prog) {    int fun = find_identifier("backtrace", Pike_sp[-1].u.object->prog);    if (fun != -1) {    fprintf(stderr, "Attempting to extract the backtrace.\n");    safe_apply_low2(Pike_sp[-1].u.object, fun, 0, 0);    init_buf(&save_buf); -  describe_svalue(Pike_sp - 1, 0, 0); +  safe_describe_svalue(Pike_sp - 1, 0, 0);    pop_stack();    s=simple_free_buf(&save_buf);    fprintf(stderr,"%s\n",s);    free(s);    }    }    }       pop_stack();    Pike_interpreter.svalue_stack_margin = SVALUE_STACK_MARGIN;