Skip to content

Commit fdbeca5

Browse files
committed
[lldb/crashlog] Always load register context for non-crashed threads
This patch change the current crashlog behavior to always load the register context, even for the non-crashed threads. This is cheap to compute since it doesn't requires any module loading and can be helful to investigate some crashes. rdar://149481943 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent c83fa6b commit fdbeca5

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

lldb/examples/python/crashlog.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,10 @@ def parse_threads(self, json_threads):
777777
if json_thread.get("triggered", False):
778778
self.crashlog.crashed_thread_idx = idx
779779
thread.crashed = True
780-
if "threadState" in json_thread:
781-
thread.registers = self.parse_thread_registers(
782-
json_thread["threadState"]
783-
)
780+
if "threadState" in json_thread:
781+
thread.registers = self.parse_thread_registers(
782+
json_thread["threadState"]
783+
)
784784
if "queue" in json_thread:
785785
thread.queue = json_thread.get("queue")
786786
self.parse_frames(thread, json_thread.get("frames", []))

lldb/examples/python/crashlog_scripted_process.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ def get_process_metadata(self):
123123

124124
class CrashLogScriptedThread(ScriptedThread):
125125
def create_register_ctx(self):
126-
if not self.has_crashed:
127-
return dict.fromkeys(
128-
[*map(lambda reg: reg["name"], self.register_info["registers"])], 0
129-
)
130-
131126
if not self.backing_thread or not len(self.backing_thread.registers):
132127
return dict.fromkeys(
133128
[*map(lambda reg: reg["name"], self.register_info["registers"])], 0

0 commit comments

Comments
 (0)