public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/11067] New: p <enum constant> should print the constant's value
@ 2009-12-08 21:48 jyasskin at gmail dot com
  2009-12-08 21:51 ` [Bug gdb/11067] " ppluzhnikov at google dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: jyasskin at gmail dot com @ 2009-12-08 21:48 UTC (permalink / raw)
  To: gdb-prs

$ 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.


^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <bug-11067-4717@http.sourceware.org/bugzilla/>]

end of thread, other threads:[~2023-04-13 20:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-08 21:48 [Bug gdb/11067] New: p <enum constant> should print the constant's value jyasskin at gmail dot com
2009-12-08 21:51 ` [Bug gdb/11067] " ppluzhnikov at google dot com
2010-02-06 13:26 ` cmoller at redhat dot com
2010-02-16  2:49 ` cmoller at redhat dot com
2010-02-16  3:58 ` ppluzhnikov at google dot com
2010-02-16  5:17 ` jyasskin at gmail dot com
     [not found] <bug-11067-4717@http.sourceware.org/bugzilla/>
2013-08-06 20:01 ` kamaraju at gmail dot com
2013-08-06 20:39 ` kamaraju at gmail dot com
2013-08-08  9:52 ` palves at redhat dot com
2013-08-08 20:57 ` schwab@linux-m68k.org
2015-09-30 17:43 ` noloader at gmail dot com
2023-04-13 20:47 ` sam at gentoo 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).