binutils-gdb/gdb/python/lib/gdb
Joel Brobecker 1b58801583 [Python] Make regexp collection printers work with typedefs as well.
Consider the following type for which we would like to provide
a pretty-printer and manage it via RegexpCollectionPrettyPrinter:

        typedef long time_t;

Currently, this does not work because this framework only considers
the type's tag name:

        typename = gdb.types.get_basic_type(val.type).tag
        if not typename:
            return None

This patch extends it to use the type's name if the basic type
does not have a tag name, thus allowing the framework to also
work with typedefs like the above.

gdb/ChangeLog:

        * python/lib/gdb/printing.py (RegexpCollectionPrettyPrinter):
        Use the type's name if its basic type does not have a tag.

gdb/testsuite/ChangeLog:

        * testsuite/gdb.python/py-pp-re-notag.c: New file.
        * testsuite/gdb.python/py-pp-re-notag.ex: New file.
        * testsuite/gdb.python/py-pp-re-notag.p: New file.
2014-02-26 11:04:12 -08:00
..
command Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
function Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
FrameDecorator.py avoid python exception in FrameDecorator.py 2014-01-23 08:03:52 -07:00
FrameIterator.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
__init__.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
frames.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
printing.py [Python] Make regexp collection printers work with typedefs as well. 2014-02-26 11:04:12 -08:00
prompt.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
types.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00