aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
diff options
context:
space:
mode:
authorOleksiy Vyalov <ovyalov@google.com>2015-02-19 17:58:04 +0000
committerOleksiy Vyalov <ovyalov@google.com>2015-02-19 17:58:04 +0000
commit8bc34f4d96a4b6cf736dad96bc83156b3014bb53 (patch)
treea2118ed2b376f676818ab883fbc68ff115d8282f /lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
parentf08a3ccf50791e4f3d05341754633ed7fc6371aa (diff)
downloadllvm-8bc34f4d96a4b6cf736dad96bc83156b3014bb53.zip
llvm-8bc34f4d96a4b6cf736dad96bc83156b3014bb53.tar.gz
llvm-8bc34f4d96a4b6cf736dad96bc83156b3014bb53.tar.bz2
Prevent LLGS from crashing when exiting - make NativeProcessLinux to wait until ThreadStateCoordinator is fully stopped before entering ~NativeProcessLinux.
http://reviews.llvm.org/D7692 llvm-svn: 229875
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index a930476..ff52bf9 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -270,13 +270,17 @@ NativeThreadLinux::SetRunning ()
// then this is a new thread. So set all existing watchpoints.
if (m_watchpoint_index_map.empty())
{
- const auto &watchpoint_map = GetProcess()->GetWatchpointMap();
- if (watchpoint_map.empty()) return;
- GetRegisterContext()->ClearAllHardwareWatchpoints();
- for (const auto &pair : watchpoint_map)
+ const auto process_sp = GetProcess();
+ if (process_sp)
{
- const auto& wp = pair.second;
- SetWatchpoint(wp.m_addr, wp.m_size, wp.m_watch_flags, wp.m_hardware);
+ const auto &watchpoint_map = process_sp->GetWatchpointMap();
+ if (watchpoint_map.empty()) return;
+ GetRegisterContext()->ClearAllHardwareWatchpoints();
+ for (const auto &pair : watchpoint_map)
+ {
+ const auto& wp = pair.second;
+ SetWatchpoint(wp.m_addr, wp.m_size, wp.m_watch_flags, wp.m_hardware);
+ }
}
}
}