[Lldb-commits] [lldb] r339160 - [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.
Alexander Polyakov via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 7 10:55:26 PDT 2018
Author: apolyakov
Date: Tue Aug 7 10:55:26 2018
New Revision: 339160
URL: http://llvm.org/viewvc/llvm-project?rev=339160&view=rev
Log:
[lldb-mi] Re-implement MI HandleProcessEventStateSuspended.
Summary: Now this function uses SB API instead of HandleCommand.
Reviewers: aprantl, clayborg, labath
Reviewed By: aprantl
Subscribers: ki.stfu, lldb-commits
Differential Revision: https://reviews.llvm.org/D49632
Modified:
lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp?rev=339160&r1=339159&r2=339160&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Tue Aug 7 10:55:26 2018
@@ -950,6 +950,7 @@ bool CMICmnLLDBDebuggerHandleEvents::Han
bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended(
const lldb::SBEvent &vEvent) {
bool bOk = MIstatus::success;
+ lldb::SBStream streamOut;
lldb::SBDebugger &rDebugger =
CMICmnLLDBDebugSessionInfo::Instance().GetDebugger();
lldb::SBProcess sbProcess =
@@ -958,16 +959,17 @@ bool CMICmnLLDBDebuggerHandleEvents::Han
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);
More information about the lldb-commits
mailing list