Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@redhat.com>
To: David Carlton <carlton@kealia.com>
Cc: gdb-patches@sources.redhat.com,
	Elena Zannoni <ezannoni@redhat.com>, Jim Blandy <jimb@redhat.com>,
	Daniel Jacobowitz <drow@mvista.com>,
	Michael Elizabeth Chastain <mec@shout.net>
Subject: Re: [rfa] set processing_current_prefix properly (PR gdb/1520)
Date: Fri, 23 Jan 2004 22:28:00 -0000	[thread overview]
Message-ID: <16401.40827.389460.389150@localhost.redhat.com> (raw)
In-Reply-To: <m3oeszblvr.fsf@coconut.kealia.com>

David Carlton writes:
 > This is a fix for PR gdb/1520, a namespace problem with GCC 3.4.  The
 > problem was that, if we have this situation:
 > 
 >   namespace N {
 >     void foo() { }
 >   }
 > 
 > then the compiler I had been using generated dies as following in its
 > DWARF 2 output:
 > 
 > 1: DW_TAG_namespace:
 > 
 >   2: DW_TAG_subprogram:
 > 
 >      // Definition of N::foo
 > 
 > whereas GCC head does:
 > 
 > 1: DW_TAG_namespace:
 > 
 >   2: DW_TAG_subprogram:
 > 
 >      // Declaration for N::foo
 > 
 > 3: DW_TAG_subprogram:
 > 
 >   DW_AT_specification: reference to die #2
 > 
 >   // Definition of N::foo.
 > 
 > 
 > So I've added code to notice if a die representing a function's
 > definition has a specification located elsewhere; if so, it looks at
 > that specification to discover the current enclosing class/namespace.
 > 


Can you add some of the above comments before the new call to check
for the specification?


 > (Probably there are other places where we need to do this; hopefully,
 > after a bit more experience, we'll find a less ad-hoc way of handling
 > this issue.)
 > 
 > It also fixes an inconsistency in my last patch - I had tried to
 > maintain the invariant that processing_current_prefix was always
 > non-NULL (i.e. was an actual string, albeit possibly an empty one),
 > but I was using determine_prefix in ways that violated that invariant.
 > 

So the only function that one should call in theory should be
determine_prefix, while possibly_determine_prefix is only there as a
worker function? Maybe this should be reflected in the names a bit
more explicitly. Like determine_prefix_worker or something like that
for the 'internal' one. I cannot think of a better term right now.

 > Tested on i686-pc-linux-gnu, DWARF 2, with GCC 3.2, GCC 3.2 +
 > DW_TAG_namespace patch, GCC 2.95.3, and GCC head.  No regressions;
 > fixes lots of FAILs in gdb.cp/namespace.exp with GCC head.  (From now
 > on, I'll probably stop testing with my patched GCC 3.2 and switch to
 > using a GCC snapshot generating DW_TAG_namespace, so I don't miss
 > problems like this.)
 > 
 > Okay to commit?
 > 

ok, modulus those 2 nits.

elena


  parent reply	other threads:[~2004-01-23 22:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-19 22:43 David Carlton
2004-01-23 22:05 ` David Carlton
2004-01-23 22:28 ` Elena Zannoni [this message]
2004-01-23 22:42   ` 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=16401.40827.389460.389150@localhost.redhat.com \
    --to=ezannoni@redhat.com \
    --cc=carlton@kealia.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    --cc=mec@shout.net \
    /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