From 1b588015839caafc608a6944a78aea170f5fb2f6 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 30 Jan 2014 07:37:08 +0400 Subject: [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. --- gdb/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/ChangeLog') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 49d8113..026d0a9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-02-27 Joel Brobecker + * python/lib/gdb/printing.py (RegexpCollectionPrettyPrinter): + Use the type's name if its basic type does not have a tag. + +2014-02-27 Joel Brobecker + * dwarf2read.c (read_subrange_type): Add comment. 2014-02-27 Joel Brobecker -- cgit v1.1