teak-llvm/lldb/packages/Python/lldbsuite/test/expression_command
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
..
call-function Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
call-restarts Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
call-throws Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
char Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
expr-in-syscall Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
formatters Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
issue_11588 Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
options [test] Fix comment. 2015-11-12 00:43:22 +00:00
persist_objc_pointeetype Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
persistent_ptr_update Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
persistent_types Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
persistent_variables Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
po_verbosity Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
radar_8638051 Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
radar_9531204 Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
radar_9673664 Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
test Fix to solve Bug 23139 & Bug 23560 2015-11-13 10:47:49 +00:00
timeout Fix race during process interruption 2015-12-01 11:28:47 +00:00
two-files Remove use_lldb_suite from the package, and don't import it anymore. 2015-11-03 19:20:39 +00:00
.categories