[lldb/crashlog] Parse thread fields and pass it to crashlog scripted process

Previously, the ScriptedThread used the thread index as the thread id.

This patch parses the crashlog json to extract the actual thread "id" value,
and passes this information to the Crashlog ScriptedProcess blueprint,
to create a higher fidelity ScriptedThreaad.

It also updates the blueprint to show the thread name and thread queue.

Finally, this patch updates the interactive crashlog test to reflect
these changes.

rdar://90327854

Differential Revision: https://reviews.llvm.org/D122422

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
Med Ismail Bennani
2022-03-24 17:19:33 -07:00
parent afaefb671f
commit 12301d616f
4 changed files with 35 additions and 20 deletions

View File

@@ -219,8 +219,8 @@ class ScriptedThread:
self.scripted_process = None
self.process = None
self.args = None
self.id = None
self.idx = 0
self.tid = 0
self.idx = None
self.name = None
self.queue = None
@@ -236,24 +236,29 @@ class ScriptedThread:
self.process = self.target.GetProcess()
self.get_register_info()
def get_thread_idx(self):
""" Get the scripted thread index.
Returns:
int: The index of the scripted thread in the scripted process.
"""
return self.idx
@abstractmethod
def get_thread_id(self):
""" Get the scripted thread identifier.
Returns:
int: The identifier of the scripted thread.
"""
pass
return self.tid
@abstractmethod
def get_name(self):
""" Get the scripted thread name.
Returns:
str: The name of the scripted thread.
"""
pass
return self.name
def get_state(self):
""" Get the scripted thread state type.
@@ -277,7 +282,7 @@ class ScriptedThread:
Returns:
str: The queue name associated with the scripted thread.
"""
pass
return self.queue
@abstractmethod
def get_stop_reason(self):