From: Jeremy Fitzhardinge Date: Tue, 24 Feb 2004 23:46:06 +0000 (+0000) Subject: This fixes bug 75614. It seems that a symbol can be named X-Git-Tag: svn/VALGRIND_2_1_1~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa80b6dcf01e910af0f533e4bf96306092901cf8;p=thirdparty%2Fvalgrind.git This fixes bug 75614. It seems that a symbol can be named "foo"; normally stabs names are terminated by ':', but we also need to keep track of <> pairs so we can ignore nested colons. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2267 --- diff --git a/coregrind/vg_stabs.c b/coregrind/vg_stabs.c index b321bb1ffc..a8456c7cc5 100644 --- a/coregrind/vg_stabs.c +++ b/coregrind/vg_stabs.c @@ -775,9 +775,26 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) Char *name; UInt off, sz; SymType *fieldty; + Int templ=0; + + /* Skip past field name, which ends with ':' or '::' - but + '::' can appear within a template-mangled name, so keep + track of '<' and '>'. */ + end = p; + while(*end) { + Char ch = *end++; + + if (ch == '<') + templ++; + else if (ch == '>') + templ--; + else if (templ == 0 && ch == ':') { + end--; + break; + } + } + /* XXX check for *end != ':' */ - end = SKIPPAST(p, ':', "struct/union field NAME"); - end--; /* want to point to (first) ':' */ if (end[1] == ':') { /* c++ method names end in :: */ method = True;