summaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2004-01-09 22:22:07 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2004-01-09 22:22:07 +0000
commitd31232175bf7b5541608c14d7d61e149ef272317 (patch)
treec84596335df2c992b694bd7653fdd4247fc21aad /gdb/cp-namespace.c
parentc1c0ccfd7fc214ee747d95c956fa8f3549bd7fab (diff)
downloadgdb-d31232175bf7b5541608c14d7d61e149ef272317.tar.gz
2004-01-09 David Carlton <carlton@kealia.com>
Checked in by Elena Zannoni <ezannoni@redhat.com>. * dwarf2read.c (read_namespace): Pull out name-generating code into namespace_name. Rename previous_namespace to previous_prefix and processing_current_namespace to processing_current_prefix.. (namespace_name): New function. (add_partial_symbol): Substitute uses of pdi->name with actual_name. * cp-support.h: Rename processing_current_namespace to processing_current_prefix. Update copyright year. * cp-namespace.c: Rename processing_current_namespace to processing_current_prefix. Update copyright year.
Diffstat (limited to 'gdb/cp-namespace.c')
-rw-r--r--gdb/cp-namespace.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 044b4737d50..a766acb470a 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -1,5 +1,5 @@
/* Helper routines for C++ support in GDB.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
Contributed by David Carlton and by Kealia, Inc.
@@ -38,14 +38,22 @@
unsigned char processing_has_namespace_info;
-/* If processing_has_namespace_info is nonzero, this string should
- contain the name of the current namespace. The string is
- temporary; copy it if you need it. */
+/* This contains our best guess as to the name of the current
+ enclosing namespace(s)/class(es), if any. For example, if we're
+ within the method foo() in the following code:
-/* FIXME: carlton/2003-06-12: This isn't entirely reliable: currently,
- we get mislead by DW_AT_specification. */
+ namespace N {
+ class C {
+ void foo () {
+ }
+ };
+ }
+
+ then processing_current_prefix should be set to "N::C". If
+ processing_has_namespace_info is false, then this variable might
+ not be reliable. */
-const char *processing_current_namespace;
+const char *processing_current_prefix;
/* List of using directives that are active in the current file. */
@@ -223,8 +231,8 @@ cp_set_block_scope (const struct symbol *symbol,
if (processing_has_namespace_info)
{
block_set_scope
- (block, obsavestring (processing_current_namespace,
- strlen (processing_current_namespace),
+ (block, obsavestring (processing_current_prefix,
+ strlen (processing_current_prefix),
obstack),
obstack);
}