Commit 700eca4b authored by hjk's avatar hjk

Debugger: Make memory accessible again with gdb < 7.4

gdb.selected_inferior is too new for now.

Change-Id: I4290574b6dd2803a2fd2f860700693e7b2ac6efb
Reviewed-by: default avatarRainer Keller <rainer.keller@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent dbb95ba7
......@@ -1208,8 +1208,15 @@ class Dumper(DumperBase):
# Try _some_ fallback (good enough for the std::complex dumper)
return gdb.parse_and_eval("{%s}%s" % (referencedType, address))
def selectedInferior(self):
try:
return gdb.selected_inferior()
except:
# Pre gdb 7.4. Right now we don't have more than one inferior anyway.
return gdb.inferiors()[0]
def readRawMemory(self, addr, size):
mem = gdb.selected_inferior().read_memory(addr, size)
mem = self.selectedInferior().read_memory(addr, size)
if sys.version_info[0] >= 3:
mem.tobytes()
return mem
......
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