Fix 'invalid literal for int()' exception with unicode in pretty-printers

str() can't handle unicode strings
This commit is contained in:
gentoo90 2017-05-30 23:42:35 +03:00
parent 167e4b09d1
commit 10977bcf6c

View file

@ -78,7 +78,7 @@ class GdbValue(rustpp.Value):
def as_integer(self):
if self.gdb_val.type.code == gdb.TYPE_CODE_PTR:
as_str = str(self.gdb_val).split()[0]
as_str = unicode(self.gdb_val).split()[0]
return int(as_str, 0)
return int(self.gdb_val)