public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-swagiaal-using-directive: Created and used cp_lookup_symbol_namespace_incremental.
@ 2008-10-30 20:04 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2008-10-30 20:04 UTC (permalink / raw)
  To: archer-commits

The branch, archer-swagiaal-using-directive has been updated
       via  d4a7b9767cb269666dcc77ad274f8f3eb8d6ae4a (commit)
      from  b0f43894cad0734092967db5a1d67b248e621371 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit d4a7b9767cb269666dcc77ad274f8f3eb8d6ae4a
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Oct 30 16:04:28 2008 -0400

    Created and used cp_lookup_symbol_namespace_incremental.
    
    Fixes two tests in namespace.exp
    
    +2008-10-30  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* cp-support.h: Added prototype for
    +	cp_lookup_symbol_namespace_incremental.
    +	* cp-namespace.c (cp_lookup_symbol_namespace_incremental): New
    +	function.
    +	* valops.c (value_maybe_namespace_elt): use
    +	cp_lookup_symbol_namespace_incremental instead of
    +	cp_lookup_symbol_namespace.
    +
     2008-10-29  Sami Wagiaalla  <swagiaal@redhat.com>
    
     	* dwarf2read.c (determine_prefix): Added a rule to skip dies which

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog      |   10 ++++++++++
 gdb/cp-namespace.c |   36 ++++++++++++++++++++++++++++++++++++
 gdb/cp-support.h   |    6 ++++++
 gdb/valops.c       |    2 +-
 4 files changed, 53 insertions(+), 1 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6795e3c..59658b4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,13 @@
+2008-10-30  Sami Wagiaalla  <swagiaal@redhat.com>
+
+	* cp-support.h: Added prototype for 
+	cp_lookup_symbol_namespace_incremental.
+	* cp-namespace.c (cp_lookup_symbol_namespace_incremental): New 
+	function.
+	* valops.c (value_maybe_namespace_elt): use 
+	cp_lookup_symbol_namespace_incremental instead of 
+	cp_lookup_symbol_namespace.
+	
 2008-10-29  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* dwarf2read.c (determine_prefix): Added a rule to skip dies which
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index eccd866..05ac367 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -326,6 +326,42 @@ lookup_namespace_scope (const char *name,
 				     block, domain);
 }
 
+/* Searches the for the given NAME in the given NAMESPACE, using import 
+   statements implied by the given BLOCK, *and its' parents*. */
+struct symbol *
+cp_lookup_symbol_namespace_incremental (const char *namespace,
+                                        const char *name,
+                                        const char *linkage_name,
+                                        const struct block *block,
+                                        const domain_enum domain)
+{
+  struct symbol *sym;
+  const struct block *global_block = block_global_block (block);
+
+  printf("cp_lookup_symbol_namespace_incremental name %s\n", name);
+  /* Check if either no block is specified or it's a global block.  */
+
+  if (global_block == NULL)
+    return NULL;
+
+  while (block != global_block)
+    {
+      printf("  cp_lookup_symbol_namespace_incremental name %s in block %p [%p - %p]\n", name, block, (void*)block->startaddr, (void*)block->endaddr);
+      
+      sym = cp_lookup_symbol_namespace (namespace, name, linkage_name, block, domain);
+
+      if (sym != NULL)
+        return sym;
+
+      block = BLOCK_SUPERBLOCK (block);
+    }
+
+  /* We've reached the global block without finding a result.  */
+
+  return NULL;
+}
+
+
 /* Look up NAME in the C++ namespace NAMESPACE, applying the using
    directives that are active in BLOCK.  Other arguments are as in
    cp_lookup_symbol_nonlocal.  */
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index b288ea3..bd30c3d 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -110,6 +110,12 @@ extern struct symbol *lookup_namespace_scope (const char *name,
                                               const char *scope,
                                               int scope_len);
 
+extern struct symbol *cp_lookup_symbol_namespace_incremental (const char *namespace,
+                                                              const char *name,
+                                                              const char *linkage_name,
+                                                              const struct block *block,
+                                                              const domain_enum domain);
+
 extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
 						  const char *name,
 						  const char *linkage_name,
diff --git a/gdb/valops.c b/gdb/valops.c
index 0d1ffdf..6cd1f61 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2715,7 +2715,7 @@ value_maybe_namespace_elt (const struct type *curtype,
   struct symbol *sym;
   struct value *result;
 
-  sym = cp_lookup_symbol_namespace (namespace_name, name, NULL,
+  sym = cp_lookup_symbol_namespace_incremental (namespace_name, name, NULL,
 				    get_selected_block (0), 
 				    VAR_DOMAIN);
 


hooks/post-receive
--
Repository for Project Archer.


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

only message in thread, other threads:[~2008-10-30 20:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-30 20:04 [SCM] archer-swagiaal-using-directive: Created and used cp_lookup_symbol_namespace_incremental swagiaal

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).