Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] always use demangled name to set scope
@ 2003-06-12 22:26 David Carlton
  2003-06-12 23:18 ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: David Carlton @ 2003-06-12 22:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Daniel Jacobowitz

As per recent discussions, it seems likely that the variable
'processing_current_namespace' isn't always valid: if a function is
declared in a namespace but defined outside the body of that
namespace, then probably sometimes dwarf2read.c won't notice that,
because of a DW_AT_specification tag, the current namespace is
different from what is given by the immediate hierarchical structure.

I'm trying to sort this out on my branch, but I think I'd prefer a
less intrusive fix on the mainline, since we're about to branch for
GDB 6.0.  Fortunately, the mainline currently only uses that variable
in once place, namely cp_set_block_scope.  And, in that situation, it
has the fallback strategy of looking at the demangled name.

So this patch tells GDB to just always use that fallback strategy for
now.  It should work fine in the short term; we can get this all
straightened out fully for 6.1, as part of merging in the rest of my
branch (in particular nested types support).

Tested on GCC 3.2, DWARF 2, i686-pc-linux-gnu; no new regressions.  I
also ran gdb.c++/namespace.exp with a version of GCC patched to
generated DW_TAG_namespace entries, and I didn't get any regressions
there, either.  OK to commit?

David Carlton
carlton@kealia.com

2003-06-12  David Carlton  <carlton@kealia.com>

	* cp-namespace.c (cp_set_block_scope): Comment out
	processing_has_namespace_info branch.

Index: cp-namespace.c
===================================================================
RCS file: /cvs/src/src/gdb/cp-namespace.c,v
retrieving revision 1.2
diff -u -p -r1.2 cp-namespace.c
--- cp-namespace.c	20 May 2003 03:56:28 -0000	1.2
+++ cp-namespace.c	12 Jun 2003 22:17:47 -0000
@@ -38,6 +38,9 @@ unsigned char processing_has_namespace_i
    contain the name of the current namespace.  The string is
    temporary; copy it if you need it.  */
 
+/* FIXME: carlton/2003-06-12: This isn't entirely reliable: currently,
+   we get mislead by DW_AT_specification.  */
+
 const char *processing_current_namespace;
 
 /* List of using directives that are active in the current file.  */
@@ -187,6 +190,12 @@ cp_set_block_scope (const struct symbol 
 
   if (SYMBOL_CPLUS_DEMANGLED_NAME (symbol) != NULL)
     {
+#if 0
+      /* FIXME: carlton/2003-06-12: As mentioned above,
+	 'processing_has_namespace_info' currently isn't entirely
+	 reliable, so let's always use demangled names to get this
+	 information for now.  */
+
       if (processing_has_namespace_info)
 	{
 	  block_set_scope
@@ -196,6 +205,7 @@ cp_set_block_scope (const struct symbol 
 	     obstack);
 	}
       else
+#endif
 	{
 	  /* Try to figure out the appropriate namespace from the
 	     demangled name.  */


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-06-13 19:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-12 22:26 [rfa] always use demangled name to set scope David Carlton
2003-06-12 23:18 ` Daniel Jacobowitz
2003-06-13  1:01   ` David Carlton
2003-06-13  4:22     ` Daniel Jacobowitz
2003-06-13  4:28       ` David Carlton
2003-06-13  4:38         ` Daniel Jacobowitz
2003-06-13 18:53           ` David Carlton
2003-06-13 18:56             ` Daniel Jacobowitz
2003-06-13 19:01               ` David Carlton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox