Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb/Plugins] Fix ScriptedThread IndexID reporting
When listing all the Scripted Threads of a ScriptedProcess, we can see that all have the thread index set to 1. This is caused by the lldb_private::Thread constructor, which sets the m_index_id member using the provided thread id `tid`. Because the call to the super constructor is done before instantiating the `ScriptedThreadInterface`, lldb can't fetch the thread id from the script instance, so it uses `LLDB_INVALID_THREAD_ID` instead. To mitigate this, this patch takes advantage of the `ScriptedThread::Create` fallible constructor idiom to defer calling the `ScriptedThread` constructor (and the `Thread` super constructor with it), until we can fetch a valid thread id `tid` from the `ScriptedThreadInterface`. rdar://87432065 Differential Revision: https://reviews.llvm.org/D117076 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
- Loading branch information
1 parent
cfa55bf
commit 45148bf
Showing
5 changed files
with
62 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters