aetf updated this revision to Diff 82654.
aetf marked an inline comment as done.
aetf added a comment.
Add unit tests, add error checking for SetInternalVariable
https://reviews.llvm.org/D24711
Files:
packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py
packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
tools/lldb-mi/MICmdCmdEnviro.cpp
tools/lldb-mi/MICmdCmdGdbSet.cpp
tools/lldb-mi/MICmdCmdGdbSet.h
tools/lldb-mi/MICmdCmdGdbShow.cpp
tools/lldb-mi/MICmdCmdGdbShow.h
tools/lldb-mi/MICmdCmdMiscellanous.cpp
tools/lldb-mi/MICmdCmdTarget.cpp
tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
tools/lldb-mi/MICmnMIOutOfBandRecord.h
Index: tools/lldb-mi/MICmnMIOutOfBandRecord.h
===
--- tools/lldb-mi/MICmnMIOutOfBandRecord.h
+++ tools/lldb-mi/MICmnMIOutOfBandRecord.h
@@ -65,7 +65,9 @@
eOutOfBand_ThreadSelected,
eOutOfBand_TargetModuleLoaded,
eOutOfBand_TargetModuleUnloaded,
-eOutOfBand_TargetStreamOutput
+eOutOfBand_TargetStreamOutput,
+eOutOfBand_ConsoleStreamOutput,
+eOutOfBand_LogStreamOutput
};
// Methods:
Index: tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
===
--- tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
+++ tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
@@ -48,6 +48,10 @@
return "library-unloaded";
case CMICmnMIOutOfBandRecord::eOutOfBand_TargetStreamOutput:
return "";
+ case CMICmnMIOutOfBandRecord::eOutOfBand_ConsoleStreamOutput:
+return "";
+ case CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput:
+return "";
}
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
return NULL;
@@ -86,6 +90,10 @@
return "=";
case CMICmnMIOutOfBandRecord::eOutOfBand_TargetStreamOutput:
return "@";
+ case CMICmnMIOutOfBandRecord::eOutOfBand_ConsoleStreamOutput:
+return "~";
+ case CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput:
+return "&";
}
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
return NULL;
Index: tools/lldb-mi/MICmdCmdTarget.cpp
===
--- tools/lldb-mi/MICmdCmdTarget.cpp
+++ tools/lldb-mi/MICmdCmdTarget.cpp
@@ -123,6 +123,7 @@
// Verify that we have managed to connect successfully
lldb::SBStream errMsg;
+ error.GetDescription(errMsg);
if (!process.IsValid()) {
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_PLUGIN),
m_cmdData.strMiCmd.c_str(),
Index: tools/lldb-mi/MICmdCmdMiscellanous.cpp
===
--- tools/lldb-mi/MICmdCmdMiscellanous.cpp
+++ tools/lldb-mi/MICmdCmdMiscellanous.cpp
@@ -496,14 +496,22 @@
//--
bool CMICmdCmdInterpreterExec::Acknowledge() {
if (m_lldbResult.GetOutputSize() > 0) {
-CMIUtilString strMsg(m_lldbResult.GetOutput());
-strMsg = strMsg.StripCREndOfLine();
-CMICmnStreamStdout::TextToStdout(strMsg);
+const CMIUtilString line(m_lldbResult.GetOutput());
+const bool bEscapeQuotes(true);
+CMICmnMIValueConst miValueConst(line.Escape(bEscapeQuotes));
+CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_ConsoleStreamOutput, miValueConst);
+const bool bOk = CMICmnStreamStdout::TextToStdout(miOutOfBandRecord.GetString());
+if (!bOk)
+ return MIstatus::failure;
}
if (m_lldbResult.GetErrorSize() > 0) {
-CMIUtilString strMsg(m_lldbResult.GetError());
-strMsg = strMsg.StripCREndOfLine();
-CMICmnStreamStderr::LLDBMsgToConsole(strMsg);
+const CMIUtilString line(m_lldbResult.GetError());
+const bool bEscapeQuotes(true);
+CMICmnMIValueConst miValueConst(line.Escape(bEscapeQuotes));
+CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput, miValueConst);
+const bool bOk = CMICmnStreamStdout::TextToStdout(miOutOfBandRecord.GetString());
+if (!bOk)
+ return MIstatus::failure;
}
const CMICmnMIResultRecord miRecordResult(
Index: tools/lldb-mi/MICmdCmdGdbShow.h
===
--- tools/lldb-mi/MICmdCmdGdbShow.h
+++ tools/lldb-mi/MICmdCmdGdbShow.h
@@ -78,6 +78,7 @@
bool OptionFnTargetAsync(const CMIUtilString::VecString_t &vrWords);
bool OptionFnPrint(const CMIUtilString::VecString_t &vrWords);
bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
+ bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
// Attributes:
Index: tools/lldb-mi/MICmdCmdGdbShow.cpp
===