Changeset View
Changeset View
Standalone View
Standalone View
tools/lldb-mi/MICmdCmdData.cpp
Show First 20 Lines • Show All 1,607 Lines • ▼ Show 20 Lines | CMICmdCmdDataInfoLine::Execute() | ||||
const CMIUtilString &strLocation(pArgLocation->GetValue()); | const CMIUtilString &strLocation(pArgLocation->GetValue()); | ||||
CMIUtilString strCmdOptionsLocation; | CMIUtilString strCmdOptionsLocation; | ||||
if (strLocation.at(0) == '*') | if (strLocation.at(0) == '*') | ||||
{ | { | ||||
// Parse argument: | // Parse argument: | ||||
// *0x12345 | // *0x12345 | ||||
// ^^^^^^^ -- address | // ^^^^^^^ -- address | ||||
const CMIUtilString strAddress(strLocation.c_str() + 1); | const CMIUtilString strAddress(strLocation.substr(1)); | ||||
strCmdOptionsLocation = CMIUtilString::Format("--address %s", strAddress.c_str()); | strCmdOptionsLocation = CMIUtilString::Format("--address %s", strAddress.c_str()); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
const size_t nLineStartPos = strLocation.rfind(':'); | const size_t nLineStartPos = strLocation.rfind(':'); | ||||
if ((nLineStartPos == std::string::npos) || (nLineStartPos == 0) || (nLineStartPos == strLocation.length() - 1)) | if ((nLineStartPos == std::string::npos) || (nLineStartPos == 0) || (nLineStartPos == strLocation.length() - 1)) | ||||
{ | { | ||||
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_LOCATION_FORMAT), m_cmdData.strMiCmd.c_str(), strLocation.c_str()) | SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_LOCATION_FORMAT), m_cmdData.strMiCmd.c_str(), strLocation.c_str()) | ||||
.c_str()); | .c_str()); | ||||
return MIstatus::failure; | return MIstatus::failure; | ||||
} | } | ||||
// Parse argument: | // Parse argument: | ||||
// hello.cpp:5 | // hello.cpp:5 | ||||
// ^^^^^^^^^ -- file | // ^^^^^^^^^ -- file | ||||
// ^ -- line | // ^ -- line | ||||
const CMIUtilString strFile(strLocation.substr(0, nLineStartPos).c_str()); | const CMIUtilString strFile(strLocation.substr(0, nLineStartPos)); | ||||
const CMIUtilString strLine(strLocation.substr(nLineStartPos + 1).c_str()); | const CMIUtilString strLine(strLocation.substr(nLineStartPos + 1)); | ||||
strCmdOptionsLocation = CMIUtilString::Format("--file \"%s\" --line %s", strFile.AddSlashes().c_str(), strLine.c_str()); | strCmdOptionsLocation = CMIUtilString::Format("--file \"%s\" --line %s", strFile.AddSlashes().c_str(), strLine.c_str()); | ||||
} | } | ||||
const CMIUtilString strCmd(CMIUtilString::Format("target modules lookup -v %s", strCmdOptionsLocation.c_str())); | const CMIUtilString strCmd(CMIUtilString::Format("target modules lookup -v %s", strCmdOptionsLocation.c_str())); | ||||
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance()); | CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance()); | ||||
const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult); | const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult); | ||||
MIunused(rtn); | MIunused(rtn); | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |