summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmdCmdExec.cpp
diff options
context:
space:
mode:
authorAlexander Polyakov <polyakov.alx@gmail.com>2018-06-07 19:09:01 +0000
committerAlexander Polyakov <polyakov.alx@gmail.com>2018-06-07 19:09:01 +0000
commit2b08ca76df4a145859ec5ec00612c61fb5633a23 (patch)
tree04d5ee8645b309ef6919718fdc93a3897c7b02cd /lldb/tools/lldb-mi/MICmdCmdExec.cpp
parent20fa3d250481c4b837500bfd36140dcefe46ce5a (diff)
downloadbcm5719-llvm-2b08ca76df4a145859ec5ec00612c61fb5633a23.tar.gz
bcm5719-llvm-2b08ca76df4a145859ec5ec00612c61fb5633a23.zip
[lldb-mi] Re-implement MI -exec-next command.
Summary: Now -exec-next command uses SB API for stepping over. Reviewers: aprantl, clayborg, stella.stamenova, labath Reviewed By: aprantl, clayborg, labath Subscribers: labath, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47797 llvm-svn: 334215
Diffstat (limited to 'lldb/tools/lldb-mi/MICmdCmdExec.cpp')
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdExec.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lldb/tools/lldb-mi/MICmdCmdExec.cpp b/lldb/tools/lldb-mi/MICmdCmdExec.cpp
index 4a6f40b26d4..12d95d7afa9 100644
--- a/lldb/tools/lldb-mi/MICmdCmdExec.cpp
+++ b/lldb/tools/lldb-mi/MICmdCmdExec.cpp
@@ -22,6 +22,7 @@
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBStream.h"
+#include "lldb/API/SBThread.h"
#include "lldb/lldb-enumerations.h"
// In-house headers:
@@ -378,12 +379,17 @@ bool CMICmdCmdExecNext::Execute() {
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
- CMIUtilString strCmd("thread step-over");
- if (nThreadId != UINT64_MAX)
- strCmd += CMIUtilString::Format(" %llu", nThreadId);
- rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult,
- false);
+
+ if (nThreadId != UINT64_MAX) {
+ lldb::SBThread sbThread = rSessionInfo.GetProcess().GetThreadByIndexID(nThreadId);
+ if (!sbThread.IsValid()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_THREAD_INVALID),
+ m_cmdData.strMiCmd.c_str(),
+ m_constStrArgThread.c_str()));
+ return MIstatus::failure;
+ }
+ sbThread.StepOver();
+ } else rSessionInfo.GetProcess().GetSelectedThread().StepOver();
return MIstatus::success;
}
OpenPOWER on IntegriCloud