old-cross-binutils/gdb/testsuite/gdb.python
Joel Brobecker c0d4881122 [python] Add gdb.Type.name attribute.
Consider the following declarations:

    typedef long our_time_t;
    our_time_t current_time = 1384395743;

The purpose of this patch is to allow the use of a pretty-printer
for variables of type our_time_t.  Normally, pretty-printing sniffers
use the tag name in order to determine which, if any, pretty-printer
should be used. But in the case above, the tag name is not set, since
it does not apply to integral types.

This patch extends the gdb.Type list of attributes to also include
the name of the type, thus allowing the sniffer to match against
that name. With that change, I was able to write a pretty-printer
which displays our variable as follow:

    (gdb) print current_time
    $1 = Thu Nov 14 02:22:23 2013 (1384395743)

gdb/ChangeLog:

        * python/py-type.c (typy_get_name): New function.
        (type_object_getset): Add entry for attribute "name".
        * NEWS: Add entry mentioning this new attribute.

gdb/doc/ChangeLog:

        * gdb.texinfo (Types In Python): Document new attribute Types.name.

gdb/testsuite:

        * gdb.python/py-pp-integral.c: New file.
        * gdb.python/py-pp-integral.py: New file.
        * gdb.python/py-pp-integral.exp: New file.

Tested on x86_64-linux.
2014-01-07 07:11:17 +04:00
..
lib-types.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
lib-types.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Makefile.in Add a new method 'disassemble' to gdb.Architecture class. 2013-02-21 01:46:57 +00:00
py-arch.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-arch.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-block.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-block.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-breakpoint.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-breakpoint.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-cmd.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-cmd.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-error.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-error.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-events-shlib.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-events.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-events.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-events.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evsignal.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evthreads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evthreads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-explore-cc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-explore.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-explore.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-explore.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finish-breakpoint.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finish-breakpoint.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finish-breakpoint.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finish-breakpoint2.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finish-breakpoint2.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finish-breakpoint2.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame-args.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame-args.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame-args.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame-inline.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame-inline.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame.c
py-frame.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-framefilter-gdb.py.in Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-framefilter-mi.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-framefilter-mi.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-framefilter.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-framefilter.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-framefilter.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-function.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-inferior.c gdb/ 2012-07-26 19:09:35 +00:00
py-inferior.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-infthread.c
py-infthread.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-linetable.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-linetable.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-linetable.S Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-mi.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-objfile-script-gdb.py.in Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-objfile-script.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-objfile-script.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-objfile.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-objfile.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-parameter.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-pp-integral.c [python] Add gdb.Type.name attribute. 2014-01-07 07:11:17 +04:00
py-pp-integral.exp [python] Add gdb.Type.name attribute. 2014-01-07 07:11:17 +04:00
py-pp-integral.py [python] Add gdb.Type.name attribute. 2014-01-07 07:11:17 +04:00
py-pp-maint.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-pp-maint.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-pp-maint.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-prettyprint.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-prettyprint.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-prettyprint.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-progspace.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-progspace.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-prompt.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-prompt.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-section-script.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-section-script.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-section-script.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-shared-sl.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-shared.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-shared.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-strfns.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-strfns.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-symbol.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-symbol.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-symtab.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-sync-interp.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-sync-interp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-template.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-template.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-type.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-type.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-typeprint.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-typeprint.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-typeprint.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-value-cc.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-value-cc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-value.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-value.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
python-1.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
python.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
python.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
source1 Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
source2.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00