teak-llvm/lldb/packages/Python/lldbsuite/test
Pavel Labath df55f522bd Fix race during process interruption
Summary:
The following situation was occuring in TestAttachResume:
- we did a "continue" from a breakpoint (which involves a private start-stop to step over the
  breakpoint)
- after receiving the stop-reply from the step-over, we issue a "detach" (which requires a
  process interrupt)
- at this moment, the public state is "running", private state is "about-to-be-stopped" (the
  stopped event was broadcast, but it was not received yet)
- StopForDestroyOrDetach (public thread) notes the public state is running, sends an interrupt
  request to the private thread
- private thread gets the eBroadcastBitInterrupt (before the eStateStopped message), and asks the
  process plugin to stop (via Halt())
- process plugin says it has nothing to do as the process is already stopped
- private thread shrugs and carries on. receives the stop event, restores the breakpoint and
  resumes the process.
- after a while, the public thread times out and says it failed to stop the process

This patch does the following:
- splits Halt() into two functions, private and public, their usage depends on the context
  - public Halt(): sends eBroadcastBitInterrupt to the private thread and waits for the Stop
    event
  - HaltPrivate(): asks the plugin to stop and makes a note that the halt was requested. When the
    next stop event comes it sets the interrupt flag on it.
- removes HijackPrivateProcessEvents(), as the only user (old Halt()) has gone away
- removes the m_currently_handling_event hack, as the new Halt() does not need it
- adds a use_run_lock parameter to public Halt() and WaitForProcessToStop(). This was needed
  because RunThreadPlan uses Halt() while holding the run lock and we don't want Halt() to take
  it away from him.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D14989

llvm-svn: 254403
2015-12-01 11:28:47 +00:00
..
android/platform Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
api Re-add an xfail removed by r254163 2015-11-27 10:50:33 +00:00
arm_emulation Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
attic Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
benchmarks Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
driver/batch_mode Add expectedFlakeyFreeBSD to TestBatchMode failing on buildbot 2015-11-24 18:34:17 +00:00
example Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
expression_command Fix race during process interruption 2015-12-01 11:28:47 +00:00
functionalities Fix race during process interruption 2015-12-01 11:28:47 +00:00
help Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
lang Temporarily add expectedFailureFreeBSD to tests that fail to detect Clang on FreeBSD 2015-11-24 18:59:51 +00:00
linux Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
logging Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
macosx Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
make [LLDB][MIPS] Change ARCHFLAG for MIPS 2015-12-01 05:24:17 +00:00
plugins Tighten up sys.path, and use absolute imports everywhere. 2015-11-03 02:06:18 +00:00
python_api Python 3 - Skip a certain test for a particular (swig,python) combo. 2015-11-16 23:58:20 +00:00
settings Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
source-manager Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
terminal Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
test_runner Python 3 - Use universal_newlines=True in subprocess.Popen. 2015-11-05 01:33:44 +00:00
tools Enable TestMiBreak on Linux 2015-11-25 16:29:04 +00:00
types Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
warnings/uuid Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
__init__.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
.categories Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
bench-history Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
bench.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
blacklist.py Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
crashinfo.c Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
curses_results.py Fix up curses_results.py for new package specification requirement. 2015-11-09 00:23:01 +00:00
dosep.py Bump up test timeout interval on Darwin from 4 to 6 minutes. 2015-11-11 05:10:07 +00:00
dotest_args.py Add --curses shortcut for specifying the curses-based test results formatter. 2015-11-09 18:51:04 +00:00
dotest_channels.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
dotest.py Add --curses shortcut for specifying the curses-based test results formatter. 2015-11-09 18:51:04 +00:00
lldb_pylint_helper.py Updated lldb_pylint_helper to work with recent Python package changes. 2015-11-10 20:01:33 +00:00
lldbbench.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
lldbcurses.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
lldbinline.py Python 3 - Use the exec function, not the exec statement. 2015-11-06 21:37:21 +00:00
lldbpexpect.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
lldbplatformutil.py [LLDB][MIPS] Fix lldbplatformutil.py Failure 2015-11-19 11:01:21 +00:00
lldbtest_config.py Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
lldbtest.py Revert "Make skipIf support the not_in function (second attempt)." 2015-11-20 20:30:36 +00:00
lldbutil.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
lock.py Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
Makefile Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
README-TestSuite Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
redo.py Move lldb/test to lldb/packages/Python/lldbsuite/test. 2015-10-28 17:43:26 +00:00
test_categories.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00
test_results.py Python 3 - Turn on absolute imports, and fix existing imports. 2015-11-05 19:22:28 +00:00