llvm-project/lldb/tools
Jim Ingham 3cd13c4624 Fix a race between lldb's packet timeout and the profile thread's usleep.
The debugserver profile thread used to suspend itself between samples with
a usleep.  When you detach or kill, MachProcess::Clear would delay replying
to the incoming packet until pthread_join of the profile thread returned.
If you are unlucky or the suspend delay is long, it could take longer than
the packet timeout for pthread_join to return.  Then you would get an error
about detach not succeeding from lldb - even though in fact the detach was
successful...

I replaced the usleep with PThreadEvents entity.  Then we just call a timed
WaitForEventBits, and when debugserver wants to stop the profile thread, it
can set the event bit, and the sleep will exit immediately.

Differential Revision: https://reviews.llvm.org/D75004
2020-02-25 11:17:08 -08:00
..
argdumper [JSON] Use LLVM's library for argdumper 2019-10-01 17:41:55 +00:00
compact-unwind Add arm64_32 support to lldb, an ILP32 codegen 2019-10-16 19:14:49 +00:00
darwin-debug Embed a zero-length /dev/null in darwin-debug for the special section. 2020-01-22 15:50:33 -08:00
darwin-threads the thread id is easier to read in base16. 2018-03-06 23:33:02 +00:00
debugserver Fix a race between lldb's packet timeout and the profile thread's usleep. 2020-02-25 11:17:08 -08:00
driver [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
intel-features [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON 2019-12-13 13:41:11 -08:00
lldb-instr [lldb/Reproducers] Change the way we instrument void* arguments 2020-02-04 19:05:13 -08:00
lldb-perf/darwin/sketch Remove lldb-perf 2019-07-08 21:38:34 +00:00
lldb-server [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-test [lldb][NFC] Make ArrayRef initialization more obvious in lldb-test.cpp 2020-02-25 09:48:17 +01:00
lldb-vscode [lldb-vscode] Use libOption with tablegen to parse command line options. 2020-02-21 08:15:06 -08:00
CMakeLists.txt [CMake] Copy over the system debugserver when using LLDB_USE_SYSTEM_DEBUGSERVER 2019-09-24 22:39:04 +00:00