Changeset View
Changeset View
Standalone View
Standalone View
tools/lldb-mi/MICmdCmdMiscellanous.cpp
Show First 20 Lines • Show All 490 Lines • ▼ Show 20 Lines | |||||
// Type: Overridden. | // Type: Overridden. | ||||
// Args: None. | // Args: None. | ||||
// Return: MIstatus::success - Functional succeeded. | // Return: MIstatus::success - Functional succeeded. | ||||
// MIstatus::failure - Functional failed. | // MIstatus::failure - Functional failed. | ||||
// Throws: None. | // Throws: None. | ||||
//-- | //-- | ||||
bool CMICmdCmdInterpreterExec::Acknowledge() { | bool CMICmdCmdInterpreterExec::Acknowledge() { | ||||
if (m_lldbResult.GetOutputSize() > 0) { | if (m_lldbResult.GetOutputSize() > 0) { | ||||
CMIUtilString strMsg(m_lldbResult.GetOutput()); | const CMIUtilString line(m_lldbResult.GetOutput()); | ||||
strMsg = strMsg.StripCREndOfLine(); | const bool bEscapeQuotes(true); | ||||
CMICmnStreamStdout::TextToStdout(strMsg); | 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) { | if (m_lldbResult.GetErrorSize() > 0) { | ||||
CMIUtilString strMsg(m_lldbResult.GetError()); | const CMIUtilString line(m_lldbResult.GetError()); | ||||
strMsg = strMsg.StripCREndOfLine(); | const bool bEscapeQuotes(true); | ||||
CMICmnStreamStderr::LLDBMsgToConsole(strMsg); | CMICmnMIValueConst miValueConst(line.Escape(bEscapeQuotes)); | ||||
CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput, miValueConst); | |||||
const bool bOk = CMICmnStreamStdout::TextToStdout(miOutOfBandRecord.GetString()); | |||||
if (!bOk) | |||||
return MIstatus::failure; | |||||
} | } | ||||
abidh: It is not really an OutofBand record but rather an output of the command. Why not simple add… | |||||
Not Done ReplyInline ActionsThe output of the command should be a Stream record which is an OutofBand record according to the spec [1]. I agree it's no more than prepending '~' and quoting the string. But why not just do what the spec says? ;-) [1] https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stream-Records.html#GDB_002fMI-Stream-Records aetf: The output of the command should be a Stream record which is an OutofBand record according to… | |||||
ok. abidh: ok. | |||||
const CMICmnMIResultRecord miRecordResult( | const CMICmnMIResultRecord miRecordResult( | ||||
m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done); | m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done); | ||||
m_miResultRecord = miRecordResult; | m_miResultRecord = miRecordResult; | ||||
return MIstatus::success; | return MIstatus::success; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
It is not really an OutofBand record but rather an output of the command. Why not simple add prepend an ~