llvm-project/lldb
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
..
bindings [lldb/Plugins] Move SBTarget::GetExtendedCrashInformation to SBProcess 2020-02-24 23:37:04 +01:00
cmake Allow customized relative PYTHONHOME (Attemp 1) 2020-02-21 16:25:30 -08:00
docs [lldb]: fix typo in lldb-gdb-remote.txt 2020-02-20 14:30:12 +01:00
examples [lldb] Make gdbremote.py utility py2and3 compatible 2020-02-13 09:18:55 +01:00
include/lldb [lldb][NFC] Move NameSearchContext to own header/source files 2020-02-25 12:25:36 +01:00
packages/Python/lldbsuite [lldb] Disable auto fix-its when evaluating expressions in the test suite 2020-02-24 09:31:11 +01:00
resources
scripts [lldb/Scripts] Remove swig_bot_lib/__init__.py 2020-01-16 09:15:41 -08:00
source [LLDB] Let DataExtractor deal with two-byte addresses 2020-02-25 16:27:38 +01:00
test Fix a race between lldb's packet timeout and the profile thread's usleep. 2020-02-25 11:17:08 -08:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools Fix a race between lldb's packet timeout and the profile thread's usleep. 2020-02-25 11:17:08 -08:00
unittests [LLDB] Let DataExtractor deal with two-byte addresses 2020-02-25 16:27:38 +01:00
utils [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [lldb/Cmake] Add a CMakeLists.txt to the utils directory... 2020-01-16 22:31:01 -08:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py