llvm-project/lldb
Pavel Labath a997a1d7fb [lldb/test] Ensure launched processes are ready to be attached
Linux systems can be configured (and most of them are configured that
way) to disable attaching to unrelated processes, /unless/ those
processes explicitly allow that.

Our test inferiors do that by explicitly calling prctl(PR_SET_PTRACER,
PR_SET_PTRACER_ANY) (a.k.a., lldb_enable_attach). This requires
additional synchronization to ensure that the test does not attempt
attach before that statement is executed.

This is working fine (albeit cumbersome) for most tests but
TestGdbRemoteAttachWait is special in that it wants to start the
inferior _after_ issuing the attach request. This means that the usual
synchronization method does not work.

This patch introduces a different solution -- enable attaching in the
test harness, before the process is launched. Besides fixing this
problem, this is also better because it avoids the need to add special
code to each attach test (which is a common error).

One gotcha here is that it won't work for remote test suites, as we
don't control launching there. However, we could add a similar option to
lldb-platform, or require that lldb-platform itself is started with
attaching enabled. At that point we could delete all lldb_enable_attach
logic.
2021-01-14 12:07:04 +01:00
..
bindings [lldb] Add SBType::GetEnumerationIntegerType method 2020-12-22 10:08:22 -08:00
cmake [lldb] Bump the required SWIG version to 3 2021-01-08 08:47:21 -08:00
docs [lldb] Bump the required SWIG version to 3 2021-01-08 08:47:21 -08:00
examples [lldb] Remove LLDB session dir and just store test traces in the respective test build directory 2020-12-04 11:43:10 +01:00
include/lldb [lldb] Make DoReadMemory a protected method. 2021-01-07 21:06:36 -08:00
packages/Python [lldb/test] Ensure launched processes are ready to be attached 2021-01-14 12:07:04 +01:00
resources [lldb] Remove stale LLDB-Info.plist 2021-01-08 10:12:16 -08:00
scripts [lldb][AArch64/Linux] Show memory tagged memory regions 2020-11-20 11:21:59 +00:00
source [lldb] Fix TestPlatformProcessConnect.py 2021-01-14 09:49:19 +01:00
test [lldb] Fix TestPlatformProcessConnect.py 2021-01-14 09:49:19 +01:00
third_party/Python/module Revert "[lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu" 2020-08-05 11:55:02 +02:00
tools Add unconditional logging to debugserver for launch/attach processes 2021-01-11 22:17:10 -08:00
unittests [lldb] Disable PipeTest.OpenAsReader on windows 2021-01-11 13:37:49 +01:00
utils [lldb] Remove LLDB session dir and just store test traces in the respective test build directory 2020-12-04 11:43:10 +01:00
.clang-format
.clang-tidy [lldb] Add .clang-tidy with customization to disable readability-identifier-naming 2020-03-09 12:50:28 -07:00
.gitignore
CMakeLists.txt [lldb] Enable cmake policy CMP0077 for option() 2020-10-17 00:16:24 -07:00
CODE_OWNERS.txt
LICENSE.TXT
use_lldb_suite_root.py