diff options
author | Michael Tiemann <tiemann@cygnus> | 1991-12-09 05:20:14 +0000 |
---|---|---|
committer | Michael Tiemann <tiemann@cygnus> | 1991-12-09 05:20:14 +0000 |
commit | 7fb4dfc05dbe35b2de45bb588e6188f6dda3ccd5 (patch) | |
tree | 9b222fffd16f0f58605f02034b1ea1f6037f41d7 /gdb/buildsym.c | |
parent | f39b81f5a34c399e0d43cd0d6de99765ada4156a (diff) | |
download | gdb-7fb4dfc05dbe35b2de45bb588e6188f6dda3ccd5.zip gdb-7fb4dfc05dbe35b2de45bb588e6188f6dda3ccd5.tar.gz gdb-7fb4dfc05dbe35b2de45bb588e6188f6dda3ccd5.tar.bz2 |
Integrated quick fixes to C++ handling of static member functions and
stub methods. These changes are not complete in that a better
implementation will be more maintainable, but they make it possible to
debug groff with GDB.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r-- | gdb/buildsym.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c index e10d5c0..d4dde9c 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -1906,7 +1906,6 @@ read_struct_type (pp, type) struct next_fnfield { struct next_fnfield *next; - int visibility; /* 0=public, 1=protected, 2=public */ struct fn_field fn_field; }; @@ -2313,11 +2312,25 @@ read_struct_type (pp, type) *pp += 1; p = *pp; while (*p != ';') p++; + /* If this is just a stub, then we don't have the real name here. */ + if (TYPE_FLAGS (new_sublist->fn_field.type) & TYPE_FLAG_STUB) + new_sublist->fn_field.is_stub = 1; new_sublist->fn_field.physname = savestring (*pp, p - *pp); *pp = p + 1; - new_sublist->visibility = *(*pp)++ - '0'; + + /* Set this method's visibility fields. */ + switch (*(*pp)++ - '0') + { + case 0: + new_sublist->fn_field.is_private = 1; + break; + case 1: + new_sublist->fn_field.is_protected = 1; + break; + } + if (**pp == '\\') *pp = next_symbol_text (); switch (**pp) { @@ -2391,6 +2404,9 @@ read_struct_type (pp, type) case '?': /* static member function. */ new_sublist->fn_field.voffset = VOFFSET_STATIC; + if (strncmp (new_sublist->fn_field.physname, + main_fn_name, strlen (main_fn_name))) + new_sublist->fn_field.is_stub = 1; break; default: @@ -2417,22 +2433,8 @@ read_struct_type (pp, type) new_mainlist->fn_fieldlist.fn_fields = (struct fn_field *) obstack_alloc (symbol_obstack, sizeof (struct fn_field) * length); - TYPE_FN_PRIVATE_BITS (new_mainlist->fn_fieldlist) = - (B_TYPE *) obstack_alloc (symbol_obstack, B_BYTES (length)); - B_CLRALL (TYPE_FN_PRIVATE_BITS (new_mainlist->fn_fieldlist), length); - - TYPE_FN_PROTECTED_BITS (new_mainlist->fn_fieldlist) = - (B_TYPE *) obstack_alloc (symbol_obstack, B_BYTES (length)); - B_CLRALL (TYPE_FN_PROTECTED_BITS (new_mainlist->fn_fieldlist), length); - for (i = length; (i--, sublist); sublist = sublist->next) - { - new_mainlist->fn_fieldlist.fn_fields[i] = sublist->fn_field; - if (sublist->visibility == 0) - B_SET (new_mainlist->fn_fieldlist.private_fn_field_bits, i); - else if (sublist->visibility == 1) - B_SET (new_mainlist->fn_fieldlist.protected_fn_field_bits, i); - } + new_mainlist->fn_fieldlist.fn_fields[i] = sublist->fn_field; new_mainlist->fn_fieldlist.length = length; new_mainlist->next = mainlist; |