This revision was automatically updated to reflect the committed changes.
Closed by commit rL334350: [lldb, lldb-mi] Re-implement MI -exec-continue
command. (authored by apolyakov, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D47415?vs=150486&id=150629#toc
Repository:
rL LLVM
https://reviews.llvm.org/D47415
Files:
lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test
lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdExec.h
Index: lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test
===================================================================
--- lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test
+++ lldb/trunk/lit/tools/lldb-mi/exec/exec-continue.test
@@ -0,0 +1,20 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-continue command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-continue
+# CHECK: ^running
Index: lldb/trunk/tools/lldb-mi/MICmdCmdExec.h
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdExec.h
+++ lldb/trunk/tools/lldb-mi/MICmdCmdExec.h
@@ -93,8 +93,6 @@
/* dtor */ ~CMICmdCmdExecContinue() override;
// Attributes:
-private:
- lldb::SBCommandReturnObject m_lldbResult;
};
//++
Index: lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp
@@ -233,35 +233,23 @@
// Throws: None.
//--
bool CMICmdCmdExecContinue::Execute() {
- const char *pCmd = "continue";
- CMICmnLLDBDebugSessionInfo &rSessionInfo(
- CMICmnLLDBDebugSessionInfo::Instance());
- const lldb::ReturnStatus rtn =
- rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(
- pCmd, m_lldbResult);
- MIunused(rtn);
-
- if (m_lldbResult.GetErrorSize() == 0) {
+ lldb::SBError error =
+ CMICmnLLDBDebugSessionInfo::Instance().GetProcess().Continue();
+
+ if (error.Success()) {
// CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
if (!CMIDriver::Instance().SetDriverStateRunningDebugging()) {
const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
m_cmdData.strMiCmd.c_str(),
rErrMsg.c_str()));
return MIstatus::failure;
}
- } else {
- // ToDo: Re-evaluate if this is required when application near finished as
- // this is parsing LLDB error message
- // which seems a hack and is code brittle
- const char *pLldbErr = m_lldbResult.GetError();
- const CMIUtilString strLldbMsg(CMIUtilString(pLldbErr).StripCREndOfLine());
- if (strLldbMsg == "error: Process must be launched.") {
- CMIDriver::Instance().SetExitApplicationFlag(true);
- }
+ return MIstatus::success;
}
- return MIstatus::success;
+ SetError(error.GetCString());
+ return MIstatus::failure;
}
//++
@@ -276,19 +264,9 @@
// Throws: None.
//--
bool CMICmdCmdExecContinue::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
- }
-
+ const CMICmnMIResultRecord miRecordResult(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
+ m_miResultRecord = miRecordResult;
return MIstatus::success;
}
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits