This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/11067] New: p <enum constant> should print the constant's value
- From: "jyasskin at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 8 Dec 2009 21:48:41 -0000
- Subject: [Bug gdb/11067] New: p <enum constant> should print the constant's value
- Reply-to: sourceware-bugzilla at sourceware dot org
$ cat test.c
enum E {
Val1,
Val2
};
int main() {
enum E e = Val1;
return e;
}
...
Temporary breakpoint 1, main () at test.c:6
6 enum E e = Val1;
(gdb) n
7 return e;
(gdb) p e
$1 = Val1
(gdb) p Val1
$2 = Val1
(gdb) p (int)Val1
$3 = 0
When I print a variable, printing the symbolic name for its value is right, but
when I print the symbolic name, gdb should print its numeric value instead (or
in addition).
There's an easy workaround, of course, but gdb should DTRT in the first place.
--
Summary: p <enum constant> should print the constant's value
Product: gdb
Version: 7.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: gdb
AssignedTo: unassigned at sourceware dot org
ReportedBy: jyasskin at gmail dot com
CC: gdb-prs at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=11067
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.