diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2014-12-10 23:16:42 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2014-12-10 23:16:42 +0000 |
commit | 53afce203bb1ab0e9a9676d3278b190dd11ebb6a (patch) | |
tree | 6166a3087befedb208ea966594d5da2e95f3bc90 /gcc/gdbhooks.py | |
parent | 52747219da6a56d3f607d84ac51fa82e2e55075d (diff) | |
download | gcc-53afce203bb1ab0e9a9676d3278b190dd11ebb6a.zip gcc-53afce203bb1ab0e9a9676d3278b190dd11ebb6a.tar.gz gcc-53afce203bb1ab0e9a9676d3278b190dd11ebb6a.tar.bz2 |
gdbhooks.py (class DWDieRefPrinter): New class.
* gdbhooks.py (class DWDieRefPrinter): New class.
(build_pretty_printer): Register dw_die_ref's.
From-SVN: r218612
Diffstat (limited to 'gcc/gdbhooks.py')
-rw-r--r-- | gcc/gdbhooks.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py index a74e712..6d9e41e 100644 --- a/gcc/gdbhooks.py +++ b/gcc/gdbhooks.py @@ -253,6 +253,26 @@ class CGraphNodePrinter: return result ###################################################################### +# Dwarf DIE pretty-printers +###################################################################### + +class DWDieRefPrinter: + def __init__(self, gdbval): + self.gdbval = gdbval + + def to_string (self): + if long(self.gdbval) == 0: + return '<dw_die_ref 0x0>' + result = '<dw_die_ref 0x%x' % long(self.gdbval) + result += ' %s' % self.gdbval['die_tag'] + if long(self.gdbval['die_parent']) != 0: + result += ' <parent=0x%x %s>' % (long(self.gdbval['die_parent']), + self.gdbval['die_parent']['die_tag']) + + result += '>' + return result + +###################################################################### class GimplePrinter: def __init__(self, gdbval): @@ -455,6 +475,8 @@ def build_pretty_printer(): 'tree', TreePrinter) pp.add_printer_for_types(['cgraph_node *'], 'cgraph_node', CGraphNodePrinter) + pp.add_printer_for_types(['dw_die_ref'], + 'dw_die_ref', DWDieRefPrinter) pp.add_printer_for_types(['gimple', 'gimple_statement_base *', # Keep this in the same order as gimple.def: |