diff options
author | Kung Hsu <kung@cygnus> | 1993-11-12 19:34:24 +0000 |
---|---|---|
committer | Kung Hsu <kung@cygnus> | 1993-11-12 19:34:24 +0000 |
commit | 2fb58b984c8274f83b69c1d938f4f4e84b026027 (patch) | |
tree | faf793897b0288a9ef8830453facfc30983b81d6 /gdb/stabsread.c | |
parent | 624456be75030b1aab0f79da73a27d73d391b868 (diff) | |
download | gdb-2fb58b984c8274f83b69c1d938f4f4e84b026027.zip gdb-2fb58b984c8274f83b69c1d938f4f4e84b026027.tar.gz gdb-2fb58b984c8274f83b69c1d938f4f4e84b026027.tar.bz2 |
Modified Files:
ChangeLog stabsread.c
* stabsread.c (patch_block_stabs, define_symbol, read_type): in
g++ template instantiation, nested class can be part of the
params, and '::' can gets into symbol or type names. This is
to fix the problem. (fix pr3837)
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r-- | gdb/stabsread.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 2ebaa6c..d038ca6 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -367,6 +367,11 @@ patch_block_stabs (symbols, stabs, objfile) { name = stabs->stab[ii]; pp = (char*) strchr (name, ':'); + while (pp[1] == ':') + { + pp += 2; + pp = (char *)strchr(pp, ':'); + } sym = find_symbol_in_list (symbols, name, pp-name); if (!sym) { @@ -485,6 +490,12 @@ define_symbol (valu, string, desc, type, objfile) if (p == 0) return 0; + while (p[1] == ':') + { + p += 2; + p = strchr(p, ':'); + } + /* If a nameless stab entry, all we need is the type, not the symbol. e.g. ":t10=*2" or a nameless enum like " :T16=ered:0,green:1,blue:2,;" */ nameless = (p == string || ((string[0] == ' ') && (string[1] == ':'))); @@ -1295,7 +1306,7 @@ read_type (pp, objfile) char *type_name; { - char *from, *to; + char *from, *to, *p; /* Set the type code according to the following letter. */ switch ((*pp)[0]) @@ -1312,16 +1323,21 @@ read_type (pp, objfile) default: return error_type (pp); } - - to = type_name = (char *) - obstack_alloc (&objfile -> type_obstack, - (((char *) strchr (*pp, ':') - (*pp)) + 1)); + + p = strchr(*pp, ':'); + while (p[1] == ':') + { + p += 2; + p = strchr(p, ':'); + } + to = type_name = + (char *)obstack_alloc (&objfile->type_obstack, p - *pp + 1); /* Copy the name. */ from = *pp + 1; - while ((*to++ = *from++) != ':') - ; - *--to = '\0'; + while (from < p) + *to++ = *from++; + *to = '\0'; /* Set the pointer ahead of the name which we just read. */ *pp = from; |