Commit 224d9de0 by Eugene Sharygin Committed by Jeff Law

gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with corrupt codes.

	* gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with
	corrupt codes.

From-SVN: r270607
parent f179b64e
2018-04-26 Eugene Sharygin <eush@ispras.ru>
* gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with
corrupt codes.
2019-04-26 Richard Sandiford <richard.sandiford@arm.com> 2019-04-26 Richard Sandiford <richard.sandiford@arm.com>
* tree.h (TYPE_VECTOR_SUBPARTS, SET_TYPE_VECTOR_SUBPARTS): Add * tree.h (TYPE_VECTOR_SUBPARTS, SET_TYPE_VECTOR_SUBPARTS): Add
......
...@@ -229,7 +229,10 @@ class TreePrinter: ...@@ -229,7 +229,10 @@ class TreePrinter:
val_code_name = val_tree_code_name[intptr(val_TREE_CODE)] val_code_name = val_tree_code_name[intptr(val_TREE_CODE)]
#print(val_code_name.string()) #print(val_code_name.string())
try:
result = '<%s 0x%x' % (val_code_name.string(), intptr(self.gdbval)) result = '<%s 0x%x' % (val_code_name.string(), intptr(self.gdbval))
except:
return '<tree 0x%x>' % intptr(self.gdbval)
if intptr(val_tclass) == tcc_declaration: if intptr(val_tclass) == tcc_declaration:
tree_DECL_NAME = self.node.DECL_NAME() tree_DECL_NAME = self.node.DECL_NAME()
if tree_DECL_NAME.is_nonnull(): if tree_DECL_NAME.is_nonnull():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment