summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorTatyana Krasnukha <tatyana@synopsys.com>2019-12-26 15:31:14 +0300
committerTatyana Krasnukha <tatyana@synopsys.com>2019-12-26 18:49:35 +0300
commitb0469eede2857f8c15bbec3db7605f699324befb (patch)
tree52a5625b7ef42c2f1903178cf36b6210c6bdc06f /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parentb7c45ac35295f4d90cdc9430ab159c3b396e75ee (diff)
downloadbcm5719-llvm-b0469eede2857f8c15bbec3db7605f699324befb.tar.gz
bcm5719-llvm-b0469eede2857f8c15bbec3db7605f699324befb.zip
[lldb][NFC] Move lock scope where it should begin
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 028171e337d..a49db5d9a93 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2349,21 +2349,22 @@ void ProcessGDBRemote::RefreshStateAfterStop() {
m_thread_ids.clear();
m_thread_pcs.clear();
+
// Set the thread stop info. It might have a "threads" key whose value is a
// list of all thread IDs in the current process, so m_thread_ids might get
// set.
+ // 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();
// 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
OpenPOWER on IntegriCloud