[Lldb-commits] [PATCH] D49632: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.

Alexander Polyakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 7 10:56:00 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL339160: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended. (authored by apolyakov, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D49632?vs=157533&id=159547#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49632

Files:
  lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp


Index: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
@@ -950,24 +950,26 @@
 bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended(
     const lldb::SBEvent &vEvent) {
   bool bOk = MIstatus::success;
+  lldb::SBStream streamOut;
   lldb::SBDebugger &rDebugger =
       CMICmnLLDBDebugSessionInfo::Instance().GetDebugger();
   lldb::SBProcess sbProcess =
       CMICmnLLDBDebugSessionInfo::Instance().GetProcess();
   lldb::SBTarget target = sbProcess.GetTarget();
   if (rDebugger.GetSelectedTarget() == target) {
     if (!UpdateSelectedThread())
       return MIstatus::failure;
-
-    lldb::SBCommandReturnObject result;
-    const lldb::ReturnStatus status =
-        rDebugger.GetCommandInterpreter().HandleCommand("process status",
-                                                        result, false);
-    MIunused(status);
-    bOk = TextToStderr(result.GetError());
-    bOk = bOk && TextToStdout(result.GetOutput());
+    sbProcess.GetDescription(streamOut);
+    // Add a delimiter between process' and threads' info.
+    streamOut.Printf("\n");
+    for (uint32_t i = 0, e = sbProcess.GetNumThreads(); i < e; ++i) {
+      const lldb::SBThread thread = sbProcess.GetThreadAtIndex(i);
+      if (!thread.IsValid())
+        continue;
+      thread.GetDescription(streamOut);
+    }
+    bOk = TextToStdout(streamOut.GetData());
   } else {
-    lldb::SBStream streamOut;
     const MIuint nTargetIndex = rDebugger.GetIndexOfTarget(target);
     if (nTargetIndex != UINT_MAX)
       streamOut.Printf("Target %d: (", nTargetIndex);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49632.159547.patch
Type: text/x-patch
Size: 1768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180807/adb2b6d1/attachment.bin>


More information about the lldb-commits mailing list