public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-ambiguous-linespec: forgot to add .h file to the test suite earlier
@ 2011-08-15 15:28 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2011-08-15 15:28 UTC (permalink / raw)
  To: archer-commits

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 <tromey@redhat.com>
Date:   Mon Aug 15 09:27:46 2011 -0600

    forgot to add .h file to the test suite earlier

commit 3cd1604020109bf8612b3500a7f28b02b264a623
Author: Tom Tromey <tromey@redhat.com>
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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-15 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-15 15:28 [SCM] archer-tromey-ambiguous-linespec: forgot to add .h file to the test suite earlier tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).