aboutsummaryrefslogtreecommitdiff
path: root/gcc/gdbhooks.py
diff options
context:
space:
mode:
authorEugene Sharygin <eush@ispras.ru>2019-04-26 15:48:43 +0000
committerJeff Law <law@gcc.gnu.org>2019-04-26 09:48:43 -0600
commit224d9de0e84026e7c19c51f05d2f4e8dedd291ed (patch)
treeb85533da17b2713303f826b9e8ee9abcbb25d7bb /gcc/gdbhooks.py
parentf179b64e3ab013ff04e705953d33a2f82de6b086 (diff)
downloadgcc-224d9de0e84026e7c19c51f05d2f4e8dedd291ed.zip
gcc-224d9de0e84026e7c19c51f05d2f4e8dedd291ed.tar.gz
gcc-224d9de0e84026e7c19c51f05d2f4e8dedd291ed.tar.bz2
gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with corrupt codes.
* gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with corrupt codes. From-SVN: r270607
Diffstat (limited to 'gcc/gdbhooks.py')
-rw-r--r--gcc/gdbhooks.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py
index bbe7618..7b1a7be 100644
--- a/gcc/gdbhooks.py
+++ b/gcc/gdbhooks.py
@@ -229,7 +229,10 @@ class TreePrinter:
val_code_name = val_tree_code_name[intptr(val_TREE_CODE)]
#print(val_code_name.string())
- result = '<%s 0x%x' % (val_code_name.string(), intptr(self.gdbval))
+ try:
+ 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:
tree_DECL_NAME = self.node.DECL_NAME()
if tree_DECL_NAME.is_nonnull():