llvm-project/lldb/source
Pavel Labath 194357c509 Fix a race in ProcessGDBRemote::MonitorDebugServerProcess
Summary:
MonitorDebugServerProcess went to a lot of effort to make sure its asynchronous invocation does
not cause any mischief, but it was still not race-free. Specifically, in a quick stop-restart
sequence (like the one in TestAddressBreakpoints) the copying of the process shared pointer via
target_sp->GetProcessSP() was racing with the resetting of the pointer in DeleteCurrentProcess,
as they were both accessing the same shared_ptr object.

To avoid this, I simply pass in a weak_ptr to the process when the callback is created. Locking
this pointer is race-free as they are two separate object even though they point to the same
process instance. This also removes the need for the complicated tap-dance around retrieving the
process pointer.

Reviewers: clayborg

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D20107

llvm-svn: 269281
2016-05-12 11:10:01 +00:00
..
API Take the API lock in SBThread::IsValid & SBFrame::IsValid. 2016-05-07 00:54:56 +00:00
Breakpoint Keep original source path and mapped path in LineEntry 2016-05-11 22:46:53 +00:00
Commands Keep original source path and mapped path in LineEntry 2016-05-11 22:46:53 +00:00
Core [LLDB][MIPS] Setting appropriate ArchSpec::m_flags based on ABI 2016-05-11 13:08:29 +00:00
DataFormatters Add support for synthetic child providers to optionally return a customized typename for display 2016-05-02 00:41:24 +00:00
Expression XFail TestLambdas.py on Windows after fixing some of the problems 2016-05-04 23:32:35 +00:00
Host Generalize child process monitoring functions 2016-05-11 16:59:04 +00:00
Initialization Move DynamicLoader plugins to SystemInitializerFull 2016-03-29 15:00:26 +00:00
Interpreter Fix an issue where the apropos command would not print fully qualified command names for nested command objects 2016-05-02 21:28:40 +00:00
Plugins Fix a race in ProcessGDBRemote::MonitorDebugServerProcess 2016-05-12 11:10:01 +00:00
Symbol Keep original source path and mapped path in LineEntry 2016-05-11 22:46:53 +00:00
Target Keep original source path and mapped path in LineEntry 2016-05-11 22:46:53 +00:00
Utility Remove some lldbassert's from the packet checking code. 2016-05-07 00:52:18 +00:00
CMakeLists.txt Add initial CMake glue for the NetBSD platform 2015-10-24 00:27:04 +00:00
lldb.cpp Add more NetBSD platform glue for lldb 2015-11-07 15:31:54 +00:00