diff options
author | Jim Ingham <jingham@apple.com> | 2019-06-28 17:57:19 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2019-06-28 17:57:19 +0000 |
commit | 8864b4360aabfd3a99c396a8b31c9ec1644702a1 (patch) | |
tree | 2ee2d2be93b56dab1f42ea4f3853c7ebf139c8bb /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 7108df964aa692a3333b9ba618d578daf34511d1 (diff) | |
download | bcm5719-llvm-8864b4360aabfd3a99c396a8b31c9ec1644702a1.tar.gz bcm5719-llvm-8864b4360aabfd3a99c396a8b31c9ec1644702a1.zip |
Make sure the thread list is updated before you set the stop reason
on a thread. When talking to some older gdb-remote stubs, We were getting
a stop reason from the stop reply packet and setting it on the relevant
thread before we updated the full stop list. That would get discarded when
the full list was updated.
Also, if you already have a thread list when you go to see if there is an
Operating System plugin, and you do indeed load a new OS plugin, you have to
re-fetch the thread list or it will only show the raw threads.
Differential Revision: https://reviews.llvm.org/D62887
llvm-svn: 364666
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index cfac0b1ec9c..0501e205ca7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -2423,6 +2423,15 @@ void ProcessGDBRemote::RefreshStateAfterStop() { // Scope for the lock { + // Check to see if SetThreadStopInfo() filled in m_thread_ids? + if (m_thread_ids.empty()) { + // No, we need to fetch the thread list manually + UpdateThreadIDList(); + } + // We might set some stop info's so make sure the thread list is up to + // date before we do that or we might overwrite what was computed here. + UpdateThreadListIfNeeded(); + // Lock the thread stack while we access it std::lock_guard<std::recursive_mutex> guard(m_last_stop_packet_mutex); // Get the number of stop packets on the stack @@ -2437,13 +2446,7 @@ void ProcessGDBRemote::RefreshStateAfterStop() { // Clear the thread stop stack m_stop_packet_stack.clear(); } - - // Check to see if SetThreadStopInfo() filled in m_thread_ids? - if (m_thread_ids.empty()) { - // No, we need to fetch the thread list manually - UpdateThreadIDList(); - } - + // If we have queried for a default thread id if (m_initial_tid != LLDB_INVALID_THREAD_ID) { m_thread_list.SetSelectedThreadByID(m_initial_tid); |