aboutsummaryrefslogtreecommitdiff
path: root/gcc/gdbhooks.py
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-04-15 14:50:00 +0200
committerRichard Biener <rguenther@suse.de>2020-04-16 09:56:31 +0200
commitfc6b42bbaa298ea6c10af185e1dd0126f5a760cd (patch)
treeabce0086a3fbcce2af4b3b554ec80e0173f7a274 /gcc/gdbhooks.py
parentc8d88bf26e4c4c0eeddbf6a9dc184f28d4ef85e4 (diff)
downloadgcc-fc6b42bbaa298ea6c10af185e1dd0126f5a760cd.zip
gcc-fc6b42bbaa298ea6c10af185e1dd0126f5a760cd.tar.gz
gcc-fc6b42bbaa298ea6c10af185e1dd0126f5a760cd.tar.bz2
pretty-print SSA names
This adds the SSA name version to the gdb pretty-printing of SSA names. (gdb) p (tree)$1 $5 = <ssa_name 0x7ffff68435a0 323> 2020-04-16 Richard Biener <rguenther@suse.de> * gdbhooks.py (TreePrinter): Print SSA_NAME_VERSION of SSA_NAME nodes.
Diffstat (limited to 'gcc/gdbhooks.py')
-rw-r--r--gcc/gdbhooks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py
index e9acc373..0ab6f01 100644
--- a/gcc/gdbhooks.py
+++ b/gcc/gdbhooks.py
@@ -154,6 +154,7 @@ tree_code_dict = gdb.types.make_enum_dict(gdb.lookup_type('enum tree_code'))
# ...and look up specific values for use later:
IDENTIFIER_NODE = tree_code_dict['IDENTIFIER_NODE']
TYPE_DECL = tree_code_dict['TYPE_DECL']
+SSA_NAME = tree_code_dict['SSA_NAME']
# Similarly for "enum tree_code_class" (tree.h):
tree_code_class_dict = gdb.types.make_enum_dict(gdb.lookup_type('enum tree_code_class'))
@@ -252,6 +253,8 @@ class TreePrinter:
result += ' %s' % tree_TYPE_NAME.DECL_NAME().IDENTIFIER_POINTER()
if self.node.TREE_CODE() == IDENTIFIER_NODE:
result += ' %s' % self.node.IDENTIFIER_POINTER()
+ elif self.node.TREE_CODE() == SSA_NAME:
+ result += ' %u' % self.gdbval['base']['u']['version']
# etc
result += '>'
return result