Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@kealia.com>
To: gdb-patches@sources.redhat.com
Cc: Daniel Jacobowitz <drow@mvista.com>
Subject: [rfa] always use demangled name to set scope
Date: Thu, 12 Jun 2003 22:26:00 -0000	[thread overview]
Message-ID: <m3wufrvso5.fsf@dhcp-10-42-69-238.kealia.com> (raw)

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.  */


             reply	other threads:[~2003-06-12 22:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-12 22:26 David Carlton [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3wufrvso5.fsf@dhcp-10-42-69-238.kealia.com \
    --to=carlton@kealia.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox