public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/45024]  New: wrong nesting for inner template class
@ 2010-07-21 18:34 tromey at gcc dot gnu dot org
  2010-07-21 21:54 ` [Bug debug/45024] " dodji at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2010-07-21 18:34 UTC (permalink / raw)
  To: gcc-bugs

I'm using gcc svn trunk as of yesterday.

Consider this test case:

struct S {
  typedef int sint;

  struct Q { };

  template<typename Z> struct T { };
};

S sval;
S::sint sintval;
S::Q qval;
S::T<int> tval;


In the generated DWARF, "sint" and "Q" are child DIEs of the DIE for S, e.g.:

 <1><25>: Abbrev Number: 2 (DW_TAG_structure_type)
    <26>   DW_AT_name        : S        
[...]
 <2><2f>: Abbrev Number: 3 (DW_TAG_structure_type)
    <30>   DW_AT_name        : Q        

However, this is not the case for S::T<int>:

 <1><48>: Abbrev Number: 6 (DW_TAG_structure_type)
    <49>   DW_AT_name        : (indirect string, offset: 0x18): T<int>


-- 
           Summary: wrong nesting for inner template class
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tromey at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45024


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

* [Bug debug/45024] wrong nesting for inner template class
  2010-07-21 18:34 [Bug debug/45024] New: wrong nesting for inner template class tromey at gcc dot gnu dot org
@ 2010-07-21 21:54 ` dodji at gcc dot gnu dot org
  2010-07-22  9:46   ` Dodji Seketeli
  2010-07-21 21:59 ` dodji at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-07-21 21:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dodji at gcc dot gnu dot org  2010-07-21 21:54 -------
I am testing this patch:

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ce35c91..bd3a97d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -17585,9 +17585,11 @@ scope_die_for (tree t, dw_die_ref context_die)
        {
          gcc_assert (debug_info_level <= DINFO_LEVEL_TERSE
                      || TREE_ASM_WRITTEN (containing_scope));
-
+         scope_die = lookup_type_die (containing_scope);
+         
          /* If none of the current dies are suitable, we get file scope.  */
-         scope_die = comp_unit_die;
+         if (scope_die == NULL)
+           scope_die = comp_unit_die;
        }
       else
        scope_die = lookup_type_die (containing_scope);


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-21 21:54:05
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45024


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

* [Bug debug/45024] wrong nesting for inner template class
  2010-07-21 18:34 [Bug debug/45024] New: wrong nesting for inner template class tromey at gcc dot gnu dot org
  2010-07-21 21:54 ` [Bug debug/45024] " dodji at gcc dot gnu dot org
@ 2010-07-21 21:59 ` dodji at gcc dot gnu dot org
  2010-07-22  9:46 ` dodji at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-07-21 21:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dodji at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-07-21 21:54:05         |2010-07-21 21:58:35
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45024


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

* [Bug debug/45024] wrong nesting for inner template class
  2010-07-21 18:34 [Bug debug/45024] New: wrong nesting for inner template class tromey at gcc dot gnu dot org
  2010-07-21 21:54 ` [Bug debug/45024] " dodji at gcc dot gnu dot org
  2010-07-21 21:59 ` dodji at gcc dot gnu dot org
@ 2010-07-22  9:46 ` dodji at redhat dot com
  2010-07-22 16:25 ` dodji at gcc dot gnu dot org
  2010-07-27  8:45 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: dodji at redhat dot com @ 2010-07-22  9:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dodji at gcc dot gnu dot org  2010-07-22 09:46 -------
Subject: Re:  wrong nesting for inner template class


Patch posted to http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01718.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45024


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

* Re: [Bug debug/45024] wrong nesting for inner template class
  2010-07-21 21:54 ` [Bug debug/45024] " dodji at gcc dot gnu dot org
@ 2010-07-22  9:46   ` Dodji Seketeli
  0 siblings, 0 replies; 7+ messages in thread
From: Dodji Seketeli @ 2010-07-22  9:46 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs


Patch posted to http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01718.html


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

* [Bug debug/45024] wrong nesting for inner template class
  2010-07-21 18:34 [Bug debug/45024] New: wrong nesting for inner template class tromey at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-07-22  9:46 ` dodji at redhat dot com
@ 2010-07-22 16:25 ` dodji at gcc dot gnu dot org
  2010-07-27  8:45 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-07-22 16:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dodji at gcc dot gnu dot org  2010-07-22 16:25 -------
Subject: Bug 45024

Author: dodji
Date: Thu Jul 22 16:25:17 2010
New Revision: 162420

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162420
Log:
Fix PR debug/45024

gcc/ChangeLog:
        PR debug/45024
        * dwarf2out.c (scope_die_for): Don't fall back to the compilation
        unit DIE if we can find the scope DIE.

gcc/testsuite/ChangeLog:
        PR debug/45024
        * g++.dg/debug/dwarf2/nested-2.C: New test case.

Added:
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45024


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

* [Bug debug/45024] wrong nesting for inner template class
  2010-07-21 18:34 [Bug debug/45024] New: wrong nesting for inner template class tromey at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-07-22 16:25 ` dodji at gcc dot gnu dot org
@ 2010-07-27  8:45 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-27  8:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2010-07-27 08:45 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45024


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

end of thread, other threads:[~2010-07-27  8:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-21 18:34 [Bug debug/45024] New: wrong nesting for inner template class tromey at gcc dot gnu dot org
2010-07-21 21:54 ` [Bug debug/45024] " dodji at gcc dot gnu dot org
2010-07-22  9:46   ` Dodji Seketeli
2010-07-21 21:59 ` dodji at gcc dot gnu dot org
2010-07-22  9:46 ` dodji at redhat dot com
2010-07-22 16:25 ` dodji at gcc dot gnu dot org
2010-07-27  8:45 ` jakub at gcc dot gnu dot org

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).