llvm-project/lldb/packages/Python/lldbsuite/test
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
..
builders Reland [lldb] Explicitly use the configuration architecture when building test executables 2020-11-05 15:13:48 +01:00
make [lldb] Don't add no-sandbox entitlement when running tests on simulator 2020-10-13 15:08:46 +02:00
test_runner [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
tools [lldb] Fix logging in lldb-server tests 2020-12-29 08:33:12 +01:00
README-TestSuite Reflow readme 2018-12-17 21:18:12 +00:00
__init__.py
bench.py [lldb][NFC] Remove unused imports in python tests 2019-08-02 08:06:22 +00:00
concurrent_base.py [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
configuration.py [lldb] Remove LLDB session dir and just store test traces in the respective test build directory 2020-12-04 11:43:10 +01:00
darwin_log.py [lldb][NFC] Remove unused imports in python tests 2019-08-02 08:06:22 +00:00
decorators.py [lldb/test] Add GdbRemoteTestCaseFactory to avoid duplication in lldb-server tests 2020-12-22 10:07:47 +01:00
dotest.py [lldb/test] Automatically skip remote lldb-server tests when applicable 2020-12-27 13:58:10 +01:00
dotest_args.py [lldb] Remove LLDB session dir and just store test traces in the respective test build directory 2020-12-04 11:43:10 +01:00
lldb_pylint_helper.py Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
lldbbench.py
lldbdwarf.py
lldbinline.py [lldb] lldbinline and lldbtest gardening (NFC) 2020-07-14 10:41:45 -07:00
lldbpexpect.py [lldb] Also Catch invalid calls to TestPExpectTest's expect() 2020-11-05 14:08:46 +01:00
lldbplatform.py [lldb] Add Apple simulator platforms to lldbplatform.py 2020-11-05 15:34:42 +01:00
lldbplatformutil.py [lldb/test] Ensure launched processes are ready to be attached 2021-01-14 12:07:04 +01:00
lldbtest.py [lldb/test] Ensure launched processes are ready to be attached 2021-01-14 12:07:04 +01:00
lldbtest_config.py [dotest] Add the ability to set environment variables for the inferior. 2019-06-26 16:12:08 +00:00
lldbutil.py [lldb] Move Xcode SDK helper functions into lldbutil 2020-08-19 13:30:27 -07:00
test_categories.py [lldb/test] Replace ad-hoc server test choice with test categories 2020-12-10 16:21:28 +01:00
test_result.py [lldb] [test] Rename '.categories' to 'categories' 2020-11-10 12:02:38 +01:00