diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2004-01-09 22:22:07 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2004-01-09 22:22:07 +0000 |
commit | 38d518c93e13bf0a79bff4fb828b3373991fa9bb (patch) | |
tree | c6a4bb870afffff5b9a4d8419837b92d0836758e /gdb/cp-namespace.c | |
parent | 0fb33ef4f8e2e9abd87ac48a8935cfc3b7f29cba (diff) | |
download | gdb-38d518c93e13bf0a79bff4fb828b3373991fa9bb.zip gdb-38d518c93e13bf0a79bff4fb828b3373991fa9bb.tar.gz gdb-38d518c93e13bf0a79bff4fb828b3373991fa9bb.tar.bz2 |
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.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 044b473..a766acb 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); } |