1998-01-19
1998-01-19 22:12:34 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
-
62971ddebb7e764a429f1fa526f8b184f669c9be
(79 lines)
(+57/-22)
[
Show
| Annotate
]
Branch: 7.9
more debug in gc()
Rev: src/gc.c:1.25
Rev: src/mapping.h:1.6
Rev: src/multiset.h:1.4
Rev: src/stralloc.c:1.23
Rev: src/stralloc.h:1.11
139: Inside #if defined(DEBUG)
struct array *a;
struct object *o;
struct program *p;
+ struct mapping *m;
+ struct multiset *mu;
a=&empty_array;
do
155: Inside #if defined(DEBUG)
if(p==(struct program *)something)
return T_PROGRAM;
+ for(m=first_mapping;m;m=m->next)
+ if(m==(struct program *)something)
+ return T_MAPPING;
+
+ for(m=first_mapping;m;m=m->next)
+ if(m==(struct mapping *)something)
+ return T_MAPPING;
+
+ for(mu=first_multiset;mu;mu=mu->next)
+ if(mu==(struct multiset *)something)
+ return T_MULTISET;
+
+ if(safe_debug_findstring((struct pike_string *)something))
+ return T_STRING;
+
return T_UNKNOWN;
}
168: Inside #if defined(DEBUG)
{
if(!location) return;
fprintf(stderr,"**Location of (short) svalue: %p\n",location);
- if(type==T_OBJECT)
+
+ switch(type)
{
-
+ case T_OBJECT:
+ {
struct object *o=(struct object *)memblock;
if(o->prog)
{
194: Inside #if defined(DEBUG)
return;
}
- if(type == T_ARRAY)
+ case T_ARRAY:
{
struct array *a=(struct array *)memblock;
struct svalue *s=(struct svalue *)location;
202: Inside #if defined(DEBUG)
return;
}
}
+ }
static void gdb_gc_stop_here(void *a)
{
292: Inside #if defined(DEBUG)
fprintf(stderr,"**Describing array:\n");
debug_dump_array((struct array *)a);
break;
+
+ case T_STRING:
+ {
+ struct pike_string *s=(struct pike_string *)a;
+ fprintf(stderr,"**String length is %d:\n",s->len);
+ if(s->len>77)
+ {
+ fprintf(stderr,"** \"%60s ...\"\n",s->str);
+ }else{
+ fprintf(stderr,"** \"%s\"\n",s->str);
}
-
+ break;
}
-
+ }
+ }
#endif