From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27704 invoked by alias); 15 Aug 2011 15:28:40 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 27654 invoked by uid 306); 15 Aug 2011 15:28:38 -0000 Date: Mon, 15 Aug 2011 15:28:00 -0000 Message-ID: <20110815152838.27638.qmail@sourceware.org> From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-ambiguous-linespec: forgot to add .h file to the test suite earlier X-Git-Refname: refs/heads/archer-tromey-ambiguous-linespec X-Git-Reftype: branch X-Git-Oldrev: a5f2ba1785713e3d3b8bd27c82f444774022c9e2 X-Git-Newrev: e5795a75c3cac7bb44b2c04579fc105bab2abdc8 X-SW-Source: 2011-q3/txt/msg00101.txt.bz2 List-Id: The branch, archer-tromey-ambiguous-linespec has been updated via e5795a75c3cac7bb44b2c04579fc105bab2abdc8 (commit) via 3cd1604020109bf8612b3500a7f28b02b264a623 (commit) from a5f2ba1785713e3d3b8bd27c82f444774022c9e2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit e5795a75c3cac7bb44b2c04579fc105bab2abdc8 Author: Tom Tromey Date: Mon Aug 15 09:27:46 2011 -0600 forgot to add .h file to the test suite earlier commit 3cd1604020109bf8612b3500a7f28b02b264a623 Author: Tom Tromey Date: Mon Aug 15 09:25:32 2011 -0600 fix some bugs with decode_compound make no-"file:" case work properly handle TYPE_CODE_NAMESPACE I think this still has some bugs in some obscure cases. In particular it seems like we should build up a list of candidate method names, then set breakpoints on all instances of those, probably sharing code with decode_variable for the mechanics ----------------------------------------------------------------------- Summary of changes: gdb/linespec.c | 42 ++++++++++++++++++++++++++++++------ gdb/testsuite/gdb.linespec/lspec.h | 9 +++++++ 2 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 gdb/testsuite/gdb.linespec/lspec.h First 500 lines of diff: diff --git a/gdb/linespec.c b/gdb/linespec.c index 78f312c..87c0e0f 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -218,6 +218,19 @@ cplusplus_error (const char *name, const char *fmt, ...) throw_error (NOT_FOUND_ERROR, "%s", message); } +/* A helper for iterate_over_all_matching_symtabs that is passed as a + callback to the expand_symtabs_matching method. */ + +static int +iterate_name_matcher (const char *name, void *d) +{ + const char **dname = d; + + if (strcmp_iw (name, *dname) == 0) + return 1; + return 0; +} + /* A helper that walks over all matching symtabs in all objfiles and calls CALLBACK for each symbol matching NAME. */ @@ -234,7 +247,10 @@ iterate_over_all_matching_symtabs (const char *name, struct symtab *symtab; if (objfile->sf) - objfile->sf->qf->expand_symtabs_for_function (objfile, name); + objfile->sf->qf->expand_symtabs_matching (objfile, NULL, + iterate_name_matcher, + ALL_DOMAIN, + &name); ALL_OBJFILE_SYMTABS (objfile, symtab) { @@ -1759,7 +1775,9 @@ collect_one_symbol (struct symbol *sym, void *d) t = SYMBOL_TYPE (sym); CHECK_TYPEDEF (t); - if (TYPE_CODE (t) != TYPE_CODE_STRUCT && TYPE_CODE (t) != TYPE_CODE_UNION) + if (TYPE_CODE (t) != TYPE_CODE_STRUCT + && TYPE_CODE (t) != TYPE_CODE_UNION + && TYPE_CODE (t) != TYPE_CODE_NAMESPACE) return 1; slot = htab_find_slot (collector->unique_syms, sym, INSERT); @@ -1817,12 +1835,22 @@ lookup_prefix_sym (char **argptr, char *p, VEC (symtab_p) *file_symtabs) for (ix = 0; VEC_iterate (symtab_p, file_symtabs, ix, elt); ++ix) { - struct block *search_block = get_search_block (elt); + if (elt == NULL) + { + iterate_over_all_matching_symtabs (copy, STRUCT_DOMAIN, + collect_one_symbol, &collector); + iterate_over_all_matching_symtabs (copy, VAR_DOMAIN, + collect_one_symbol, &collector); + } + else + { + struct block *search_block = get_search_block (elt); - iterate_over_symbols (search_block, copy, STRUCT_DOMAIN, - collect_one_symbol, &collector); - iterate_over_symbols (search_block, copy, STRUCT_DOMAIN, - collect_one_symbol, &collector); + iterate_over_symbols (search_block, copy, STRUCT_DOMAIN, + collect_one_symbol, &collector); + iterate_over_symbols (search_block, copy, VAR_DOMAIN, + collect_one_symbol, &collector); + } } do_cleanups (cleanup); diff --git a/gdb/testsuite/gdb.linespec/lspec.h b/gdb/testsuite/gdb.linespec/lspec.h new file mode 100644 index 0000000..e4bfc00 --- /dev/null +++ b/gdb/testsuite/gdb.linespec/lspec.h @@ -0,0 +1,9 @@ +extern int m(int x); +extern int n(int y); + +namespace NameSpace { + int overload (); + int overload (int); + int overload (double); +}; + hooks/post-receive -- Repository for Project Archer.