From: law Date: Fri, 26 Apr 2019 15:48:43 +0000 (+0000) Subject: * gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a457d6ebd9c86d69fe4e571184000b1b2344c332;p=thirdparty%2Fgcc.git * gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with corrupt codes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270607 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3330d1c8905f..4434ba564832 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-04-26 Eugene Sharygin + + * gdbhooks.py: Fix UnicodeDecodeErrors when printing trees with + corrupt codes. + 2019-04-26 Richard Sandiford * tree.h (TYPE_VECTOR_SUBPARTS, SET_TYPE_VECTOR_SUBPARTS): Add diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py index bbe7618e299a..7b1a7be0002d 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 '' % intptr(self.gdbval) if intptr(val_tclass) == tcc_declaration: tree_DECL_NAME = self.node.DECL_NAME() if tree_DECL_NAME.is_nonnull():