Skip to content

Commit

Permalink
Fix 'invalid literal for int()' exception in pretty-printers
Browse files Browse the repository at this point in the history
Some pointers values include additional info,
so they can't be parsed with int().
  • Loading branch information
gentoo90 committed May 30, 2017
1 parent ac33d2c commit 167e4b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def get_child_at_index(self, index):

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):
Expand Down

0 comments on commit 167e4b0

Please sign in to comment.