pretty-print SSA names
authorRichard Biener <rguenther@suse.de>
Wed, 15 Apr 2020 12:50:00 +0000 (14:50 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 16 Apr 2020 07:56:31 +0000 (09:56 +0200)
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.

gcc/ChangeLog
gcc/gdbhooks.py

index ae08fbec2f715a1bd33792bc5e80b9f6a58b72a5..899285cf46f3ade33036a3035b7d8ba942b8345d 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-16  Richard Biener  <rguenther@suse.de>
+
+       * gdbhooks.py (TreePrinter): Print SSA_NAME_VERSION of SSA_NAME
+       nodes.
+
 2020-04-15  Uroš Bizjak  <ubizjak@gmail.com>
 
        PR target/94603
index e9acc373126f7871da549bf0c96367e5d4d80e8a..0ab6f01f92711525578c8e37bc808b0cc2d09b82 100644 (file)
@@ -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