public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/13281] New: provide simple pretty-printer for enum
@ 2011-10-11 20:24 tromey at redhat dot com
2011-10-11 20:31 ` [Bug python/13281] " tromey at redhat dot com
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2011-10-11 20:24 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13281
Bug #: 13281
Summary: provide simple pretty-printer for enum
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: python
AssignedTo: unassigned@sourceware.org
ReportedBy: tromey@redhat.com
Classification: Unclassified
It would be nice if there were some library functions
to make it very easy to instantiate a pretty-printer for enums.
Particularly, it would be useful sometimes to have an enum
printer which looks to see which enumerators could be or'd
together to get the value being printed.
That is:
(gdb) print p->field
$3 = CONSTANT | GLOBAL | WHATEVER
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/13281] provide simple pretty-printer for enum
2011-10-11 20:24 [Bug python/13281] New: provide simple pretty-printer for enum tromey at redhat dot com
@ 2011-10-11 20:31 ` tromey at redhat dot com
2011-10-20 17:43 ` naesten at gmail dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2011-10-11 20:31 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13281
--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2011-10-11 20:30:51 UTC ---
There is some code for this in gdb-gdb.py that could be
generalized & reused.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/13281] provide simple pretty-printer for enum
2011-10-11 20:24 [Bug python/13281] New: provide simple pretty-printer for enum tromey at redhat dot com
2011-10-11 20:31 ` [Bug python/13281] " tromey at redhat dot com
@ 2011-10-20 17:43 ` naesten at gmail dot com
2011-10-20 17:45 ` tromey at redhat dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: naesten at gmail dot com @ 2011-10-20 17:43 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13281
Samuel Bronson <naesten at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |naesten at gmail dot com
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/13281] provide simple pretty-printer for enum
2011-10-11 20:24 [Bug python/13281] New: provide simple pretty-printer for enum tromey at redhat dot com
2011-10-11 20:31 ` [Bug python/13281] " tromey at redhat dot com
2011-10-20 17:43 ` naesten at gmail dot com
@ 2011-10-20 17:45 ` tromey at redhat dot com
2012-01-16 19:44 ` cvs-commit at gcc dot gnu.org
2012-01-16 19:45 ` tromey at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2011-10-20 17:45 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13281
Tom Tromey <tromey at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at sourceware |tromey at redhat dot com
|dot org |
--- Comment #2 from Tom Tromey <tromey at redhat dot com> 2011-10-20 17:44:40 UTC ---
Testing a patch.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/13281] provide simple pretty-printer for enum
2011-10-11 20:24 [Bug python/13281] New: provide simple pretty-printer for enum tromey at redhat dot com
` (2 preceding siblings ...)
2011-10-20 17:45 ` tromey at redhat dot com
@ 2012-01-16 19:44 ` cvs-commit at gcc dot gnu.org
2012-01-16 19:45 ` tromey at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2012-01-16 19:44 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13281
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2012-01-16 19:44:19 UTC ---
CVSROOT: /cvs/src
Module name: src
Changes by: tromey@sourceware.org 2012-01-16 19:44:16
Modified files:
gdb : ChangeLog NEWS c-valprint.c dwarf2read.c
gdbtypes.h
gdb/doc : ChangeLog gdb.texinfo
gdb/python/lib/gdb: printing.py
gdb/testsuite : ChangeLog
gdb/testsuite/gdb.base: printcmds.c printcmds.exp
gdb/testsuite/gdb.python: py-pp-maint.c py-pp-maint.exp
py-pp-maint.py
Log message:
gdb
PR python/13281:
* gdbtypes.h (TYPE_FLAG_ENUM): New macro.
(struct main_type) <flag_flag_enum>: New field.
* dwarf2read.c (process_enumeration_scope): Detect "flag" enums.
* NEWS: Add entries.
* c-valprint.c (c_val_print) <TYPE_CODE_ENUM>: Handle "flag"
enums.
* python/lib/gdb/printing.py (_EnumInstance): New class.
(FlagEnumerationPrinter): Likewise.
gdb/doc
* gdb.texinfo (gdb.printing): Document FlagEnumerationPrinter.
gdb/testsuite
* gdb.base/printcmds.c (enum flag_enum): New.
(three): New global.
* gdb.base/printcmds.exp (test_print_enums): Add test for flag
enum printing.
* gdb.python/py-pp-maint.py (build_pretty_printer): Instantiate
FlagEnumerationPrinter.
* gdb.python/py-pp-maint.exp: Add tests for FlagEnumerationPrinter.
* gdb.python/py-pp-maint.c (enum flag_enum): New.
(fval): New global.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13738&r2=1.13739
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/NEWS.diff?cvsroot=src&r1=1.479&r2=1.480
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/c-valprint.c.diff?cvsroot=src&r1=1.88&r2=1.89
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.606&r2=1.607
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbtypes.h.diff?cvsroot=src&r1=1.160&r2=1.161
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/ChangeLog.diff?cvsroot=src&r1=1.1264&r2=1.1265
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/gdb.texinfo.diff?cvsroot=src&r1=1.911&r2=1.912
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/lib/gdb/printing.py.diff?cvsroot=src&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3023&r2=1.3024
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/printcmds.c.diff?cvsroot=src&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/printcmds.exp.diff?cvsroot=src&r1=1.42&r2=1.43
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-pp-maint.c.diff?cvsroot=src&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-pp-maint.exp.diff?cvsroot=src&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-pp-maint.py.diff?cvsroot=src&r1=1.4&r2=1.5
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/13281] provide simple pretty-printer for enum
2011-10-11 20:24 [Bug python/13281] New: provide simple pretty-printer for enum tromey at redhat dot com
` (3 preceding siblings ...)
2012-01-16 19:44 ` cvs-commit at gcc dot gnu.org
@ 2012-01-16 19:45 ` tromey at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2012-01-16 19:45 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13281
Tom Tromey <tromey at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |7.5
--- Comment #4 from Tom Tromey <tromey at redhat dot com> 2012-01-16 19:45:24 UTC ---
Fixed.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-16 19:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-11 20:24 [Bug python/13281] New: provide simple pretty-printer for enum tromey at redhat dot com
2011-10-11 20:31 ` [Bug python/13281] " tromey at redhat dot com
2011-10-20 17:43 ` naesten at gmail dot com
2011-10-20 17:45 ` tromey at redhat dot com
2012-01-16 19:44 ` cvs-commit at gcc dot gnu.org
2012-01-16 19:45 ` tromey at redhat dot com
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).