mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user