Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa+5.3] bug in my earlier DW_TAG_namespace patch
@ 2002-11-21 16:26 David Carlton
  2002-11-25 13:20 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: David Carlton @ 2002-11-21 16:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jim Blandy, Elena Zannoni

I just noticed that my earlier patch that allowed GDB to accept
DW_TAG_namespace entries had a bug in it.  The function
scan_partial_symbols in dwarf2read.c only descends into DIEs that have
a name; but anonymous namespaces can lead to DIEs without names which
have interesting children (where by "interesting" I mean that we want
to add partial symbols corresponding to them).  This could result in
us missing some partial symbols.

I've enclosed a patch below: for obvious reasons, it should go into
GDB 5.3 as well.  I've run GDB on a copy of GDB with this patch
applied and followed the control flow when GDB runs into various sorts
of DW_TAG_namespace entries, and the control flow seems to behave like
I expect it to.  (This is, admittedly, after only a limited amount of
testing.)  I'm in the middle of running the testsuite (I'll run it
twice, once on a compiler that doesn't generate DW_TAG_namespace
entries and once on a compiler that does); assuming that there are no
new regressions, is the patch okay?

David Carlton
carlton@math.stanford.edu

2002-11-21  David Carlton  <carlton@math.stanford.edu>

	* dwarf2read.c (scan_partial_symbols): Descend into namespace
	pdi's with no name.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.75
diff -u -p -r1.75 dwarf2read.c
--- dwarf2read.c	11 Nov 2002 00:55:34 -0000	1.75
+++ dwarf2read.c	22 Nov 2002 00:11:49 -0000
@@ -1359,7 +1359,9 @@ scan_partial_symbols (char *info_ptr, st
     {
       info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header);
 
-      if (pdi.name)
+      /* Anonymous namespaces have no name but are interesting.  */
+
+      if (pdi.name != NULL || pdi.tag == DW_TAG_namespace)
 	{
 	  switch (pdi.tag)
 	    {


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

* Re: [rfa+5.3] bug in my earlier DW_TAG_namespace patch
  2002-11-21 16:26 [rfa+5.3] bug in my earlier DW_TAG_namespace patch David Carlton
@ 2002-11-25 13:20 ` Andrew Cagney
  2002-11-25 13:37   ` Elena Zannoni
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-11-25 13:20 UTC (permalink / raw)
  To: Jim Blandy, Elena Zannoni; +Cc: David Carlton, gdb-patches

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

Hello,

David recommended this for:

#######          #####
#               #     #
#                     #
######           #####
       #   ###         #
#     #   ###   #     #
  #####    ###    ####

any comments?

Andrew

[-- Attachment #2: mailbox-message://ac131313@movemail/fsf/gdb/patches#10783294 --]
[-- Type: message/rfc822, Size: 4395 bytes --]

From: David Carlton <carlton@math.stanford.edu>
To: gdb-patches@sources.redhat.com
Cc: Jim Blandy <jimb@redhat.com>, Elena Zannoni <ezannoni@redhat.com>
Subject: [rfa+5.3] bug in my earlier DW_TAG_namespace patch
Date: 21 Nov 2002 16:26:22 -0800
Message-ID: <ro1fztuh2kx.fsf@jackfruit.Stanford.EDU>

I just noticed that my earlier patch that allowed GDB to accept
DW_TAG_namespace entries had a bug in it.  The function
scan_partial_symbols in dwarf2read.c only descends into DIEs that have
a name; but anonymous namespaces can lead to DIEs without names which
have interesting children (where by "interesting" I mean that we want
to add partial symbols corresponding to them).  This could result in
us missing some partial symbols.

I've enclosed a patch below: for obvious reasons, it should go into
GDB 5.3 as well.  I've run GDB on a copy of GDB with this patch
applied and followed the control flow when GDB runs into various sorts
of DW_TAG_namespace entries, and the control flow seems to behave like
I expect it to.  (This is, admittedly, after only a limited amount of
testing.)  I'm in the middle of running the testsuite (I'll run it
twice, once on a compiler that doesn't generate DW_TAG_namespace
entries and once on a compiler that does); assuming that there are no
new regressions, is the patch okay?

David Carlton
carlton@math.stanford.edu

2002-11-21  David Carlton  <carlton@math.stanford.edu>

	* dwarf2read.c (scan_partial_symbols): Descend into namespace
	pdi's with no name.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.75
diff -u -p -r1.75 dwarf2read.c
--- dwarf2read.c	11 Nov 2002 00:55:34 -0000	1.75
+++ dwarf2read.c	22 Nov 2002 00:11:49 -0000
@@ -1359,7 +1359,9 @@ scan_partial_symbols (char *info_ptr, st
     {
       info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header);
 
-      if (pdi.name)
+      /* Anonymous namespaces have no name but are interesting.  */
+
+      if (pdi.name != NULL || pdi.tag == DW_TAG_namespace)
 	{
 	  switch (pdi.tag)
 	    {


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

* Re: [rfa+5.3] bug in my earlier DW_TAG_namespace patch
  2002-11-25 13:20 ` Andrew Cagney
@ 2002-11-25 13:37   ` Elena Zannoni
  2002-11-25 13:43     ` David Carlton
  0 siblings, 1 reply; 4+ messages in thread
From: Elena Zannoni @ 2002-11-25 13:37 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Jim Blandy, Elena Zannoni, David Carlton, gdb-patches

Andrew Cagney writes:
 > Hello,
 > 
 > David recommended this for:
 > 
 > #######          #####
 > #               #     #
 > #                     #
 > ######           #####
 >        #   ###         #
 > #     #   ###   #     #
 >   #####    ###    ####
 > 
 > any comments?
 > 

I knew I was forgetting something. 

 > I just noticed that my earlier patch that allowed GDB to accept
 > DW_TAG_namespace entries had a bug in it.  The function
 > scan_partial_symbols in dwarf2read.c only descends into DIEs that have
 > a name; but anonymous namespaces can lead to DIEs without names which
 > have interesting children (where by "interesting" I mean that we want
 > to add partial symbols corresponding to them).  This could result in
 > us missing some partial symbols.
 > 
 > I've enclosed a patch below: for obvious reasons, it should go into
 > GDB 5.3 as well.  I've run GDB on a copy of GDB with this patch
 > applied and followed the control flow when GDB runs into various sorts
 > of DW_TAG_namespace entries, and the control flow seems to behave like
 > I expect it to.  (This is, admittedly, after only a limited amount of
 > testing.)  I'm in the middle of running the testsuite (I'll run it
 > twice, once on a compiler that doesn't generate DW_TAG_namespace
 > entries and once on a compiler that does); assuming that there are no
 > new regressions, is the patch okay?

Were there regressions?

If not, go ahead.

Elena


 > 
 > David Carlton
 > carlton@math.stanford.edu
 > 
 > 2002-11-21  David Carlton  <carlton@math.stanford.edu>
 > 
 > 	* dwarf2read.c (scan_partial_symbols): Descend into namespace
 > 	pdi's with no name.
 > 
 > Index: dwarf2read.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/dwarf2read.c,v
 > retrieving revision 1.75
 > diff -u -p -r1.75 dwarf2read.c
 > --- dwarf2read.c	11 Nov 2002 00:55:34 -0000	1.75
 > +++ dwarf2read.c	22 Nov 2002 00:11:49 -0000
 > @@ -1359,7 +1359,9 @@ scan_partial_symbols (char *info_ptr, st
 >      {
 >        info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header);
 >  
 > -      if (pdi.name)
 > +      /* Anonymous namespaces have no name but are interesting.  */
 > +
 > +      if (pdi.name != NULL || pdi.tag == DW_TAG_namespace)
 >  	{
 >  	  switch (pdi.tag)
 >  	    {
 > 


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

* Re: [rfa+5.3] bug in my earlier DW_TAG_namespace patch
  2002-11-25 13:37   ` Elena Zannoni
@ 2002-11-25 13:43     ` David Carlton
  0 siblings, 0 replies; 4+ messages in thread
From: David Carlton @ 2002-11-25 13:43 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: Andrew Cagney, Jim Blandy, gdb-patches

On Mon, 25 Nov 2002 16:33:09 -0500, Elena Zannoni <ezannoni@redhat.com> said:

>> I've enclosed a patch below: for obvious reasons, it should go into
>> GDB 5.3 as well.  I've run GDB on a copy of GDB with this patch
>> applied and followed the control flow when GDB runs into various
>> sorts of DW_TAG_namespace entries, and the control flow seems to
>> behave like I expect it to.  (This is, admittedly, after only a
>> limited amount of testing.)  I'm in the middle of running the
>> testsuite (I'll run it twice, once on a compiler that doesn't
>> generate DW_TAG_namespace entries and once on a compiler that
>> does); assuming that there are no new regressions, is the patch
>> okay?

> Were there regressions?

Nope.

> If not, go ahead.

Thanks, will do.

David Carlton
carlton@math.stanford.edu


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

end of thread, other threads:[~2002-11-25 21:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-21 16:26 [rfa+5.3] bug in my earlier DW_TAG_namespace patch David Carlton
2002-11-25 13:20 ` Andrew Cagney
2002-11-25 13:37   ` Elena Zannoni
2002-11-25 13:43     ` David Carlton

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