binutils-gdb/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/gdb Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-arch.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-auto-load.c 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-bpevent.c 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-cmd.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-continueevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-event.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-event.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-events.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evtregistry.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evts.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-exitedevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finishbreakpoint.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame.c 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-function.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-gdb-readline.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-inferior.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-infthread.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-lazy-string.c 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-newobjfileevent.c 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-param.c 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-progspace.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-signalevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-stopevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-stopevent.h 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-symtab.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-threadevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-type.c [python] Add gdb.Type.name attribute. 2014-01-07 07:11:17 +04:00
py-utils.c 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
python-config.py Add support for Python 3. 2012-12-12 16:47:30 +00:00
python-internal.h 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.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00