public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-swagiaal-using-directive: A namespace search is correctly performed at each level of block search.
@ 2008-10-20 19:55 swagiaal
0 siblings, 0 replies; only message in thread
From: swagiaal @ 2008-10-20 19:55 UTC (permalink / raw)
To: archer-commits
The branch, archer-swagiaal-using-directive has been updated
via f3b644d45b62be1beb48bc48a569e7540cf7ae94 (commit)
from f09f0d0e225106082b73da536855ffbaf94809da (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit f3b644d45b62be1beb48bc48a569e7540cf7ae94
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date: Mon Oct 20 15:43:40 2008 -0400
A namespace search is correctly performed at each level of block search.
+2008-10-20 Sami Wagiaalla <swagiaal@redhat.com>
+
+ * symtab.c (lookup_symbol_aux_local): Search continues through static
+ and stops at global block.
+ Now does a namespace at each block level via lookup_namespace_scope.
+ * cp-support.h: Added extern lookup_namespace_scope prototype.
+ * cp-namespace.c (lookup_namespace_scope): Removed static qualifier.
+ (cp_lookup_symbol_nonlocal): Now calls lookup_symbol_file if call to
+ lookup_namespace_scope fails.
+ (cp_lookup_symbol_namespace): Reuturn NULL if no namespace is
+ specified.
+
2008-09-09 Sami Wagiaalla <swagiaal@redhat.com>
* dwarf2read.c (process_die): Added call to
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 12 ++++++++++++
gdb/cp-namespace.c | 22 ++++++++++------------
gdb/cp-support.h | 7 +++++++
gdb/symtab.c | 16 ++++++++++++----
4 files changed, 41 insertions(+), 16 deletions(-)
First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 991aa65..f388500 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2008-10-20 Sami Wagiaalla <swagiaal@redhat.com>
+
+ * symtab.c (lookup_symbol_aux_local): Search continues through static
+ and stops at global block.
+ Now does a namespace at each block level via lookup_namespace_scope.
+ * cp-support.h: Added extern lookup_namespace_scope prototype.
+ * cp-namespace.c (lookup_namespace_scope): Removed static qualifier.
+ (cp_lookup_symbol_nonlocal): Now calls lookup_symbol_file if call to
+ lookup_namespace_scope fails.
+ (cp_lookup_symbol_namespace): Reuturn NULL if no namespace is
+ specified.
+
2008-09-09 Sami Wagiaalla <swagiaal@redhat.com>
* dwarf2read.c (process_die): Added call to
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 5830af6..d3ffcb7 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -38,13 +38,6 @@ static struct using_direct *using_list;
static struct using_direct *cp_copy_usings (struct using_direct *using,
struct obstack *obstack);
-static struct symbol *lookup_namespace_scope (const char *name,
- const char *linkage_name,
- const struct block *block,
- const domain_enum domain,
- const char *scope,
- int scope_len);
-
static struct symbol *lookup_symbol_file (const char *name,
const char *linkage_name,
const struct block *block,
@@ -294,8 +287,14 @@ cp_lookup_symbol_nonlocal (const char *name,
const struct block *block,
const domain_enum domain)
{
- return lookup_namespace_scope (name, linkage_name, block, domain,
- block_scope (block), 0);
+
+ struct symbol* sym = lookup_namespace_scope(name, linkage_name, block,
+ domain, block_scope(block), 0);
+
+ if (sym != NULL)
+ return sym;
+
+ return lookup_symbol_file(name, linkage_name, block, domain, 0);
}
/* Lookup NAME at namespace scope (or, in C terms, in static and
@@ -313,7 +312,7 @@ cp_lookup_symbol_nonlocal (const char *name,
"A::x", and if that call fails, then the first call looks for
"x". */
-static struct symbol *
+struct symbol *
lookup_namespace_scope (const char *name,
const char *linkage_name,
const struct block *block,
@@ -393,8 +392,7 @@ cp_lookup_symbol_namespace (const char *namespace,
if (namespace[0] == '\0')
{
- return lookup_symbol_file (name, linkage_name, block,
- domain, 0);
+ return NULL;
}
else
{
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index ce34022..b288ea3 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -103,6 +103,13 @@ extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
const struct block *block,
const domain_enum domain);
+extern struct symbol *lookup_namespace_scope (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ const char *scope,
+ int scope_len);
+
extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
const char *name,
const char *linkage_name,
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 1a0dcba..3cf0b04 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -42,6 +42,7 @@
#include "ada-lang.h"
#include "p-lang.h"
#include "addrmap.h"
+#include "cp-support.h"
#include "hashtab.h"
@@ -1359,22 +1360,29 @@ lookup_symbol_aux_local (const char *name, const char *linkage_name,
const domain_enum domain)
{
struct symbol *sym;
- const struct block *static_block = block_static_block (block);
+ const struct block *global_block = block_global_block (block);
/* Check if either no block is specified or it's a global block. */
- if (static_block == NULL)
+ if (global_block == NULL)
return NULL;
- while (block != static_block)
+ while (block != global_block)
{
sym = lookup_symbol_aux_block (name, linkage_name, block, domain);
if (sym != NULL)
return sym;
+
+ sym = lookup_namespace_scope (name, linkage_name, block, domain,
+ block_scope (block), 0);
+
+ if (sym != NULL)
+ return sym;
+
block = BLOCK_SUPERBLOCK (block);
}
- /* We've reached the static block without finding a result. */
+ /* We've reached the global block without finding a result. */
return NULL;
}
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-20 19:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-20 19:55 [SCM] archer-swagiaal-using-directive: A namespace search is correctly performed at each level of block search 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).