Branch: Tag:

1997-11-08

1997-11-08 01:35:41 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

more debug added

Rev: src/array.c:1.21
Rev: src/builtin_functions.c:1.56
Rev: src/gc.c:1.22
Rev: src/gc.h:1.13
Rev: src/interpret.c:1.55
Rev: src/lex.c:1.30
Rev: src/main.c:1.27
Rev: src/mapping.c:1.24
Rev: src/modules/files/file.c:1.61
Rev: src/multiset.c:1.8
Rev: src/object.c:1.29
Rev: src/program.c:1.46
Rev: src/stralloc.c:1.18
Rev: src/svalue.c:1.17
Rev: src/threads.c:1.46

6:      #include "global.h"    - #ifdef GC2 -  +    struct callback *gc_evaluator_callback=0;      #include "array.h"
163: Inside #if defined(DEBUG)
  static void *check_for =0;   static char *found_where="";   static void *found_in=0; - static TYPE_T found_in_type=0; + static int found_in_type=0;   void *gc_svalue_location=0;      void describe_location(void *memblock, TYPE_T type, void *location)   { -  +  if(!location) return;    fprintf(stderr,"**Location of (short) svalue: %p\n",location);    if(type==T_OBJECT)    {
206: Inside #if defined(DEBUG)
     static void gdb_gc_stop_here(void *a)   { -  fprintf(stderr,"**One ref found%s.\n",found_where); +  fprintf(stderr,"***One ref found%s.\n",found_where);    describe_something(found_in, found_in_type);    describe_location(found_in, found_in_type, gc_svalue_location);   }    -  + void debug_gc_xmark_svalues(struct svalue *s, int num, char *fromwhere) + { +  found_in=(void *)fromwhere; +  found_in_type=-1; +  gc_xmark_svalues(s,num); +  found_in_type=T_UNKNOWN; +  found_in=0; + } +    TYPE_FIELD debug_gc_check_svalues(struct svalue *s, int num, TYPE_T t, void *data)   {    TYPE_FIELD ret;
218: Inside #if defined(DEBUG)
   found_in_type=t;    ret=gc_check_svalues(s,num);    found_in_type=T_UNKNOWN; +  found_in=0;    return ret;   }   
227: Inside #if defined(DEBUG)
   found_in_type=t;    gc_check_short_svalue(u,type);    found_in_type=T_UNKNOWN; +  found_in=0;   }    - void describe_something(void *a, TYPE_T t) + void describe_something(void *a, int t)   {    struct program *p=(struct program *)a;    if(!a) return; -  +  if(t==-1) +  { +  fprintf(stderr,"**Location description: %s\n",(char *)a); +  return; +  } +     fprintf(stderr,"**Location: %p Type: %s Refs: %d\n",a,    get_name_of_type(t),    *(INT32 *)a);
544:    in_gc=0;   }    - #endif +