mib created this revision.
mib added a reviewer: JDevlieghere.
mib added a project: LLDB.
Herald added subscribers: omjavaid, pengfei, kristof.beyls.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

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.

Signed-off-by: Med Ismail Bennani <medismail.benn...@gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119168

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -521,6 +521,15 @@
 
     def parse_thread_registers(self, json_thread_state):
         registers = dict()
+
+        if json_thread_state['flavor'] == "ARM_THREAD_STATE64":
+            for idx, state in enumerate(json_thread_state['x']):
+                try:
+                    value = int(state['value'])
+                    registers['x' + str(idx)] = value
+                except (TypeError, ValueError):
+                    pass
+
         for key, state in json_thread_state.items():
             try:
                value = int(state['value'])


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -521,6 +521,15 @@
 
     def parse_thread_registers(self, json_thread_state):
         registers = dict()
+
+        if json_thread_state['flavor'] == "ARM_THREAD_STATE64":
+            for idx, state in enumerate(json_thread_state['x']):
+                try:
+                    value = int(state['value'])
+                    registers['x' + str(idx)] = value
+                except (TypeError, ValueError):
+                    pass
+
         for key, state in json_thread_state.items():
             try:
                value = int(state['value'])
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to