teak-llvm/lldb/packages/Python/lldbsuite/test
Jonas Devlieghere 04de24e690 [lldb/IOHandler] Improve synchronization between IO handlers.
The way the IO handlers are currently managed by the debugger is wrong. The
implementation lacks proper synchronization between RunIOHandlerSync and
RunIOHandlers. The latter is meant to be run by the "main thread", while the
former is meant to be run synchronously, potentially from a different thread.

Imagine a scenario where RunIOHandlerSync is called from a different thread
than RunIOHandlers. Both functions manipulate the debugger's IOHandlerStack.
Although the push and pop operations are synchronized, the logic to activate,
deactivate and run IO handlers is not.

While investigating PR44352, I noticed some weird behavior in the Editline
implementation. One of its members (m_editor_status) was modified from another
thread. This happened because the main thread, while running RunIOHandlers
ended up execution the IOHandlerEditline created by the breakpoint callback
thread. Even worse, due to the lack of synchronization within the IO handler
implementation, both threads ended up executing the same IO handler.

Most of the time, the IO handlers don't need to run synchronously. The
exception is sourcing commands from external files, like the .lldbinit file.

I've added a (recursive) mutex to prevent another thread from messing with the
IO handlers wile another thread is running one synchronously. It has to be
recursive, because we might have to source another file when encountering a
command source in the original file.

Differential revision: https://reviews.llvm.org/D72748
2020-01-20 11:17:55 -08:00
..
android/platform [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
api [lldb][NFC] Simplify if-return 2019-12-26 18:49:35 +03:00
arm [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
benchmarks [dotest] Avoid the need for LEVEL= makefile boilerplate 2019-09-04 07:46:25 +00:00
commands [lldb][NFC] Add test for iterator invalidation during code completion. 2020-01-20 15:01:39 +01:00
driver/batch_mode [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
functionalities [lldb/IOHandler] Improve synchronization between IO handlers. 2020-01-20 11:17:55 -08:00
iohandler [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off. 2019-12-20 21:01:23 -08:00
issue_verification [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
lang [lldb/testsuite] Modernize 2 test Makefiles 2020-01-17 20:56:28 -08:00
linux [lldb][NFC] Remove all setUp overrides that only call the parent implementation 2019-12-13 12:34:49 +01:00
macosx [lldb][NFC] Remove all setUp overrides that only call the parent implementation 2019-12-13 12:34:49 +01:00
make [lldb/Makefile.rules] Force the default target to be 'all' 2020-01-17 20:34:16 -08:00
plugins [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
python_api [lldb][NFC] Rewrite python_api/rdar-12481949 test 2020-01-14 10:10:24 +01:00
sample_test [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
sanity [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
source-manager tests: XFAIL/UNSUPPORTED tests on Windows 2020-01-01 14:22:49 -08:00
terminal [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off. 2019-12-20 21:01:23 -08:00
test_runner [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
tools [lldb-vscode] Centrally skip debug info variants for vscode tests 2019-12-17 11:08:52 +01:00
types [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
__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 dotest.py: Add option to pass extra lldb settings to dotest 2020-01-14 12:35:24 -08:00
darwin_log.py [lldb][NFC] Remove unused imports in python tests 2019-08-02 08:06:22 +00:00
decorators.py [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off. 2019-12-20 21:01:23 -08:00
dotest_args.py dotest.py: Add option to pass extra lldb settings to dotest 2020-01-14 12:35:24 -08:00
dotest.py dotest.py: Add option to pass extra lldb settings to dotest 2020-01-14 12:35:24 -08: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 Fix whitespace in the python test suite. 2018-07-27 22:20:59 +00:00
lldbinline.py [dotest] Avoid the need for LEVEL= makefile boilerplate 2019-09-04 07:46:25 +00:00
lldbpexpect.py [lldb/pexpect] Force-set the TERM environment variable 2019-12-20 15:19:41 +01:00
lldbplatform.py [dotest] Remove dead code 2019-07-26 01:58:18 +00:00
lldbplatformutil.py [lldb][tests] Platform triple can be None 2019-12-26 18:49:35 +03:00
lldbtest_config.py [dotest] Add the ability to set environment variables for the inferior. 2019-06-26 16:12:08 +00:00
lldbtest.py [lldb] Add expect_expr function for testing expression evaluation in dotests. 2020-01-15 13:04:04 +01:00
lldbutil.py lldbutil: Forward ASan launch info to test inferiors 2020-01-10 14:52:51 -08:00
lock.py [lldb][NFC] Remove unused imports in python tests 2019-08-02 08:06:22 +00:00
README-TestSuite Reflow readme 2018-12-17 21:18:12 +00:00
redo.py
test_categories.py [lldb][NFC] Add "lldb-vscode" to all_categories 2019-12-26 18:49:35 +03:00
test_result.py [lldb][tests] Make it possible to expect failure for a whole category 2020-01-10 17:37:55 +03:00