|
From: Tom H. <th...@cy...> - 2004-11-04 13:24:38
|
CVS commit by thughes:
Fix some GNAT related stabs parsing problems.
MERGE TO STABLE
M +20 -7 vg_stabs.c 1.14.2.2
--- valgrind/coregrind/vg_stabs.c #1.14.2.1:1.14.2.2
@@ -171,4 +171,13 @@ static SymType *structDef(StabTypeTab *t
SymType *ref = structRef(tab, NULL, isstruct, name);
+ /* it seems that GNAT likes to declare names as both struct tags
+ and typedefs so check we aren't about to make a structure a
+ reference to itself as that will create a loop */
+ if (ref == def) {
+ if (debug)
+ VG_(printf)("ignoring %s self ref for %s %p -> %p\n",
+ isstruct ? "struct" : "union", name, ref, def);
+ }
+ else {
if (debug)
VG_(printf)("defining %s ref for %s %p -> %p\n",
@@ -177,4 +186,5 @@ static SymType *structDef(StabTypeTab *t
def = VG_(st_mktypedef)(ref, name, VG_(st_basetype)(def, False));
VG_(st_setname)(def, name);
+ }
return def;
}
@@ -940,5 +950,8 @@ static SymType *stabtype_parser(SegInfo
EXPECT(',', "struct TYPE");
- off = atou(&p, 0);
+ /* logic dictates that the offset would always be
+ positive and that atou would work here but GNAT has
+ has other ideas - see bug 90128 for more details */
+ off = atoi(&p, 0);
if (*p == ',') {
|