Branch: Tag:

2003-11-09

2003-11-09 01:10:15 by Martin Stjernholm <mast@lysator.liu.se>

Made the interface for the global dynamic buffer reentrant.

Rev: src/apply_low.h:1.25
Rev: src/array.c:1.151
Rev: src/dynamic_buffer.c:1.24
Rev: src/dynamic_buffer.h:1.19
Rev: src/error.c:1.117
Rev: src/interpret.c:1.337
Rev: src/interpret_functions.h:1.161
Rev: src/las.c:1.341
Rev: src/mapping.c:1.173
Rev: src/modules/sprintf/sprintf.c:1.115
Rev: src/multiset.c:1.79
Rev: src/pike_types.c:1.224
Rev: src/program.c:1.530
Rev: src/stralloc.c:1.160
Rev: src/svalue.c:1.179

2:   || 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.336 2003/10/20 14:59:42 marcus Exp $ + || $Id: interpret.c,v 1.337 2003/11/09 01:10:13 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.336 2003/10/20 14:59:42 marcus Exp $"); + RCSID("$Id: interpret.c,v 1.337 2003/11/09 01:10:13 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
102:   PMOD_EXPORT int Pike_stack_size = EVALUATOR_STACK_SIZE;      static void trace_return_value(void); - static void do_trace_call(INT32); + static void do_trace_call(INT32 args, dynamic_buffer *old_buf);      void gdb_stop_here(void)   {
683: Inside #if defined(PIKE_DEBUG)
   if(Pike_interpreter.trace_level>3)    {    char *s; +  dynamic_buffer save_buf;    -  init_buf(); +  init_buf(&save_buf);    describe_svalue(Pike_sp-1,0,0); -  s=simple_free_buf(); +  s=simple_free_buf(&save_buf);    if((size_t)strlen(s) > (size_t)TRACE_LEN)    {    s[TRACE_LEN]=0;
1346:   static void trace_return_value(void)   {    char *s; +  dynamic_buffer save_buf;    -  init_buf(); +  init_buf(&save_buf);    my_strcat("Return: ");    describe_svalue(Pike_sp-1,0,0); -  s=simple_free_buf(); +  s=simple_free_buf(&save_buf);    if((size_t)strlen(s) > (size_t)TRACE_LEN)    {    s[TRACE_LEN]=0;
1362:    free(s);   }    - static void do_trace_call(INT32 args) + static void do_trace_call(INT32 args, dynamic_buffer *old_buf)   {    struct pike_string *filep = NULL;    char *file, *s;
1374:    describe_svalue(Pike_sp-args+e,0,0);    }    my_strcat(")"); -  s=simple_free_buf(); +  s=simple_free_buf(old_buf);    if((size_t)strlen(s) > (size_t)TRACE_LEN)    {    s[TRACE_LEN]=0;
1543: Inside #if defined(PIKE_DEBUG)
   struct svalue *expected_stack = Pike_sp-args;    if(Pike_interpreter.trace_level>1)    { -  init_buf(); +  dynamic_buffer save_buf; +  init_buf(&save_buf);    describe_svalue(s,0,0); -  do_trace_call(args); +  do_trace_call(args, &save_buf);    }   #endif    check_threads_etc();
1591: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(Pike_interpreter.trace_level>1)    { -  init_buf(); +  dynamic_buffer save_buf; +  init_buf(&save_buf);    describe_svalue(s,0,0); -  do_trace_call(args); +  do_trace_call(args, &save_buf);    }   #endif    apply_array(s->u.array,args);
1603: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(Pike_interpreter.trace_level>1)    { -  init_buf(); +  dynamic_buffer save_buf; +  init_buf(&save_buf);    describe_svalue(s,0,0); -  do_trace_call(args); +  do_trace_call(args, &save_buf);    }   #endif    push_object(clone_object(s->u.program,args));
1948:    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(); +  init_buf(&save_buf);    describe_svalue (Pike_sp - 1, 0, 0); -  s=simple_free_buf(); +  s=simple_free_buf(&save_buf);    fprintf(stderr,"%s\n",s);    free(s);    }