[Lldb-commits] [lldb] 9a9bf12 - [lldb/crashlog] Fix arm64 register parsing on crashlog.py
Med Ismail Bennani via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 9 13:28:44 PST 2022
Author: Med Ismail Bennani
Date: 2022-02-09T13:28:20-08:00
New Revision: 9a9bf12c4a10aa87f15463fbe0021f99012a88df
URL: https://github.com/llvm/llvm-project/commit/9a9bf12c4a10aa87f15463fbe0021f99012a88df
DIFF: https://github.com/llvm/llvm-project/commit/9a9bf12c4a10aa87f15463fbe0021f99012a88df.diff
LOG: [lldb/crashlog] Fix arm64 register parsing on crashlog.py
This patch fixes the register parser for arm64 crashlogs.
Compared to x86_64 crashlogs, the arm64 crashlogs nests the general
purpose registers into a separate dictionary within `thread_state`
dictionary. It uses the dictionary key as the the register number.
Differential Revision: https://reviews.llvm.org/D119168
Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>
Added:
Modified:
lldb/examples/python/crashlog.py
Removed:
################################################################################
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 54fc888c509c8..b8fe642db849d 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -520,17 +520,21 @@ def parse_threads(self, json_threads):
self.crashlog.threads.append(thread)
idx += 1
- def parse_thread_registers(self, json_thread_state):
+ def parse_thread_registers(self, json_thread_state, prefix=None):
registers = dict()
for key, state in json_thread_state.items():
if key == "rosetta":
- registers.update(self.parse_thread_registers(state))
- continue
+ registers.update(self.parse_thread_registers(state))
+ continue
+ if key == "x":
+ gpr_dict = { str(idx) : reg for idx,reg in enumerate(state) }
+ registers.update(self.parse_thread_registers(gpr_dict, key))
+ continue
try:
- value = int(state['value'])
- registers[key] = value
+ value = int(state['value'])
+ registers["{}{}".format(prefix,key)] = value
except (KeyError, ValueError, TypeError):
- pass
+ pass
return registers
def parse_errors(self, json_data):
More information about the lldb-commits
mailing list