Commit 47c79a10 authored by hjk's avatar hjk
Browse files

Debugger: Fix handling of large registers with LLDB



Change-Id: I12a7a9e43922291c6bff77be5fefea4db6cb5482
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 4ec90191
...@@ -1267,12 +1267,9 @@ class Dumper(DumperBase): ...@@ -1267,12 +1267,9 @@ class Dumper(DumperBase):
result = 'registers=[' result = 'registers=['
for group in frame.GetRegisters(): for group in frame.GetRegisters():
for reg in group: for reg in group:
value = ''.join(["%02x" % x for x in reg.GetData().uint8s])
result += '{name="%s"' % reg.GetName() result += '{name="%s"' % reg.GetName()
value = reg.GetValue() result += ',value="0x%s"' % value
if value is None:
result += ',value=""'
else:
result += ',value="%s"' % value
result += ',size="%s"' % reg.GetByteSize() result += ',size="%s"' % reg.GetByteSize()
result += ',type="%s"},' % reg.GetType() result += ',type="%s"},' % reg.GetType()
result += ']' result += ']'
...@@ -1283,13 +1280,19 @@ class Dumper(DumperBase): ...@@ -1283,13 +1280,19 @@ class Dumper(DumperBase):
name = args["name"] name = args["name"]
value = args["value"] value = args["value"]
result = lldb.SBCommandReturnObject() result = lldb.SBCommandReturnObject()
self.debugger.GetCommandInterpreter().HandleCommand( interp = self.debugger.GetCommandInterpreter()
"register write %s %s" % (name, value), result) interp.HandleCommand("register write %s %s" % (name, value), result)
success = result.Succeeded() success = result.Succeeded()
if success: if success:
self.report('output="%s"' % result.GetOutput()) self.report('output="%s"' % result.GetOutput())
else: return
self.report('error="%s"' % result.GetError()) # Try again with register write xmm0 "{0x00 ... 0x02}" syntax:
vec = ' '.join(["0x" + value[i:i+2] for i in range(2, len(value), 2)])
success = interp.HandleCommand('register write %s "{%s}"' % (name, vec), result)
if success:
self.report('output="%s"' % result.GetOutput())
return
self.report('error="%s"' % result.GetError())
def report(self, stuff): def report(self, stuff):
with self.outputLock: with self.outputLock:
......
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