|
From: <sv...@va...> - 2005-11-16 00:05:06
|
Author: tom
Date: 2005-11-16 00:04:58 +0000 (Wed, 16 Nov 2005)
New Revision: 5138
Log:
Fix stabs decoder to allow :: in a method name provided it is inside
a template argument list. Fixes bug #113126.
Modified:
trunk/coregrind/m_debuginfo/stabs.c
Modified: trunk/coregrind/m_debuginfo/stabs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/stabs.c 2005-11-15 20:56:23 UTC (rev 5137=
)
+++ trunk/coregrind/m_debuginfo/stabs.c 2005-11-16 00:04:58 UTC (rev 5138=
)
@@ -852,29 +852,39 @@
}
=20
while(*p !=3D ';') {
- Char *end;
+ Char *start =3D p;
Char *name;
UInt off, sz;
SymType *fieldty;
=20
- end =3D SKIPPAST(p, ':', "method name") - 1;
+ if (VG_(strncmp)(p, "operator<::", 11) =3D=3D 0 ||
+ VG_(strncmp)(p, "operator>::", 11) =3D=3D 0 ||
+ VG_(strncmp)(p, "operator<=3D::", 12) =3D=3D 0 ||
+ VG_(strncmp)(p, "operator>=3D::", 12) =3D=3D 0 ||
+ VG_(strncmp)(p, "operator<<::", 12) =3D=3D 0 ||
+ VG_(strncmp)(p, "operator>>::", 12) =3D=3D 0 ||
+ VG_(strncmp)(p, "operator->::", 12) =3D=3D 0) {
+ p =3D SKIPPAST(p, ':', "member name");
+ } else {
+ p =3D templ_name(p);
+ EXPECT(':', "member name");
+ }
=20
- if (end[1] =3D=3D ':') {
+ if (p[0] =3D=3D ':') {
/* c++ method names end in :: */
method =3D True;
=20
- if (VG_(strncmp)(p, "op$", 3) =3D=3D 0) {
+ if (VG_(strncmp)(start, "op$", 3) =3D=3D 0) {
/* According to stabs.info, operators are named
( "op$::" OP '.' ), where OP is +=3D, etc. Current
gcc doesn't seem to use this; operators just
appear as "operator=3D=3D::" */
- end =3D SKIPPAST(end, '.', "op$ name");
+ p =3D SKIPPAST(p, '.', "op$ name");
}
- name =3D ML_(addStr)(si, p, end-p);
- p =3D end+2;
+ name =3D ML_(addStr)(si, start, p-start-1);
+ p =3D p+1;
} else {
- name =3D ML_(addStr)(si, p, end-p);
- p =3D end+1;
+ name =3D ML_(addStr)(si, start, p-start-1);
}
=20
if (method) {
|