* gdbhooks.py (TreePrinter.to_string): Recognize ggc_free'd memory.
* tree.c (get_tree_code_name): Likewise.
* print-tree.c (print_node): Only briefly print a node with an
invalid code.
From-SVN: r272150
+2019-06-11 Jason Merrill <jason@redhat.com>
+
+ * gdbhooks.py (TreePrinter.to_string): Recognize ggc_free'd memory.
+ * tree.c (get_tree_code_name): Likewise.
+ * print-tree.c (print_node): Only briefly print a node with an
+ invalid code.
+
2019-06-11 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/90819
# extern const enum tree_code_class tree_code_type[];
# #define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)]
+ if val_TREE_CODE == 0xa5a5:
+ return '<ggc_freed 0x%x>' % intptr(self.gdbval)
+
val_tree_code_type = gdb.parse_and_eval('tree_code_type')
val_tclass = val_tree_code_type[val_TREE_CODE]
return;
code = TREE_CODE (node);
+
+ /* It is unsafe to look at any other fields of a node with ERROR_MARK or
+ invalid code. */
+ if (code == ERROR_MARK || code >= MAX_TREE_CODES)
+ {
+ print_node_brief (file, prefix, node, indent);
+ return;
+ }
+
tclass = TREE_CODE_CLASS (code);
/* Don't get too deep in nesting. If the user wants to see deeper,
return;
}
- /* It is unsafe to look at any other fields of an ERROR_MARK node. */
- if (code == ERROR_MARK)
- {
- print_node_brief (file, prefix, node, indent);
- return;
- }
-
/* Allow this function to be called if the table is not there. */
if (table)
{
const char *invalid = "<invalid tree code>";
if (code >= MAX_TREE_CODES)
- return invalid;
+ {
+ if (code == 0xa5a5)
+ return "ggc_freed";
+ return invalid;
+ }
return tree_code_name[code];
}