public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/44668]  New: class->DW_TAG_typedef is missing DW_AT_accessibility
@ 2010-06-25 16:22 jan dot kratochvil at redhat dot com
  2010-06-25 16:32 ` [Bug debug/44668] " jan dot kratochvil at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-06-25 16:22 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

echo 'class C { protected: typedef int t; t v; } c;' | g++ -Wall -c -g -x c++ -

 <2><33>: Abbrev Number: 3 (DW_TAG_typedef)
    <34>   DW_AT_name        : t        
    <38>   DW_AT_type        : <0x4a>   
 <2><3c>: Abbrev Number: 4 (DW_TAG_member)
    <3d>   DW_AT_name        : v        
    <41>   DW_AT_type        : <0x33>   
    <45>   DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst:
0)
    <48>   DW_AT_accessibility: 2       (protected)

DIE <0x33> should have DW_AT_accessibility.

FAIL g++ (GCC) 4.6.0 20100625 (experimental)
FAIL g++ (GCC) 4.5.1 20100625 (prerelease)
SKIP g++ (GCC) 4.4.5 20100625 (prerelease) - C::t is missing there.
FAIL gcc-c++-4.4.4-8.fc14.x86_64

G++ properly respects the access control:
.C:3: error: ‘typedef int C::t’ is protected
.C:11: error: within this context

But GDB cannot display the access control during `ptype C'.
GDB does not and probably should not respect the access control, though.


-- 
           Summary: class->DW_TAG_typedef is missing DW_AT_accessibility
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jan dot kratochvil at redhat dot com
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug debug/44668] class->DW_TAG_typedef is missing DW_AT_accessibility
  2010-06-25 16:22 [Bug debug/44668] New: class->DW_TAG_typedef is missing DW_AT_accessibility jan dot kratochvil at redhat dot com
@ 2010-06-25 16:32 ` jan dot kratochvil at redhat dot com
  2010-06-25 16:54 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-06-25 16:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jan dot kratochvil at redhat dot com  2010-06-25 16:31 -------
Dependent GDB Bug:
http://sourceware.org/bugzilla/show_bug.cgi?id=11757


-- 


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


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

* [Bug debug/44668] class->DW_TAG_typedef is missing DW_AT_accessibility
  2010-06-25 16:22 [Bug debug/44668] New: class->DW_TAG_typedef is missing DW_AT_accessibility jan dot kratochvil at redhat dot com
  2010-06-25 16:32 ` [Bug debug/44668] " jan dot kratochvil at redhat dot com
@ 2010-06-25 16:54 ` jakub at gcc dot gnu dot org
  2010-06-25 18:23 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-25 16:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2010-06-25 16:53 -------
Created an attachment (id=21005)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21005&action=view)
gcc46-pr44668.patch

Patch to fix this for typedefs.  More work will be needed to handle it for
other DW_TAG_* type dies.

// PR debug/44668
// { dg-do compile }
// { dg-options "-g -dA" }

struct C
{
private:
  typedef int a;
  a b;
  enum g { g1, g2 } h;
  struct D { int i; } i;
protected:
  typedef int c;
  c d;
public:
  typedef int e;
  e f;
} c;


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED


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


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

* [Bug debug/44668] class->DW_TAG_typedef is missing DW_AT_accessibility
  2010-06-25 16:22 [Bug debug/44668] New: class->DW_TAG_typedef is missing DW_AT_accessibility jan dot kratochvil at redhat dot com
  2010-06-25 16:32 ` [Bug debug/44668] " jan dot kratochvil at redhat dot com
  2010-06-25 16:54 ` jakub at gcc dot gnu dot org
@ 2010-06-25 18:23 ` jakub at gcc dot gnu dot org
  2010-06-29 19:38 ` jakub at gcc dot gnu dot org
  2010-07-27  8:48 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-25 18:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2010-06-25 18:23 -------
Created an attachment (id=21006)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21006&action=view)
gcc46-pr44668.patch

Updated patch.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21005|0                           |1
        is obsolete|                            |


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


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

* [Bug debug/44668] class->DW_TAG_typedef is missing DW_AT_accessibility
  2010-06-25 16:22 [Bug debug/44668] New: class->DW_TAG_typedef is missing DW_AT_accessibility jan dot kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  2010-06-25 18:23 ` jakub at gcc dot gnu dot org
@ 2010-06-29 19:38 ` jakub at gcc dot gnu dot org
  2010-07-27  8:48 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-29 19:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2010-06-29 19:37 -------
Subject: Bug 44668

Author: jakub
Date: Tue Jun 29 19:37:46 2010
New Revision: 161563

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161563
Log:
        PR debug/44668
        * dwarf2out.c (add_accessibility_attribute): New function.
        (gen_subprogram_die, gen_variable_die, gen_field_die): Use it
        instead of adding DW_AT_accessibility manually.
        (gen_enumeration_type_die, gen_struct_or_union_type_die,
        gen_typedef_die): Use it.

        * g++.dg/debug/dwarf2/accessibility1.C: New test.

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


-- 


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


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

* [Bug debug/44668] class->DW_TAG_typedef is missing DW_AT_accessibility
  2010-06-25 16:22 [Bug debug/44668] New: class->DW_TAG_typedef is missing DW_AT_accessibility jan dot kratochvil at redhat dot com
                   ` (3 preceding siblings ...)
  2010-06-29 19:38 ` jakub at gcc dot gnu dot org
@ 2010-07-27  8:48 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-27  8:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2010-07-27 08:48 -------
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=44668


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-25 16:22 [Bug debug/44668] New: class->DW_TAG_typedef is missing DW_AT_accessibility jan dot kratochvil at redhat dot com
2010-06-25 16:32 ` [Bug debug/44668] " jan dot kratochvil at redhat dot com
2010-06-25 16:54 ` jakub at gcc dot gnu dot org
2010-06-25 18:23 ` jakub at gcc dot gnu dot org
2010-06-29 19:38 ` jakub at gcc dot gnu dot org
2010-07-27  8:48 ` 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).