public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [rfc] Remove "(anonymous class)" dummy name in partial DIEs
@ 2010-09-08 18:03 Ulrich Weigand
  2010-09-09 16:45 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2010-09-08 18:03 UTC (permalink / raw)
  To: gdb-patches, drow

Hello,

I'm seeing lot of error messages along the lines of "(anonymous class)
is defined only in psymtab" when running "maint check-symtabs" on ARM
when glibc debug info is available.

This seems to be caused by the fact that partial DIEs corresponding to
anonymous structs or classes get a dummy name of "(anonymous class)"
in fixup_partial_die, while the corresponding DIEs of full symbols
will actually have a NULL name.  This discrepancy is detected by the
check-symtabs command ...

The dummy name "(anonymous class)" was introduced in this patch:
http://sourceware.org/ml/gdb-patches/2004-04/msg00070.html
but I'm not quite sure why this was done.  Dan, do you recall?

In any case, simply removing this dummy name fixes the check-symtabs
output, without introducing any testsuite regressions.

Tested on armv7l-linux-gnueabi and i686-linux.

Is there any reason I'm missing why this dummy name should be set?

Bye,
Ulrich


ChangeLog:

	* dwarf2read.c (fixup_partial_die): Do not set dummy name for
	anonymous class partial DIEs.

Index: gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.450
diff -u -p -r1.450 dwarf2read.c
--- gdb/dwarf2read.c	1 Sep 2010 21:50:24 -0000	1.450
+++ gdb/dwarf2read.c	8 Sep 2010 17:06:01 -0000
@@ -9024,9 +9024,6 @@ fixup_partial_die (struct partial_die_in
     }
 
   /* Set default names for some unnamed DIEs.  */
-  if (part_die->name == NULL && (part_die->tag == DW_TAG_structure_type
-				 || part_die->tag == DW_TAG_class_type))
-    part_die->name = "(anonymous class)";
 
   if (part_die->name == NULL && part_die->tag == DW_TAG_namespace)
     part_die->name = "(anonymous namespace)";
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

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

* Re: [rfc] Remove "(anonymous class)" dummy name in partial DIEs
  2010-09-08 18:03 [rfc] Remove "(anonymous class)" dummy name in partial DIEs Ulrich Weigand
@ 2010-09-09 16:45 ` Daniel Jacobowitz
  2010-09-09 19:57   ` Ulrich Weigand
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2010-09-09 16:45 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On Wed, Sep 08, 2010 at 07:24:50PM +0200, Ulrich Weigand wrote:
> Hello,
> 
> I'm seeing lot of error messages along the lines of "(anonymous class)
> is defined only in psymtab" when running "maint check-symtabs" on ARM
> when glibc debug info is available.
> 
> This seems to be caused by the fact that partial DIEs corresponding to
> anonymous structs or classes get a dummy name of "(anonymous class)"
> in fixup_partial_die, while the corresponding DIEs of full symbols
> will actually have a NULL name.  This discrepancy is detected by the
> check-symtabs command ...
> 
> The dummy name "(anonymous class)" was introduced in this patch:
> http://sourceware.org/ml/gdb-patches/2004-04/msg00070.html
> but I'm not quite sure why this was done.  Dan, do you recall?

To match the full symbol reader, I think.  But I can't find what else
used "(anonymous class)"; I may have been confused by "(anonymous
namespace)".

> Is there any reason I'm missing why this dummy name should be set?

I don't think there is, at least not any more.

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: [rfc] Remove "(anonymous class)" dummy name in partial DIEs
  2010-09-09 16:45 ` Daniel Jacobowitz
@ 2010-09-09 19:57   ` Ulrich Weigand
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Weigand @ 2010-09-09 19:57 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

Daniel Jacobowitz wrote:
> On Wed, Sep 08, 2010 at 07:24:50PM +0200, Ulrich Weigand wrote:
> > The dummy name "(anonymous class)" was introduced in this patch:
> > http://sourceware.org/ml/gdb-patches/2004-04/msg00070.html
> > but I'm not quite sure why this was done.  Dan, do you recall?
> 
> To match the full symbol reader, I think.  But I can't find what else
> used "(anonymous class)"; I may have been confused by "(anonymous
> namespace)".
> 
> > Is there any reason I'm missing why this dummy name should be set?
> 
> I don't think there is, at least not any more.

OK, thanks for verifying ....  I've checked the patch in now.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

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

end of thread, other threads:[~2010-09-09 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 18:03 [rfc] Remove "(anonymous class)" dummy name in partial DIEs Ulrich Weigand
2010-09-09 16:45 ` Daniel Jacobowitz
2010-09-09 19:57   ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).