llvm-project/lldb/source
Jim Ingham 1432b9780b Copy the breakpoint site owner's collection so we can drop
the collection lock before we iterate over the owners calling ShouldStop.

BreakpointSite::ShouldStop can do a lot of work, and might by chance hit the same breakpoint
site again on another thread.  So instead of holding the site's owners lock
while iterating over them calling ShouldStop, I make a local copy of the list, drop the lock 
and then iterate over the copy calling BreakpointLocation::ShouldStop.

It's actually quite difficult to make this cause problems because usually all the
action happens on the private state thread, and the lock is recursive.

I have a report where some code hit the ASAN error breakpoint, went to 
compile the ASAN error gathering expression, in the course of compiling
that we went to fetch the ObjC runtime data, but the state of the program
was such that the ObjC runtime grubbing function triggered an ASAN error and 
we were executing that function on another thread.  

I couldn't figure out a way to reproduce that situation in a test.  But this is an 
NFC change anyway, it just makes the locking strategy more narrowly focused.

<rdar://problem/49074093>

llvm-svn: 357141
2019-03-28 01:51:33 +00:00
..
API [Platform] Remove Kalimba Platform 2019-03-27 16:23:50 +00:00
Breakpoint Copy the breakpoint site owner's collection so we can drop 2019-03-28 01:51:33 +00:00
Commands Quiet command regex instructions during batch execution 2019-03-10 23:15:48 +00:00
Core Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction 2019-03-19 15:05:55 +00:00
DataFormatters [DataFormatters] Remove LLDB_DISABLE_PYTHON from TypeCategory. 2019-03-15 16:55:51 +00:00
Expression Fix an invalid static cast in ClangExpressionParser.cpp 2019-03-13 19:46:30 +00:00
Host [lldb] Add missing EINTR handling 2019-03-21 19:35:55 +00:00
Initialization [Reproducers] Initialize reproducers before initializing the debugger. 2019-02-21 22:26:16 +00:00
Interpreter Pass ConstString by value (NFC) 2019-03-06 21:22:25 +00:00
Plugins [ObjectFileMachO] Remove another debugging aid. 2019-03-28 00:07:20 +00:00
Symbol Remove the TypePair class 2019-03-26 13:35:54 +00:00
Target [StackFrameRecognizer] Remove unneeded LLDB_DISABLE_PYTHON. 2019-03-19 17:35:37 +00:00
Utility [Platform] Remove Kalimba Platform 2019-03-27 16:23:50 +00:00
CMakeLists.txt [CMake] Unify scripts for generating VCS headers 2019-02-06 03:51:00 +00:00
lldb.cpp [CMake] Unify scripts for generating VCS headers 2019-02-06 03:51:00 +00:00