hanchenye-llvm-project/lldb
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
..
cmake Fix standalone build on RHEL6. 2016-05-06 17:03:09 +00:00
docs test commit 2016-04-25 19:02:05 +00:00
examples Another little example use of scripted thread plans. 2016-05-03 00:14:52 +00:00
include/lldb Keep original source path and mapped path in LineEntry 2016-05-11 22:46:53 +00:00
lit Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 07:14:05 +00:00
lldb.xcodeproj Import block pointers from DWARF as Clang block pointers, not as structs. 2016-05-02 21:15:31 +00:00
lldb.xcworkspace
packages/Python/lldbsuite Xfail failing watchpoint tests on aarch64-linux 2016-05-11 13:57:20 +00:00
resources Bump the lldb version # in the xcode project files from 2016-03-15 04:36:11 +00:00
scripts Add the ability to limit "source regexp" breakpoints to a particular function 2016-04-28 01:40:57 +00:00
source Fix a race in ProcessGDBRemote::MonitorDebugServerProcess 2016-05-12 11:10:01 +00:00
test Fix ResourceWarning about unclosed file in use_lldb_suite_root.py. 2016-01-15 22:22:35 +00:00
third_party/Python/module Put progress.py back, apparently this can't be deleted. 2015-12-09 21:32:28 +00:00
tools debugserver; fix -Wunused-local-typedef, -Wunused-variable warnings 2016-05-06 17:33:13 +00:00
unittests Fix SymbolFilePDBTests.cpp 2016-05-10 13:46:22 +00:00
utils Python 3: Modernize exception raising syntax. 2015-11-03 21:01:45 +00:00
www Update the website with lots of new info about building / testing. 2016-02-24 22:19:23 +00:00
.arcconfig
.clang-format Update .clang-format file to support break after return type. 2015-12-28 22:09:29 +00:00
.gitignore modify Xcode build to use cmake/ninja for internal llvm/clang 2016-01-28 07:36:44 +00:00
CMakeLists.txt Fix NetBSD build with CMake 3.5.2 2016-05-01 10:23:24 +00:00
CODE_OWNERS.txt Added myself to the CODE_OWNERS.txt list for a few subsystems. 2015-11-09 01:24:36 +00:00
INSTALL.txt
LICENSE.TXT
use_lldb_suite_root.py Preparation for turning lldbsuite into a Python package. 2015-10-27 22:33:47 +00:00