diff options
author | Daniel Jacobowitz <drow@false.org> | 2002-02-14 23:40:23 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2002-02-14 23:40:23 +0000 |
commit | 003d6d1dc87f1c90f12722f08cbf1d22c29c4d3f (patch) | |
tree | ca243711f19ec7d667b28321d9704a7b12336677 /gdb | |
parent | c53abaf150ce09022e5ef740ca7a9a5e8e88399f (diff) | |
download | gdb-003d6d1dc87f1c90f12722f08cbf1d22c29c4d3f.zip gdb-003d6d1dc87f1c90f12722f08cbf1d22c29c4d3f.tar.gz gdb-003d6d1dc87f1c90f12722f08cbf1d22c29c4d3f.tar.bz2 |
2002-02-14 Daniel Jacobowitz <drow@mvista.com>
Fix part of PR gdb/267.
* linespec.c (find_methods): Handle constructors specially for now.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/linespec.c | 35 |
2 files changed, 39 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a2ee75f..fa0a39e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-02-14 Daniel Jacobowitz <drow@mvista.com> + + Fix part of PR gdb/267. + * linespec.c (find_methods): Handle constructors specially for now. + 2002-02-14 Corinna Vinschen <vinschen@redhat.com> * arm-tdep.c (arm_push_arguments): Eliminate special float type diff --git a/gdb/linespec.c b/gdb/linespec.c index ef3a28c..15ccab0 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -202,6 +202,39 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr) */ } } + else if (strcmp_iw (class_name, name) == 0) + { + /* For GCC 3.x and stabs, constructors and destructors have names + like __base_ctor and __complete_dtor. Check the physname for now + if we're looking for a constructor. */ + for (field_counter + = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1; + field_counter >= 0; + --field_counter) + { + struct fn_field *f; + char *phys_name; + + f = TYPE_FN_FIELDLIST1 (t, method_counter); + + /* GCC 3.x will never produce stabs stub methods, so we don't need + to handle this case. */ + if (TYPE_FN_FIELD_STUB (f, field_counter)) + continue; + phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter); + if (! is_constructor_name (phys_name)) + continue; + + /* If this method is actually defined, include it in the + list. */ + sym_arr[i1] = lookup_symbol (phys_name, + NULL, VAR_NAMESPACE, + (int *) NULL, + (struct symtab **) NULL); + if (sym_arr[i1]) + i1++; + } + } } } @@ -1180,7 +1213,7 @@ symbol_found: /* We also jump here from inside the C++ class/namespace { struct blockvector *bv = BLOCKVECTOR (sym_symtab); struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - if (lookup_block_symbol (b, copy, VAR_NAMESPACE) != NULL) + if (lookup_block_symbol (b, copy, NULL, VAR_NAMESPACE) != NULL) build_canonical_line_spec (values.sals, copy, canonical); } return values; |