From: Jim Kingdon Date: Sun, 20 Jun 1993 20:30:31 +0000 (+0000) Subject: * stabsread.c (read_struct_fields): Don't call read_cpp_abbrev on $_. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=089dc22027dca5ed061c7f371a1a1e9c349ef0a1;p=binutils-gdb.git * stabsread.c (read_struct_fields): Don't call read_cpp_abbrev on $_. (read_cpp_abbrev): Don't complain specially for $_. Also return 0 if we don't recognize the abbrev. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a02196e5036..08f3e34f738 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Sun Jun 20 13:11:11 1993 Jim Kingdon (kingdon@cygnus.com) + + * stabsread.c (read_struct_fields): Don't call read_cpp_abbrev on $_. + (read_cpp_abbrev): Don't complain specially for $_. Also return 0 if + we don't recognize the abbrev. + Sun Jun 20 00:24:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * solib.c (solib_add_common_symbols): Add comment about performance. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 84edc569e5d..784708da274 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -2134,14 +2134,13 @@ read_cpp_abbrev (fip, pp, type, objfile) fip->list->field.bitsize = 0; fip->list->visibility = VISIBILITY_PRIVATE; } - else if (*p == '_') - { - /* GNU C++ anonymous type. */ - complain (&stabs_general_complaint, "g++ anonymous type $_ not handled"); - } else { complain (&invalid_cpp_abbrev_complaint, *pp); + /* We have no idea what syntax an unrecognized abbrev would have, so + better return 0. If we returned 1, we would need to at least advance + *pp to avoid an infinite loop. */ + return 0; } return 1; } @@ -2341,7 +2340,11 @@ read_struct_fields (fip, pp, type, objfile) /* Get the field name. */ p = *pp; - if (*p == CPLUS_MARKER) + /* If is starts with CPLUS_MARKER it is a special abbreviation, unless + the CPLUS_MARKER is followed by an underscore, in which case it is + just the name of an anonymous type, which we should handle like any + other type name. */ + if (*p == CPLUS_MARKER && p[1] != '_') { if (!read_cpp_abbrev (fip, pp, type, objfile)) return 0;