[Lldb-commits] [PATCH] D12968: Fix for lldb-mi crash in Listener code if -exec-abort MI command was invoked without getting process stopped

Kirill Lapshin via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 22 10:30:05 PDT 2015


KLapshin updated the summary for this revision.
KLapshin updated this revision to Diff 35390.

Repository:
  rL LLVM

http://reviews.llvm.org/D12968

Files:
  source/Target/Process.cpp

Index: source/Target/Process.cpp
===================================================================
--- source/Target/Process.cpp
+++ source/Target/Process.cpp
@@ -3930,7 +3930,15 @@
             // Consume the halt event.
             TimeValue timeout (TimeValue::Now());
             timeout.OffsetWithSeconds(1);
-            StateType state = WaitForProcessToStop (&timeout, &exit_event_sp);
+
+            ListenerSP listener_sp (new Listener("lldb.Process.HaltForDestroyOrDetach.hijack"));
+            HijackProcessEvents(listener_sp.get());
+
+            StateType state = WaitForProcessToStop (NULL, &exit_event_sp, true, listener_sp.get());
+
+            // Don't forget to notify other listeners.
+            RestoreProcessEvents();
+            BroadcastEvent(exit_event_sp);
             
             // If the process exited while we were waiting for it to stop, put the exited event into
             // the shared pointer passed in and return.  Our caller doesn't need to do anything else, since


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12968.35390.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150922/9e9f32f9/attachment.bin>


More information about the lldb-commits mailing list