Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
@ 2004-10-22 21:39 Joel Brobecker
  2004-11-01 19:50 ` Joel Brobecker
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2004-10-22 21:39 UTC (permalink / raw)
  To: gdb-patches

Hello,

Right now, new_symbol() in dwarf2read.c sometimes sets the type name
using the SYMBOL_NATURAL_NAME. This is causing problems with Ada,
because contrary to C++ or Java, we chose to perform our searches using
the mangled name, not the demangled one.

2004-10-22  Joel Brobecker  <brobecker@gnat.com>
        
        From Paul Hilfinger <hilfinger@gnat.com>
        * dwarf2read.c (new_symbol): Use SYMBOL_SEARCH_NAME rather than
        SYMBOL_NATURAL_NAME to set type names.

Tested on x86-linux. No regression. 
OK to apply?

Thanks,
-- 
Joel


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

* Re: [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
  2004-10-22 21:39 [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name Joel Brobecker
@ 2004-11-01 19:50 ` Joel Brobecker
  2004-11-29  2:12   ` Elena Zannoni
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2004-11-01 19:50 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

With the patch, I think I have a better change of getting a review...



On Fri, Oct 22, 2004 at 02:39:11PM -0700, Joel Brobecker wrote:
> Right now, new_symbol() in dwarf2read.c sometimes sets the type name
> using the SYMBOL_NATURAL_NAME. This is causing problems with Ada,
> because contrary to C++ or Java, we chose to perform our searches using
> the mangled name, not the demangled one.
> 
> 2004-10-22  Joel Brobecker  <brobecker@gnat.com>
>         
>         From Paul Hilfinger <hilfinger@gnat.com>
>         * dwarf2read.c (new_symbol): Use SYMBOL_SEARCH_NAME rather than
>         SYMBOL_NATURAL_NAME to set type names.
> 
> Tested on x86-linux. No regression. 
> OK to apply?

-- 
Joel

[-- Attachment #2: dwarf2read.c.diff --]
[-- Type: text/plain, Size: 657 bytes --]

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.168
diff -u -p -r1.168 dwarf2read.c
--- dwarf2read.c	19 Oct 2004 20:28:56 -0000	1.168
+++ dwarf2read.c	1 Nov 2004 19:49:49 -0000
@@ -6922,7 +6922,7 @@ new_symbol (struct die_info *die, struct
 		   this objfile, so we don't need to duplicate it for
 		   the type.  */
 		if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
-		  TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NATURAL_NAME (sym);
+		  TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym);
 		add_symbol_to_list (typedef_sym, list_to_add);
 	      }
 	  }

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

* Re: [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
  2004-11-01 19:50 ` Joel Brobecker
@ 2004-11-29  2:12   ` Elena Zannoni
  2004-11-29 19:54     ` Paul Hilfinger
  2004-12-01  3:05     ` Joel Brobecker
  0 siblings, 2 replies; 6+ messages in thread
From: Elena Zannoni @ 2004-11-29  2:12 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker writes:
 > With the patch, I think I have a better change of getting a review...
 > 
 > 
 > 
 > On Fri, Oct 22, 2004 at 02:39:11PM -0700, Joel Brobecker wrote:
 > > Right now, new_symbol() in dwarf2read.c sometimes sets the type name
 > > using the SYMBOL_NATURAL_NAME. This is causing problems with Ada,
 > > because contrary to C++ or Java, we chose to perform our searches using
 > > the mangled name, not the demangled one.
 > > 
 > > 2004-10-22  Joel Brobecker  <brobecker@gnat.com>
 > >         
 > >         From Paul Hilfinger <hilfinger@gnat.com>
 > >         * dwarf2read.c (new_symbol): Use SYMBOL_SEARCH_NAME rather than
 > >         SYMBOL_NATURAL_NAME to set type names.
 > > 
 > > Tested on x86-linux. No regression. 
 > > OK to apply?
 > 
 > -- 
 > Joel
 > Index: dwarf2read.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/dwarf2read.c,v
 > retrieving revision 1.168
 > diff -u -p -r1.168 dwarf2read.c
 > --- dwarf2read.c	19 Oct 2004 20:28:56 -0000	1.168
 > +++ dwarf2read.c	1 Nov 2004 19:49:49 -0000
 > @@ -6922,7 +6922,7 @@ new_symbol (struct die_info *die, struct
 >  		   this objfile, so we don't need to duplicate it for
 >  		   the type.  */
 >  		if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
 > -		  TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NATURAL_NAME (sym);
 > +		  TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym);
 >  		add_symbol_to_list (typedef_sym, list_to_add);
 >  	      }
 >  	  }

Sigh, this is a hack on top af another.  Unfortunately the initial
review of the symtab Ada changes wasn't helpful.  I have no choice but
to let this go in for now, however, please, start thinking of a way to
get rid of those special cases in SYMBOL_blah_NAME.  Making those
become part of the language vector comes to mind.

Can you come up with a test case for gdb.ada that shows the problem,
and is cured by this patch?


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

* Re: [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
  2004-11-29  2:12   ` Elena Zannoni
@ 2004-11-29 19:54     ` Paul Hilfinger
  2004-12-01  3:05     ` Joel Brobecker
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Hilfinger @ 2004-11-29 19:54 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: Joel Brobecker, gdb-patches


From hilfingr  Mon Nov 29 11:29:06 2004
Date: Mon, 29 Nov 2004 01:45:26 -0800
From: "Paul N. Hilfinger" <hilfingr@otisco.mckusick.com>
To: hilfingr@EECS.Berkeley.EDU
Reply-to: Hilfinger@otisco.mckusick.com
X-BTI-AntiSpam: sta:false/3/021,dcc:passed,rbl:off,wlbl:none
References: <200411290224.iAT2OHrd029832@tully.CS.Berkeley.EDU>
Original-recipient: rfc822;hilfingr@imap4.CS.Berkeley.EDU



> Sigh, this is a hack on top af another.  Unfortunately the initial
> review of the symtab Ada changes wasn't helpful.  I have no choice but
> to let this go in for now, however, please, start thinking of a way to
> get rid of those special cases in SYMBOL_blah_NAME.  Making those
> become part of the language vector comes to mind.

Elena,

Would you perhaps elaborate on this critique a bit?
SYMBOL_SEARCH_NAME is, by definition, the name by which a client (in
this case, a language module) looks up an entity, so it would seem
appropriate for this context.

Is your concern that SYMBOL_SEARCH_NAME (and the other SYMBOL_*_NAMEs,
for that matter) involve language-specific tests in their
implementations---i.e., that they are not properly object-orientized?
This of course is a long-standing blotch.  If you think it important,
I could fix it (for Ada and C++) as you suggest with some additions to
the language vector.  The only annoyance here is that we'd then want to
introduce a new fast mapping from 

	  enum language => struct language_defn * 

rather than using the current definition of
language_def (which does a lookup).

Paul


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

* Re: [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
  2004-11-29  2:12   ` Elena Zannoni
  2004-11-29 19:54     ` Paul Hilfinger
@ 2004-12-01  3:05     ` Joel Brobecker
  2005-02-15 20:24       ` Joel Brobecker
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2004-12-01  3:05 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

>  > > 2004-10-22  Joel Brobecker  <brobecker@gnat.com>
>  > >         
>  > >         From Paul Hilfinger <hilfinger@gnat.com>
>  > >         * dwarf2read.c (new_symbol): Use SYMBOL_SEARCH_NAME rather than
>  > >         SYMBOL_NATURAL_NAME to set type names.

> Sigh, this is a hack on top af another.  Unfortunately the initial
> review of the symtab Ada changes wasn't helpful.  I have no choice but
> to let this go in for now, however, please, start thinking of a way to
> get rid of those special cases in SYMBOL_blah_NAME.  Making those
> become part of the language vector comes to mind.

OK, I see Paul, who is the one who knows most about these symbol names
issues, has already answered, so I won't comment on that (I didn't have
much to say anyway :-).

> Can you come up with a test case for gdb.ada that shows the problem,
> and is cured by this patch?

Yes, I think so. I will commit a testcase and then commit this change.
Thanks for your review.

-- 
Joel


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

* Re: [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
  2004-12-01  3:05     ` Joel Brobecker
@ 2005-02-15 20:24       ` Joel Brobecker
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2005-02-15 20:24 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

> 2004-10-22  Joel Brobecker  <brobecker@gnat.com>
>         
>         From Paul Hilfinger <hilfinger@gnat.com>
>         * dwarf2read.c (new_symbol): Use SYMBOL_SEARCH_NAME rather than
>         SYMBOL_NATURAL_NAME to set type names.
> 
> > Can you come up with a test case for gdb.ada that shows the problem,
> > and is cured by this patch?
> 
> Yes, I think so. I will commit a testcase and then commit this change.
> Thanks for your review.

The testcase was committed, see:
http://sources.redhat.com/ml/gdb-patches/2005-02/msg00063.html.

I checked this fix in right after.

-- 
Joel


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

end of thread, other threads:[~2005-02-15 17:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22 21:39 [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name Joel Brobecker
2004-11-01 19:50 ` Joel Brobecker
2004-11-29  2:12   ` Elena Zannoni
2004-11-29 19:54     ` Paul Hilfinger
2004-12-01  3:05     ` Joel Brobecker
2005-02-15 20:24       ` Joel Brobecker

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