Commit dbb95ba7 authored by hjk's avatar hjk

Debugger: Fix pointer dereferencing in gdb dumper

Size depends on target arch, not host arch.

Change-Id: I8d7875159910f94b332967d14fa654a899f954fd
Reviewed-by: default avatarRainer Keller <>
Reviewed-by: default avatarhjk <>
parent a99c45d4
......@@ -1219,7 +1219,9 @@ class Dumper(DumperBase):
def dereference(self, addr):
#return long(gdb.Value(addr).cast(self.voidPtrType().pointer()).dereference())
return struct.unpack("P", self.readRawMemory(addr, self.ptrSize()))[0]
ptrSize = self.ptrSize()
code = "I" if ptrSize == 4 else "Q"
return struct.unpack(code, self.readRawMemory(addr, ptrSize))[0]
def extractInt64(self, addr):
return struct.unpack("q", self.readRawMemory(addr, 8))[0]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment