Bug 11757

Summary: ptype class -> typedefs should display access control
Product: gdb Reporter: Jan Kratochvil <jan>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: minor CC: gdb-prs, ssbssa, Yenny.prathivi
Priority: P3    
Version: unknown   
Target Milestone: 8.1   
Host: Target:
Build: Last reconfirmed:

Description Jan Kratochvil 2010-06-25 16:31:38 UTC
Since patch
[patch 2/2] ptype should list also class's typedefs
http://sourceware.org/ml/gdb-patches/2010-06/msg00313.html

GDB does/will display typedefs during `ptype'.
It should display also their public/protected/private access control.

There is a prerequisite in GCC:
class->DW_TAG_typedef is missing DW_AT_accessibility
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44668
Comment 1 Hannes Domani 2023-12-17 13:32:45 UTC
This is working since gdb-8.1, was fixed by this commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c191a6875b118fce30e7dc4d9e4bd20eff850270

The output looks like this:
```
(gdb) pt C
type = struct C {
  private:
    a b;
    C::g h;
    C::D i;
  protected:
    a d;
  public:
    a f;

  private:
    typedef int a;
  protected:
    typedef int c;
  public:
    typedef int e;
}
```