Bug 11757 - ptype class -> typedefs should display access control
Summary: ptype class -> typedefs should display access control
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 minor
Target Milestone: 8.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-25 16:31 UTC by Jan Kratochvil
Modified: 2023-12-17 13:32 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;
}
```