Skip to content

Commit cb6c718

Browse files
authored
Merge pull request swiftlang#3863 from apple/🍒/austria/e1cad1303bf9d2a77546469dc0987502692f80d9
[lldb] Support Rosetta registers in crashlog.py
2 parents 1893335 + 07cf183 commit cb6c718

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

lldb/examples/python/crashlog.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,13 @@ def parse_threads(self, json_threads):
523523
def parse_thread_registers(self, json_thread_state):
524524
registers = dict()
525525
for key, state in json_thread_state.items():
526+
if key == "rosetta":
527+
registers.update(self.parse_thread_registers(state))
528+
continue
526529
try:
527530
value = int(state['value'])
528531
registers[key] = value
529-
except (TypeError, ValueError):
532+
except (KeyError, ValueError, TypeError):
530533
pass
531534
return registers
532535

lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/a.out.ips

+11
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@
106106
"rcx": {
107107
"value": 140732860114656
108108
},
109+
"rosetta": {
110+
"tmp2": {
111+
"value": 8
112+
},
113+
"tmp1": {
114+
"value": 20
115+
},
116+
"tmp0": {
117+
"value": 92
118+
}
119+
},
109120
"flavor": "x86_THREAD_STATE",
110121
"rdi": {
111122
"value": 1

lldb/test/Shell/ScriptInterpreter/Python/Crashlog/json.test

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
# CHECK: [ 1] {{.*}}out`bar + 8 at test.c
1414
# CHECK: [ 2] {{.*}}out`main + 19 at test.c
1515
# CHECK: rbp = 0x00007ffeec22a530
16+
# CHECK: tmp2 = 0x0000000000000008
1617
# CHECK: invalid foo
1718
# CHECK: invalid bar

0 commit comments

Comments
 (0)