Discussion:
[Bug symtab/17761] New: "ptype class_with_enum" doesn't include enum
dje at google dot com
2014-12-27 03:37:04 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=17761

Bug ID: 17761
Summary: "ptype class_with_enum" doesn't include enum
Product: gdb
Version: HEAD
Status: NEW
Severity: minor
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: dje at google dot com

When reading dwarf debug info, we don't record with the class that it contains
an enum.
This means that "ptype class_with_enum" can't print the enum.

class c2
{
public:
enum e { aaa, bbb };
int x;
};

(gdb) pt c2
type = class c2 {
public:
int x;
}
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-04-19 03:38:53 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=17761

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
This works when:

(1) I make sure the enum is emitted by the compiler:

class c2
{
public:
enum e { aaa, bbb };
int x;
};

c2 zzq;
c2::e zzy;
int main() { return 0; }


(2) set the nested type limit:

(gdb) set print type nested-type-limit unlimited
(gdb) ptype c2
type = class c2 {
public:
int x;

enum c2::e : unsigned int {c2::aaa, c2::bbb};
}


I'm not sure why the nested type thing is a numeric limit
(that seems weird since you can't control the ordering) as
opposed to a simple ptype flag like the other ones; and also
why it defaults to off.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...