Add compat_str() which works with unicode in both Python 2 and 3
GDB can be built with Python 2 or with Python 3
This commit is contained in:
@@ -78,7 +78,7 @@ class GdbValue(rustpp.Value):
|
||||
|
||||
def as_integer(self):
|
||||
if self.gdb_val.type.code == gdb.TYPE_CODE_PTR:
|
||||
as_str = unicode(self.gdb_val).split()[0]
|
||||
as_str = rustpp.compat_str(self.gdb_val).split()[0]
|
||||
return int(as_str, 0)
|
||||
return int(self.gdb_val)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user