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

Some pointers values include additional info,
so they can't be parsed with int().
This commit is contained in:
gentoo90 2017-05-30 11:14:25 +03:00
parent ac33d2cbfb
commit 167e4b09d1

View File

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