mib updated this revision to Diff 404707. mib retitled this revision from "[lldb/Plugins] Add ScriptedProcessInterface::GetSelectedThreadIndex method" to "[lldb/Plugins] Add lldb.ScriptedProcess.get_most_relevant_thread_index interpreter method". mib edited the summary of this revision. mib added a comment.
Following an offline discussion with @jingham, we agreed that we should leave the internal lldb machinery deal with selecting the right thread to be stopped at. However, the interpreter `ScriptedProcess` method to let the user provide the most relevant thread index can still be very useful, for instance when creating the appropriate stop reason from the `ScriptedThread` instances to fetch the `most_relevant_thread_index` from `ScriptedProcess`. This is why this update removes all the thread selecting logic from the ScriptedProcess plugin and makes it so `get_most_relevant_thread_index` cannot be accessed from the debugger. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118482/new/ https://reviews.llvm.org/D118482 Files: lldb/examples/python/scripted_process/scripted_process.py lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py Index: lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py =================================================================== --- lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py +++ lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py @@ -57,6 +57,9 @@ return data + def get_most_relevant_thread_index(self): + return 3 + def get_loaded_images(self): # TODO: Iterate over corefile_target modules and build a data structure # from it. Index: lldb/examples/python/scripted_process/scripted_process.py =================================================================== --- lldb/examples/python/scripted_process/scripted_process.py +++ lldb/examples/python/scripted_process/scripted_process.py @@ -76,6 +76,15 @@ """ pass + def get_most_relevant_thread_index(self): + """ Get the index of the most releveant scripted process thread. + + Returns: + Int: The most relevant thread index according to the user. + (default: 0) + """ + return 0 + @abstractmethod def get_registers_for_thread(self, tid): """ Get the register context dictionary for a certain thread of
Index: lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py =================================================================== --- lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py +++ lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py @@ -57,6 +57,9 @@ return data + def get_most_relevant_thread_index(self): + return 3 + def get_loaded_images(self): # TODO: Iterate over corefile_target modules and build a data structure # from it. Index: lldb/examples/python/scripted_process/scripted_process.py =================================================================== --- lldb/examples/python/scripted_process/scripted_process.py +++ lldb/examples/python/scripted_process/scripted_process.py @@ -76,6 +76,15 @@ """ pass + def get_most_relevant_thread_index(self): + """ Get the index of the most releveant scripted process thread. + + Returns: + Int: The most relevant thread index according to the user. + (default: 0) + """ + return 0 + @abstractmethod def get_registers_for_thread(self, tid): """ Get the register context dictionary for a certain thread of
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits