Skip to content

Commit 167e4b0

Browse files
committed
Fix 'invalid literal for int()' exception in pretty-printers
Some pointers values include additional info, so they can't be parsed with int().
1 parent ac33d2c commit 167e4b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/etc/gdb_rust_pretty_printing.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def get_child_at_index(self, index):
7878

7979
def as_integer(self):
8080
if self.gdb_val.type.code == gdb.TYPE_CODE_PTR:
81-
return int(str(self.gdb_val), 0)
81+
as_str = str(self.gdb_val).split()[0]
82+
return int(as_str, 0)
8283
return int(self.gdb_val)
8384

8485
def get_wrapped_value(self):

0 commit comments

Comments
 (0)