diff options
author | Peter Schauer <pes@regent.e-technik.tu-muenchen.de> | 2002-03-08 17:19:39 +0000 |
---|---|---|
committer | Peter Schauer <pes@regent.e-technik.tu-muenchen.de> | 2002-03-08 17:19:39 +0000 |
commit | 0605df5f57a4b99cb5bffa1c172bbf4f927eaf55 (patch) | |
tree | 4e5103d85aba54141bc7edb128e93af94c387e52 /gdb | |
parent | 2594f1c2ac0013a447ae8af3367b594bc65bc3cf (diff) | |
download | gdb-0605df5f57a4b99cb5bffa1c172bbf4f927eaf55.tar.gz |
* stabsread.c (read_member_functions): Fix is_stub test for
static member functions, improve comment.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/stabsread.c | 31 |
2 files changed, 29 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f811bb93538..fbf9dd07537 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-03-08 Peter Schauer <pes@regent.e-technik.tu-muenchen.de> + + * stabsread.c (read_member_functions): Fix is_stub test for + static member functions, improve comment. + 2002-03-07 Richard Earnshaw <rearnsha@arm.com> * remote-rdi.c (myprint): Replace 'PTR' with 'void *'. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 5b115467538..bb969dbe789 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -3287,13 +3287,30 @@ read_member_functions (struct field_info *fip, char **pp, struct type *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; + { + int slen = strlen (main_fn_name); + + new_sublist->fn_field.voffset = VOFFSET_STATIC; + + /* For static member functions, we can't tell if they + are stubbed, as they are put out as functions, and not as + methods. + GCC v2 emits the fully mangled name if + dbxout.c:flag_minimal_debug is not set, so we have to + detect a fully mangled physname here and set is_stub + accordingly. Fully mangled physnames in v2 start with + the member function name, followed by two underscores. + GCC v3 currently always emits stubbed member functions, + but with fully mangled physnames, which start with _Z. */ + if (!(strncmp (new_sublist->fn_field.physname, + main_fn_name, slen) == 0 + && new_sublist->fn_field.physname[slen] == '_' + && new_sublist->fn_field.physname[slen + 1] == '_')) + { + new_sublist->fn_field.is_stub = 1; + } + break; + } default: /* error */ |