While it’s a good chuckle, can you elaborate on what exactly the commit message means? <br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 22, 2019 at 5:07 PM Jim Ingham via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jingham<br>
Date: Fri Feb 22 17:08:17 2019<br>
New Revision: 354711<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=354711&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=354711&view=rev</a><br>
Log:<br>
Revert r354706 - lit touched my thigh<br>
<br>
Modified:<br>
    lldb/trunk/include/lldb/Target/Process.h<br>
    lldb/trunk/include/lldb/Target/Target.h<br>
    lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit<br>
    lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit<br>
    lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit<br>
    lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit<br>
    lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp<br>
    lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test<br>
    lldb/trunk/lit/ExecControl/StopHook/stop-hook.test<br>
    lldb/trunk/source/Commands/CommandObjectTarget.cpp<br>
    lldb/trunk/source/Target/Process.cpp<br>
    lldb/trunk/source/Target/Target.cpp<br>
<br>
Modified: lldb/trunk/include/lldb/Target/Process.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Target/Process.h (original)<br>
+++ lldb/trunk/include/lldb/Target/Process.h Fri Feb 22 17:08:17 2019<br>
@@ -2519,8 +2519,6 @@ public:<br>
   ///<br>
   //------------------------------------------------------------------<br>
   void RestoreProcessEvents();<br>
-  <br>
-  bool IsHijackedForSynchronousResume();<br>
<br>
   const lldb::ABISP &GetABI();<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/Target/Target.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Target/Target.h (original)<br>
+++ lldb/trunk/include/lldb/Target/Target.h Fri Feb 22 17:08:17 2019<br>
@@ -1153,10 +1153,6 @@ public:<br>
<br>
     void SetIsActive(bool is_active) { m_active = is_active; }<br>
<br>
-    void SetAutoContinue(bool auto_continue) {m_auto_continue = auto_continue;}<br>
-<br>
-    bool GetAutoContinue() const { return m_auto_continue; }<br>
-<br>
     void GetDescription(Stream *s, lldb::DescriptionLevel level) const;<br>
<br>
   private:<br>
@@ -1164,8 +1160,7 @@ public:<br>
     StringList m_commands;<br>
     lldb::SymbolContextSpecifierSP m_specifier_sp;<br>
     std::unique_ptr<ThreadSpec> m_thread_spec_up;<br>
-    bool m_active = true;<br>
-    bool m_auto_continue = false;<br>
+    bool m_active;<br>
<br>
     // Use CreateStopHook to make a new empty stop hook. The GetCommandPointer<br>
     // and fill it with commands, and SetSpecifier to set the specifier shared<br>
<br>
Modified: lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit (original)<br>
+++ lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit Fri Feb 22 17:08:17 2019<br>
@@ -1 +1 @@<br>
-target stop-hook add -f stop-hook.c -l 29 -e 34 -o "expr ptr"<br>
+target stop-hook add -f stop-hook.c -l 29 -e 34 -o "expr ptr"<br>
\ No newline at end of file<br>
<br>
Modified: lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit (original)<br>
+++ lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit Fri Feb 22 17:08:17 2019<br>
@@ -1,3 +1,3 @@<br>
 target stop-hook add -f stop-hook.c -l 29 -e 34<br>
 expr ptr<br>
-DONE<br>
+DONE<br>
\ No newline at end of file<br>
<br>
Modified: lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit (original)<br>
+++ lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit Fri Feb 22 17:08:17 2019<br>
@@ -1,7 +1,7 @@<br>
-break set -f stop-hook-threads.cpp -p "Break here to set up the stop hook"<br>
 break set -f stop-hook-threads.cpp -p "Break here to test that the stop-hook"<br>
 run<br>
-target stop-hook add -G true<br>
-expr lldb_val += 1<br>
+target stop-hook add<br>
+frame variable --show-globals g_val<br>
 thread list<br>
+continue<br>
 DONE<br>
<br>
Modified: lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit (original)<br>
+++ lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit Fri Feb 22 17:08:17 2019<br>
@@ -1,5 +1,4 @@<br>
-break set -f stop-hook-threads.cpp -p "Break here to set up the stop hook"<br>
 break set -f stop-hook-threads.cpp -p "Break here to test that the stop-hook"<br>
 run<br>
-target stop-hook add -x 2 -o "expr lldb_val += 1" -o "thread list"<br>
-target stop-hook add -G true -o "script print('Hit stop hook') <br>
+target stop-hook add -x 2 -o "frame variable thread_index"<br>
+target stop-hook add -o continue<br>
<br>
Modified: lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp (original)<br>
+++ lldb/trunk/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp Fri Feb 22 17:08:17 2019<br>
@@ -16,7 +16,6 @@ std::default_random_engine g_random_engi<br>
 std::uniform_int_distribution<> g_distribution{0, 3000};<br>
<br>
 uint32_t g_val = 0;<br>
-uint32_t lldb_val = 0;<br>
<br>
 uint32_t<br>
 access_pool (bool flag = false)<br>
@@ -63,8 +62,7 @@ thread_func (uint32_t thread_index)<br>
 int main (int argc, char const *argv[])<br>
 {<br>
     std::thread threads[3];<br>
-    // Break here to set up the stop hook<br>
-    printf("Stop hooks engaged.\n");<br>
+<br>
     // Create 3 threads<br>
     for (auto &thread : threads)<br>
         thread = std::thread{thread_func, std::distance(threads, &thread)};<br>
@@ -73,7 +71,5 @@ int main (int argc, char const *argv[])<br>
     for (auto &thread : threads)<br>
         thread.join();<br>
<br>
-    // print lldb_val so we can check it here.<br>
-    printf ("lldb_val was set to: %d.\n", lldb_val);<br>
     return 0;<br>
 }<br>
<br>
Modified: lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test (original)<br>
+++ lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test Fri Feb 22 17:08:17 2019<br>
@@ -4,6 +4,7 @@<br>
 # RUN: %lldb -b -s %p/Inputs/stop-hook-threads-2.lldbinit -s %s -f %t \<br>
 # RUN:     | FileCheck --check-prefix=CHECK --check-prefix=CHECK-FILTER %s<br>
 # XFAIL: system-windows<br>
+# UNSUPPORTED: linux<br>
<br>
 thread list<br>
 break set -f stop-hook-threads.cpp -p "Set break point at this line"<br>
@@ -11,22 +12,23 @@ target stop-hook list<br>
<br>
 # CHECK: Hook: 1<br>
 # CHECK-NEXT:  State: enabled<br>
-# CHECK-NO-FILTER-NEXT: AutoContinue on<br>
 # CHECK-FILTER-NEXT:  Thread<br>
 # CHECK-FILTER-NEXT:  index: 2<br>
 # CHECK-NEXT:  Commands: <br>
-# CHECK-NEXT:    expr lldb_val += 1<br>
-# CHECK-NEXT:    thread list<br>
+# CHECK-NEXT:    frame variable<br>
<br>
 # CHECK-FILTER: Hook: 2<br>
 # CHECK-FILTER-NEXT:  State: enabled<br>
-# CHECK-FILTER-NEXT:  AutoContinue on<br>
 # CHECK-FILTER-NEXT:  Commands: <br>
-# CHECK-FILTER-NEXT:    script print('Hit stop hook')<br>
+# CHECK-FILTER-NEXT:    continue<br>
<br>
 # Get the threads going<br>
 continue<br>
<br>
-# Now make sure we hit the command the right number of times:<br>
-# CHECK-NO-FILTER: lldb_val was set to: 15.<br>
-# CHECK-FILTER: lldb_val was set to: 5.<br>
+# When we filter per thread, we expect exactly 4 identical "frame var" results<br>
+# CHECK-FILTER: (uint32_t) thread_index = [[THREAD_INDEX:[0-9]*]]<br>
+# CHECK-FILTER-COUNT-3: (uint32_t) thread_index = [[THREAD_INDEX]]<br>
+# CHECK-FILTER-NOT: thread_index<br>
+<br>
+# When we don't filter, we expect to count 12 stopped threads in the thread list output<br>
+# CHECK-NO-FILTER-COUNT-12: at stop-hook-threads.cpp{{.*}} stop reason = breakpoint<br>
\ No newline at end of file<br>
<br>
Modified: lldb/trunk/lit/ExecControl/StopHook/stop-hook.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/stop-hook.test?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/stop-hook.test?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lit/ExecControl/StopHook/stop-hook.test (original)<br>
+++ lldb/trunk/lit/ExecControl/StopHook/stop-hook.test Fri Feb 22 17:08:17 2019<br>
@@ -11,7 +11,6 @@<br>
 # string, so the test "passes" despite the fact that the commands failed<br>
 # <a href="http://llvm.org/pr40119" rel="noreferrer" target="_blank">llvm.org/pr40119</a><br>
 # UNSUPPORTED: system-windows<br>
-# XFAIL: system-linux<br>
<br>
 break set -f stop-hook.c -p "// Set breakpoint here to test target stop-hook"<br>
 break set -f stop-hook.c -p "// Another breakpoint which is outside of the stop-hook range"<br>
@@ -47,7 +46,9 @@ target stop-hook list<br>
 run<br>
 # Stopping inside of the stop hook range<br>
 # CHECK: (lldb) run<br>
+# CHECK-NEXT: Process {{.*}} launched:<br>
 # CHECK-NEXT: (void *) $0 = 0x<br>
+# CHECK-NEXT: Process {{.*}} stopped<br>
<br>
 thread step-over<br>
 # Stepping inside of the stop hook range<br>
<br>
Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)<br>
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Fri Feb 22 17:08:17 2019<br>
@@ -4555,7 +4555,7 @@ private:<br>
<br>
 static constexpr OptionDefinition g_target_stop_hook_add_options[] = {<br>
     // clang-format off<br>
-  { LLDB_OPT_SET_ALL, false, "one-liner",    'o', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeOneLiner,                                         "Add a command for the stop hook.  Can be specified more than once, and commands will be run in the order they appear." },<br>
+  { LLDB_OPT_SET_ALL, false, "one-liner",    'o', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeOneLiner,                                         "Specify a one-line breakpoint command inline. Be sure to surround it with quotes." },<br>
   { LLDB_OPT_SET_ALL, false, "shlib",        's', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eModuleCompletion, eArgTypeShlibName,    "Set the module within which the stop-hook is to be run." },<br>
   { LLDB_OPT_SET_ALL, false, "thread-index", 'x', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeThreadIndex,                                      "The stop hook is run only for the thread whose index matches this argument." },<br>
   { LLDB_OPT_SET_ALL, false, "thread-id",    't', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeThreadID,                                         "The stop hook is run only for the thread whose TID matches this argument." },<br>
@@ -4566,7 +4566,6 @@ static constexpr OptionDefinition g_targ<br>
   { LLDB_OPT_SET_1,   false, "end-line",     'e', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLineNum,                                          "Set the end of the line range for which the stop-hook is to be run." },<br>
   { LLDB_OPT_SET_2,   false, "classname",    'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeClassName,                                        "Specify the class within which the stop-hook is to be run." },<br>
   { LLDB_OPT_SET_3,   false, "name",         'n', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName, "Set the function name within which the stop hook will be run." },<br>
-  { LLDB_OPT_SET_ALL, false, "auto-continue",'G', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean,     "The breakpoint will auto-continue after running its commands." },<br>
     // clang-format on<br>
 };<br>
<br>
@@ -4607,17 +4606,6 @@ public:<br>
         m_sym_ctx_specified = true;<br>
         break;<br>
<br>
-      case 'G': {<br>
-        bool value, success;<br>
-        value = OptionArgParser::ToBoolean(option_arg, false, &success);<br>
-        if (success) {<br>
-          m_auto_continue = value;<br>
-        } else<br>
-          error.SetErrorStringWithFormat(<br>
-              "invalid boolean value '%s' passed for -G option",<br>
-              option_arg.str().c_str());<br>
-      }<br>
-      break;<br>
       case 'l':<br>
         if (option_arg.getAsInteger(0, m_line_start)) {<br>
           error.SetErrorStringWithFormat("invalid start line number: \"%s\"",<br>
@@ -4673,7 +4661,7 @@ public:<br>
<br>
       case 'o':<br>
         m_use_one_liner = true;<br>
-        m_one_liner.push_back(option_arg);<br>
+        m_one_liner = option_arg;<br>
         break;<br>
<br>
       default:<br>
@@ -4702,7 +4690,6 @@ public:<br>
<br>
       m_use_one_liner = false;<br>
       m_one_liner.clear();<br>
-      m_auto_continue = false;<br>
     }<br>
<br>
     std::string m_class_name;<br>
@@ -4721,8 +4708,7 @@ public:<br>
     bool m_thread_specified;<br>
     // Instance variables to hold the values for one_liner options.<br>
     bool m_use_one_liner;<br>
-    std::vector<std::string> m_one_liner;<br>
-    bool m_auto_continue;<br>
+    std::string m_one_liner;<br>
   };<br>
<br>
   CommandObjectTargetStopHookAdd(CommandInterpreter &interpreter)<br>
@@ -4847,13 +4833,10 @@ protected:<br>
<br>
         new_hook_sp->SetThreadSpecifier(thread_spec);<br>
       }<br>
-      <br>
-      new_hook_sp->SetAutoContinue(m_options.m_auto_continue);<br>
       if (m_options.m_use_one_liner) {<br>
-        // Use one-liners.<br>
-        for (auto cmd : m_options.m_one_liner)<br>
-          new_hook_sp->GetCommandPointer()->AppendString(<br>
-            cmd.c_str());<br>
+        // Use one-liner.<br>
+        new_hook_sp->GetCommandPointer()->AppendString(<br>
+            m_options.m_one_liner.c_str());<br>
         result.AppendMessageWithFormat("Stop hook #%" PRIu64 " added.\n",<br>
                                        new_hook_sp->GetID());<br>
       } else {<br>
<br>
Modified: lldb/trunk/source/Target/Process.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/Process.cpp (original)<br>
+++ lldb/trunk/source/Target/Process.cpp Fri Feb 22 17:08:17 2019<br>
@@ -1615,8 +1615,6 @@ Status Process::Resume() {<br>
   return error;<br>
 }<br>
<br>
-static const char *g_resume_sync_name = "lldb.Process.ResumeSynchronous.hijack";<br>
-<br>
 Status Process::ResumeSynchronous(Stream *stream) {<br>
   Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_STATE |<br>
                                                   LIBLLDB_LOG_PROCESS));<br>
@@ -1630,7 +1628,7 @@ Status Process::ResumeSynchronous(Stream<br>
   }<br>
<br>
   ListenerSP listener_sp(<br>
-      Listener::MakeListener(g_resume_sync_name));<br>
+      Listener::MakeListener("lldb.Process.ResumeSynchronous.hijack"));<br>
   HijackProcessEvents(listener_sp);<br>
<br>
   Status error = PrivateResume();<br>
@@ -1654,11 +1652,6 @@ Status Process::ResumeSynchronous(Stream<br>
   return error;<br>
 }<br>
<br>
-bool Process::IsHijackedForSynchronousResume() {<br>
-  const char *hijacker_name = GetHijackingListenerName();<br>
-  return strcmp(hijacker_name, g_resume_sync_name) == 0;<br>
-}<br>
-<br>
 StateType Process::GetPrivateState() { return m_private_state.GetValue(); }<br>
<br>
 void Process::SetPrivateState(StateType new_state) {<br>
@@ -4267,20 +4260,11 @@ void Process::ProcessEventData::DoOnRemo<br>
         // public resume.<br>
         process_sp->PrivateResume();<br>
       } else {<br>
-        bool hijacked = <br>
-            process_sp->IsHijackedForEvent(eBroadcastBitStateChanged)<br>
-            && !process_sp->IsHijackedForSynchronousResume();<br>
-<br>
-        if (!hijacked) {<br>
-          // If we didn't restart, run the Stop Hooks here.<br>
-          // Don't do that if state changed events aren't hooked up to the<br>
-          // public (or SyncResume) broadcasters.  StopHooks are just for <br>
-          // real public stops.  They might also restart the target, <br>
-          // so watch for that.<br>
-          process_sp->GetTarget().RunStopHooks();<br>
-          if (process_sp->GetPrivateState() == eStateRunning)<br>
-            SetRestarted(true);<br>
-        }<br>
+        // If we didn't restart, run the Stop Hooks here: They might also<br>
+        // restart the target, so watch for that.<br>
+        process_sp->GetTarget().RunStopHooks();<br>
+        if (process_sp->GetPrivateState() == eStateRunning)<br>
+          SetRestarted(true);<br>
       }<br>
     }<br>
   }<br>
<br>
Modified: lldb/trunk/source/Target/Target.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=354711&r1=354710&r2=354711&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=354711&r1=354710&r2=354711&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/Target.cpp (original)<br>
+++ lldb/trunk/source/Target/Target.cpp Fri Feb 22 17:08:17 2019<br>
@@ -2554,14 +2554,12 @@ void Target::RunStopHooks() {<br>
<br>
   StopHookCollection::iterator pos, end = m_stop_hooks.end();<br>
<br>
-  // If there aren't any active stop hooks, don't bother either.<br>
-  // Also see if any of the active hooks want to auto-continue.<br>
+  // If there aren't any active stop hooks, don't bother either:<br>
   bool any_active_hooks = false;<br>
-  bool auto_continue = false;<br>
-  for (auto hook : m_stop_hooks) {<br>
-    if (hook.second->IsActive()) {<br>
+  for (pos = m_stop_hooks.begin(); pos != end; pos++) {<br>
+    if ((*pos).second->IsActive()) {<br>
       any_active_hooks = true;<br>
-      auto_continue |= hook.second->GetAutoContinue();<br>
+      break;<br>
     }<br>
   }<br>
   if (!any_active_hooks)<br>
@@ -2597,7 +2595,6 @@ void Target::RunStopHooks() {<br>
   bool hooks_ran = false;<br>
   bool print_hook_header = (m_stop_hooks.size() != 1);<br>
   bool print_thread_header = (num_exe_ctx != 1);<br>
-  bool did_restart = false;<br>
<br>
   for (pos = m_stop_hooks.begin(); keep_going && pos != end; pos++) {<br>
     // result.Clear();<br>
@@ -2642,13 +2639,10 @@ void Target::RunStopHooks() {<br>
         options.SetPrintResults(true);<br>
         options.SetAddToHistory(false);<br>
<br>
-        // Force Async:<br>
-        bool old_async = GetDebugger().GetAsyncExecution();<br>
-        GetDebugger().SetAsyncExecution(true);<br>
         GetDebugger().GetCommandInterpreter().HandleCommands(<br>
             cur_hook_sp->GetCommands(), &exc_ctx_with_reasons[i], options,<br>
             result);<br>
-        GetDebugger().SetAsyncExecution(old_async);<br>
+<br>
         // If the command started the target going again, we should bag out of<br>
         // running the stop hooks.<br>
         if ((result.GetStatus() == eReturnStatusSuccessContinuingNoResult) ||<br>
@@ -2657,19 +2651,13 @@ void Target::RunStopHooks() {<br>
           StopHookCollection::iterator tmp = pos;<br>
           if (++tmp != end)<br>
             result.AppendMessageWithFormat("\nAborting stop hooks, hook %" PRIu64<br>
-                                           " set the program running.\n"<br>
-                                           "  Consider using '-G true' to make "<br>
-                                           "stop hooks auto-continue.\n",<br>
+                                           " set the program running.\n",<br>
                                            cur_hook_sp->GetID());<br>
           keep_going = false;<br>
-          did_restart = true;<br>
         }<br>
       }<br>
     }<br>
   }<br>
-  // Finally, if auto-continue was requested, do it now:<br>
-  if (!did_restart && auto_continue)<br>
-    m_process_sp->PrivateResume();<br>
<br>
   result.GetImmediateOutputStream()->Flush();<br>
   result.GetImmediateErrorStream()->Flush();<br>
@@ -3155,13 +3143,12 @@ void Target::FinalizeFileActions(Process<br>
 //--------------------------------------------------------------<br>
 Target::StopHook::StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid)<br>
     : UserID(uid), m_target_sp(target_sp), m_commands(), m_specifier_sp(),<br>
-      m_thread_spec_up() {}<br>
+      m_thread_spec_up(), m_active(true) {}<br>
<br>
 Target::StopHook::StopHook(const StopHook &rhs)<br>
     : UserID(rhs.GetID()), m_target_sp(rhs.m_target_sp),<br>
       m_commands(rhs.m_commands), m_specifier_sp(rhs.m_specifier_sp),<br>
-      m_thread_spec_up(), m_active(rhs.m_active),<br>
-      m_auto_continue(rhs.m_auto_continue) {<br>
+      m_thread_spec_up(), m_active(rhs.m_active) {<br>
   if (rhs.m_thread_spec_up)<br>
     m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));<br>
 }<br>
@@ -3188,9 +3175,6 @@ void Target::StopHook::GetDescription(St<br>
   else<br>
     s->Indent("State: disabled\n");<br>
<br>
-  if (m_auto_continue)<br>
-    s->Indent("AutoContinue on\n");<br>
-<br>
   if (m_specifier_sp) {<br>
     s->Indent();<br>
     s->PutCString("Specifier:\n");<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>