[lldb/crashlog] Make registers always available & fix x29/x30 parsing (#145104)
This patch addresses 2 issues: 1. It makes registers available on non-crashed threads all the time 2. It fixes arm64 registers parsing for registers that don't use the `x` prefix (`fp` -> `x29` / `lr` -> `x30`) --------- Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
This commit is contained in:
committed by
GitHub
parent
b7be8786af
commit
1db9afb102
@@ -777,10 +777,10 @@ class JSONCrashLogParser(CrashLogParser):
|
||||
if json_thread.get("triggered", False):
|
||||
self.crashlog.crashed_thread_idx = idx
|
||||
thread.crashed = True
|
||||
if "threadState" in json_thread:
|
||||
thread.registers = self.parse_thread_registers(
|
||||
json_thread["threadState"]
|
||||
)
|
||||
if "threadState" in json_thread:
|
||||
thread.registers = self.parse_thread_registers(
|
||||
json_thread["threadState"]
|
||||
)
|
||||
if "queue" in json_thread:
|
||||
thread.queue = json_thread.get("queue")
|
||||
self.parse_frames(thread, json_thread.get("frames", []))
|
||||
|
||||
@@ -123,11 +123,6 @@ class CrashLogScriptedProcess(ScriptedProcess):
|
||||
|
||||
class CrashLogScriptedThread(ScriptedThread):
|
||||
def create_register_ctx(self):
|
||||
if not self.has_crashed:
|
||||
return dict.fromkeys(
|
||||
[*map(lambda reg: reg["name"], self.register_info["registers"])], 0
|
||||
)
|
||||
|
||||
if not self.backing_thread or not len(self.backing_thread.registers):
|
||||
return dict.fromkeys(
|
||||
[*map(lambda reg: reg["name"], self.register_info["registers"])], 0
|
||||
@@ -135,8 +130,15 @@ class CrashLogScriptedThread(ScriptedThread):
|
||||
|
||||
for reg in self.register_info["registers"]:
|
||||
reg_name = reg["name"]
|
||||
reg_alt_name = None
|
||||
if "alt-name" in reg:
|
||||
reg_alt_name = reg["alt-name"]
|
||||
if reg_name in self.backing_thread.registers:
|
||||
self.register_ctx[reg_name] = self.backing_thread.registers[reg_name]
|
||||
elif reg_alt_name and reg_alt_name in self.backing_thread.registers:
|
||||
self.register_ctx[reg_name] = self.backing_thread.registers[
|
||||
reg_alt_name
|
||||
]
|
||||
else:
|
||||
self.register_ctx[reg_name] = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user