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:
@@ -78,7 +78,8 @@ class GdbValue(rustpp.Value):
|
|||||||
|
|
||||||
def as_integer(self):
|
def as_integer(self):
|
||||||
if self.gdb_val.type.code == gdb.TYPE_CODE_PTR:
|
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)
|
return int(self.gdb_val)
|
||||||
|
|
||||||
def get_wrapped_value(self):
|
def get_wrapped_value(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user