diff options
author | Per Bothner <per@bothner.com> | 1992-09-04 07:37:18 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1992-09-04 07:37:18 +0000 |
commit | 35fcebce93a949c589d0569e2b1111c1eb26bc2f (patch) | |
tree | 4bf217c00c7022660422bac10180344a14020b9d /gdb/stabsread.c | |
parent | d73812a1d62890a28f3be4054614e16690a1b029 (diff) | |
download | gdb-35fcebce93a949c589d0569e2b1111c1eb26bc2f.zip gdb-35fcebce93a949c589d0569e2b1111c1eb26bc2f.tar.gz gdb-35fcebce93a949c589d0569e2b1111c1eb26bc2f.tar.bz2 |
A ton of changes to improve C++ debugging. See ChangeLog.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r-- | gdb/stabsread.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 832d9c3..06b61ec 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1158,7 +1158,8 @@ read_type (pp, objfile) case '#': /* Method (class & fn) type */ if ((*pp)[0] == '#') { - /* We'll get the parameter types from the name. */ + /* This "minimized" format bogus, because it doesn't yield + enough information. I've changed gcc to not emit it. --Per */ struct type *return_type; *pp += 1; @@ -1417,8 +1418,10 @@ read_struct_type (pp, type, objfile) p = *pp; if (*p == CPLUS_MARKER) { + if (*p == '_') /* GNU C++ anonymous type. */ + ; /* Special GNU C++ name. */ - if (*++p == 'v') + else if (*++p == 'v') { const char *prefix; char *name = 0; @@ -1457,15 +1460,12 @@ read_struct_type (pp, type, objfile) list->field.bitsize = 0; list->visibility = 0; /* private */ non_public_fields++; + + nfields++; + continue; } - /* GNU C++ anonymous type. */ - else if (*p == '_') - break; else complain (&invalid_cpp_abbrev_complaint, *pp); - - nfields++; - continue; } while (*p != ':') p++; @@ -1508,21 +1508,26 @@ read_struct_type (pp, type, objfile) if (**pp == ':') { p = ++(*pp); -#if 0 - /* Possible future hook for nested types. */ if (**pp == '!') - { - list->field.bitpos = (long)-2; /* nested type */ + { /* C++ nested type -as in FOO::BAR */ + list->field.bitpos = (long)(-2); /* nested type */ p = ++(*pp); + if (TYPE_NAME (list->field.type) == NULL && **pp == '\'') + { + for (p = ++(*pp); *p != '\''; ) p++; + TYPE_NAME (list->field.type) = savestring (*pp, p - *pp); + } + while (*p != ';') p++; + list->field.bitsize = 0; + *pp = p + 1; } else -#endif { /* Static class member. */ - list->field.bitpos = (long)-1; + list->field.bitpos = (long)(-1); + while (*p != ';') p++; + list->field.bitsize = (long) savestring (*pp, p - *pp); + *pp = p + 1; } - while (*p != ';') p++; - list->field.bitsize = (long) savestring (*pp, p - *pp); - *pp = p + 1; nfields++; continue; } |