Fri Nov 12 11:18:02 1993 Kung Hsu (kung@cirdan.cygnus.com)
+ * 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.
+
* gdbtypes.c (lookup_struct_elt_type): Handle type ref or pointer
to struct/union case.
{
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)
{
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] == ':')));
char *type_name;
{
- char *from, *to;
+ char *from, *to, *p;
/* Set the type code according to the following letter. */
switch ((*pp)[0])
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;