diff --git a/src/MICmdCmdBreak.cpp b/src/MICmdCmdBreak.cpp index 50f12f8..343dd35 100644 --- a/src/MICmdCmdBreak.cpp +++ b/src/MICmdCmdBreak.cpp @@ -41,13 +41,16 @@ // Throws: None. //-- CMICmdCmdBreakInsert::CMICmdCmdBreakInsert() - : m_bBrkPtIsTemp(false), m_bBrkPtIsPending(false), m_nBrkPtIgnoreCount(0), - m_bBrkPtEnabled(false), m_bBrkPtCondition(false), m_bBrkPtThreadId(false), - m_nBrkPtThreadId(0), m_constStrArgNamedTempBrkPt("t"), - m_constStrArgNamedHWBrkPt("h"), m_constStrArgNamedPendinfBrkPt("f"), - m_constStrArgNamedDisableBrkPt("d"), m_constStrArgNamedTracePt("a"), - m_constStrArgNamedConditionalBrkPt("c"), m_constStrArgNamedInoreCnt("i"), - m_constStrArgNamedRestrictBrkPtToThreadId("p"), + : m_bBreakpointIsTemp(false), m_bBreakpointIsPending(false), + m_nBreakpointIgnoreCount(0), m_bBreakpointEnabled(false), + m_bBreakpointCondition(false), m_bBreakpointThreadId(false), + m_nBreakpointThreadId(0), m_constStrArgNamedTempBreakpoint("t"), + m_constStrArgNamedHWBreakpoint("h"), + m_constStrArgNamedPendinfBreakpoint("f"), + m_constStrArgNamedDisableBreakpoint("d"), m_constStrArgNamedTracePt("a"), + m_constStrArgNamedConditionalBreakpoint("c"), + m_constStrArgNamedInoreCnt("i"), + m_constStrArgNamedRestrictBreakpointToThreadId("p"), m_constStrArgNamedLocation("location") { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "break-insert"; @@ -76,24 +79,24 @@ CMICmdCmdBreakInsert::~CMICmdCmdBreakInsert() {} // Throws: None. //-- bool CMICmdCmdBreakInsert::ParseArgs() { - m_setCmdArgs.Add( - new CMICmdArgValOptionShort(m_constStrArgNamedTempBrkPt, false, true)); + m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedTempBreakpoint, + false, true)); // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( - // m_constStrArgNamedHWBrkPt, false, false)); - m_setCmdArgs.Add( - new CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true)); - m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedDisableBrkPt, - false, false)); + // m_constStrArgNamedHWBreakpoint, false, false)); + m_setCmdArgs.Add(new CMICmdArgValOptionShort( + m_constStrArgNamedPendinfBreakpoint, false, true)); + m_setCmdArgs.Add(new CMICmdArgValOptionShort( + m_constStrArgNamedDisableBreakpoint, false, false)); // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( // m_constStrArgNamedTracePt, false, false)); m_setCmdArgs.Add(new CMICmdArgValOptionShort( - m_constStrArgNamedConditionalBrkPt, false, true, + m_constStrArgNamedConditionalBreakpoint, false, true, CMICmdArgValListBase::eArgValType_StringQuoted, 1)); m_setCmdArgs.Add( new CMICmdArgValOptionShort(m_constStrArgNamedInoreCnt, false, true, CMICmdArgValListBase::eArgValType_Number, 1)); m_setCmdArgs.Add(new CMICmdArgValOptionShort( - m_constStrArgNamedRestrictBrkPtToThreadId, false, true, + m_constStrArgNamedRestrictBreakpointToThreadId, false, true, CMICmdArgValListBase::eArgValType_Number, 1)); m_setCmdArgs.Add(new CMICmdArgValString(m_constStrArgNamedLocation, false, true, false, false, true)); @@ -129,26 +132,27 @@ static size_t findFileSeparatorPos(const std::string &x) { // Throws: None. //-- bool CMICmdCmdBreakInsert::Execute() { - CMICMDBASE_GETOPTION(pArgTempBrkPt, OptionShort, m_constStrArgNamedTempBrkPt); + CMICMDBASE_GETOPTION(pArgTempBreakpoint, OptionShort, + m_constStrArgNamedTempBreakpoint); CMICMDBASE_GETOPTION(pArgThreadGroup, OptionLong, m_constStrArgThreadGroup); CMICMDBASE_GETOPTION(pArgLocation, String, m_constStrArgNamedLocation); CMICMDBASE_GETOPTION(pArgIgnoreCnt, OptionShort, m_constStrArgNamedInoreCnt); - CMICMDBASE_GETOPTION(pArgPendingBrkPt, OptionShort, - m_constStrArgNamedPendinfBrkPt); - CMICMDBASE_GETOPTION(pArgDisableBrkPt, OptionShort, - m_constStrArgNamedDisableBrkPt); - CMICMDBASE_GETOPTION(pArgConditionalBrkPt, OptionShort, - m_constStrArgNamedConditionalBrkPt); - CMICMDBASE_GETOPTION(pArgRestrictBrkPtToThreadId, OptionShort, - m_constStrArgNamedRestrictBrkPtToThreadId); + CMICMDBASE_GETOPTION(pArgPendingBreakpoint, OptionShort, + m_constStrArgNamedPendinfBreakpoint); + CMICMDBASE_GETOPTION(pArgDisableBreakpoint, OptionShort, + m_constStrArgNamedDisableBreakpoint); + CMICMDBASE_GETOPTION(pArgConditionalBreakpoint, OptionShort, + m_constStrArgNamedConditionalBreakpoint); + CMICMDBASE_GETOPTION(pArgRestrictBreakpointToThreadId, OptionShort, + m_constStrArgNamedRestrictBreakpointToThreadId); // Ask LLDB for the target to check if we have valid or dummy one. CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); lldb::SBTarget sbTarget = rSessionInfo.GetTarget(); - m_bBrkPtEnabled = !pArgDisableBrkPt->GetFound(); - m_bBrkPtIsTemp = pArgTempBrkPt->GetFound(); + m_bBreakpointEnabled = !pArgDisableBreakpoint->GetFound(); + m_bBreakpointIsTemp = pArgTempBreakpoint->GetFound(); m_bHaveArgOptionThreadGrp = pArgThreadGroup->GetFound(); if (m_bHaveArgOptionThreadGrp) { MIuint nThreadGrp = 0; @@ -158,41 +162,42 @@ bool CMICmdCmdBreakInsert::Execute() { } if (sbTarget == rSessionInfo.GetDebugger().GetDummyTarget()) - m_bBrkPtIsPending = true; + m_bBreakpointIsPending = true; else { - m_bBrkPtIsPending = pArgPendingBrkPt->GetFound(); - if (!m_bBrkPtIsPending) { + m_bBreakpointIsPending = pArgPendingBreakpoint->GetFound(); + if (!m_bBreakpointIsPending) { CMIUtilString pending; if (m_rLLDBDebugSessionInfo.SharedDataRetrieve("breakpoint.pending", pending)) { - m_bBrkPtIsPending = pending == "on"; + m_bBreakpointIsPending = pending == "on"; } } } if (pArgLocation->GetFound()) m_brkName = pArgLocation->GetValue(); - else if (m_bBrkPtIsPending) { - pArgPendingBrkPt->GetExpectedOption( + else if (m_bBreakpointIsPending) { + pArgPendingBreakpoint->GetExpectedOption( m_brkName); } if (pArgIgnoreCnt->GetFound()) { pArgIgnoreCnt->GetExpectedOption( - m_nBrkPtIgnoreCount); + m_nBreakpointIgnoreCount); } - m_bBrkPtCondition = pArgConditionalBrkPt->GetFound(); - if (m_bBrkPtCondition) { - pArgConditionalBrkPt->GetExpectedOption( - m_brkPtCondition); + m_bBreakpointCondition = pArgConditionalBreakpoint->GetFound(); + if (m_bBreakpointCondition) { + pArgConditionalBreakpoint + ->GetExpectedOption( + m_breakpointCondition); } - m_bBrkPtThreadId = pArgRestrictBrkPtToThreadId->GetFound(); - if (m_bBrkPtCondition) { - pArgRestrictBrkPtToThreadId->GetExpectedOption( - m_nBrkPtThreadId); + m_bBreakpointThreadId = pArgRestrictBreakpointToThreadId->GetFound(); + if (m_bBreakpointCondition) { + pArgRestrictBreakpointToThreadId + ->GetExpectedOption(m_nBreakpointThreadId); } // Determine if break on a file line or at a function - BreakPoint_e eBrkPtType = eBreakPoint_NotDefineYet; + BreakPoint_e eBreakpointType = eBreakPoint_NotDefineYet; CMIUtilString fileName; MIuint nFileLine = 0; CMIUtilString strFileFn; @@ -207,55 +212,56 @@ bool CMICmdCmdBreakInsert::Execute() { m_brkName.substr(nPosColon + 1, m_brkName.size() - nPosColon - 1); if (rStrLineOrFn.empty()) - eBrkPtType = eBreakPoint_ByName; + eBreakpointType = eBreakPoint_ByName; else { MIint64 nValue = 0; if (rStrLineOrFn.ExtractNumber(nValue)) { nFileLine = static_cast(nValue); - eBrkPtType = eBreakPoint_ByFileLine; + eBreakpointType = eBreakPoint_ByFileLine; } else { strFileFn = rStrLineOrFn; - eBrkPtType = eBreakPoint_ByFileFn; + eBreakpointType = eBreakPoint_ByFileFn; } } } // Determine if break defined as an address lldb::addr_t nAddress = 0; - if (eBrkPtType == eBreakPoint_NotDefineYet) { + if (eBreakpointType == eBreakPoint_NotDefineYet) { if (!m_brkName.empty() && m_brkName[0] == '*') { MIint64 nValue = 0; if (CMIUtilString(m_brkName.substr(1)).ExtractNumber(nValue)) { nAddress = static_cast(nValue); - eBrkPtType = eBreakPoint_ByAddress; + eBreakpointType = eBreakPoint_ByAddress; } } } // Break defined as an function - if (eBrkPtType == eBreakPoint_NotDefineYet) { - eBrkPtType = eBreakPoint_ByName; + if (eBreakpointType == eBreakPoint_NotDefineYet) { + eBreakpointType = eBreakPoint_ByName; } // Ask LLDB to create a breakpoint bool bOk = MIstatus::success; - switch (eBrkPtType) { + switch (eBreakpointType) { case eBreakPoint_ByAddress: - m_brkPt = sbTarget.BreakpointCreateByAddress(nAddress); + m_breakpoint = sbTarget.BreakpointCreateByAddress(nAddress); break; case eBreakPoint_ByFileFn: { lldb::SBFileSpecList module; // search in all modules lldb::SBFileSpecList compUnit; compUnit.Append(lldb::SBFileSpec(fileName.c_str())); - m_brkPt = + m_breakpoint = sbTarget.BreakpointCreateByName(strFileFn.c_str(), module, compUnit); break; } case eBreakPoint_ByFileLine: - m_brkPt = sbTarget.BreakpointCreateByLocation(fileName.c_str(), nFileLine); + m_breakpoint = + sbTarget.BreakpointCreateByLocation(fileName.c_str(), nFileLine); break; case eBreakPoint_ByName: - m_brkPt = sbTarget.BreakpointCreateByName(m_brkName.c_str(), nullptr); + m_breakpoint = sbTarget.BreakpointCreateByName(m_brkName.c_str(), nullptr); break; case eBreakPoint_count: case eBreakPoint_NotDefineYet: @@ -265,57 +271,57 @@ bool CMICmdCmdBreakInsert::Execute() { } if (bOk) { - if (!m_bBrkPtIsPending && (m_brkPt.GetNumLocations() == 0)) { - sbTarget.BreakpointDelete(m_brkPt.GetID()); - SetError( - CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), m_brkName.c_str())); + if (!m_bBreakpointIsPending && (m_breakpoint.GetNumLocations() == 0)) { + sbTarget.BreakpointDelete(m_breakpoint.GetID()); + SetError(CMIUtilString::Format( + MIRSRC(IDS_CMD_ERR_BREAKPOINT_LOCATION_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), m_brkName.c_str())); return MIstatus::failure; } - m_brkPt.SetEnabled(m_bBrkPtEnabled); - m_brkPt.SetIgnoreCount(m_nBrkPtIgnoreCount); - m_brkPt.SetOneShot(m_bBrkPtIsTemp); - if (m_bBrkPtCondition) - m_brkPt.SetCondition(m_brkPtCondition.c_str()); - if (m_bBrkPtThreadId) - m_brkPt.SetThreadID(m_nBrkPtThreadId); + m_breakpoint.SetEnabled(m_bBreakpointEnabled); + m_breakpoint.SetIgnoreCount(m_nBreakpointIgnoreCount); + m_breakpoint.SetOneShot(m_bBreakpointIsTemp); + if (m_bBreakpointCondition) + m_breakpoint.SetCondition(m_breakpointCondition.c_str()); + if (m_bBreakpointThreadId) + m_breakpoint.SetThreadID(m_nBreakpointThreadId); } // CODETAG_LLDB_BREAKPOINT_CREATION // This is in the main thread // Record break point information to be by LLDB event handler function - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.GetStopPtInfo(m_brkPt, sStopPtInfo)) + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.GetStoppointInfo(m_breakpoint, sStoppointInfo)) return MIstatus::failure; - sStopPtInfo.m_bDisp = m_bBrkPtIsTemp; - sStopPtInfo.m_bEnabled = m_bBrkPtEnabled; - sStopPtInfo.m_bHaveArgOptionThreadGrp = m_bHaveArgOptionThreadGrp; - sStopPtInfo.m_strOptThrdGrp = m_strArgOptionThreadGrp; - sStopPtInfo.m_nTimes = m_brkPt.GetHitCount(); - sStopPtInfo.m_strOrigLoc = m_brkName; - sStopPtInfo.m_nIgnore = m_nBrkPtIgnoreCount; - sStopPtInfo.m_bPending = m_bBrkPtIsPending; - sStopPtInfo.m_bCondition = m_bBrkPtCondition; - sStopPtInfo.m_strCondition = m_brkPtCondition; - sStopPtInfo.m_bBrkPtThreadId = m_bBrkPtThreadId; - sStopPtInfo.m_nBrkPtThreadId = m_nBrkPtThreadId; - - bOk = bOk && rSessionInfo.RecordStopPtInfo(sStopPtInfo); + sStoppointInfo.m_bDisp = m_bBreakpointIsTemp; + sStoppointInfo.m_bEnabled = m_bBreakpointEnabled; + sStoppointInfo.m_bHaveArgOptionThreadGrp = m_bHaveArgOptionThreadGrp; + sStoppointInfo.m_strOptThrdGrp = m_strArgOptionThreadGrp; + sStoppointInfo.m_nTimes = m_breakpoint.GetHitCount(); + sStoppointInfo.m_strOrigLoc = m_brkName; + sStoppointInfo.m_nIgnore = m_nBreakpointIgnoreCount; + sStoppointInfo.m_bPending = m_bBreakpointIsPending; + sStoppointInfo.m_bCondition = m_bBreakpointCondition; + sStoppointInfo.m_strCondition = m_breakpointCondition; + sStoppointInfo.m_bBreakpointThreadId = m_bBreakpointThreadId; + sStoppointInfo.m_nBreakpointThreadId = m_nBreakpointThreadId; + + bOk = bOk && rSessionInfo.RecordStoppointInfo(sStoppointInfo); if (!bOk) { - SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), m_cmdData.strMiCmd.c_str(), m_brkName.c_str())); return MIstatus::failure; } - // CODETAG_LLDB_STOPPT_ID_MAX - if (sStopPtInfo.m_nMiId > rSessionInfo.m_nBrkPointCntMax) { + // CODETAG_LLDB_STOPPOINT_ID_MAX + if (sStoppointInfo.m_nMiId > rSessionInfo.m_nBreakpointCntMax) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_CNT_EXCEEDED), m_cmdData.strMiCmd.c_str(), - static_cast(rSessionInfo.m_nBrkPointCntMax), - static_cast(sStopPtInfo.m_nMiId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_CNT_EXCEEDED), m_cmdData.strMiCmd.c_str(), + static_cast(rSessionInfo.m_nBreakpointCntMax), + static_cast(sStoppointInfo.m_nMiId))); return MIstatus::failure; } @@ -337,16 +343,16 @@ bool CMICmdCmdBreakInsert::Acknowledge() { CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - MIuint nMiStopPtId = - CMICmnLLDBDebugSessionInfo::Instance().GetOrCreateMiStopPtId( - m_brkPt.GetID(), + MIuint nMiStoppointId = + CMICmnLLDBDebugSessionInfo::Instance().GetOrCreateMiStoppointId( + m_breakpoint.GetID(), CMICmnLLDBDebugSessionInfo::eStoppointType_Breakpoint); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(nMiStoppointId))); return MIstatus::failure; } @@ -355,7 +361,7 @@ bool CMICmdCmdBreakInsert::Acknowledge() { // PRIx64 // "\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",thread-groups=[\"%s\"],times=\"%d\",original-location=\"%s\"}" CMICmnMIValueTuple miValueTuple; - if (!rSessionInfo.MIResponseFormBrkPtInfo(sStopPtInfo, miValueTuple)) + if (!rSessionInfo.MIResponseFormBreakpointInfo(sStoppointInfo, miValueTuple)) return MIstatus::failure; const CMICmnMIValueResult miValueResultD("bkpt", miValueTuple); @@ -388,7 +394,7 @@ CMICmdBase *CMICmdCmdBreakInsert::CreateSelf() { // Throws: None. //-- CMICmdCmdBreakDelete::CMICmdCmdBreakDelete() - : m_constStrArgNamedBrkPt("breakpoint") { + : m_constStrArgNamedBreakpoint("breakpoint") { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "break-delete"; @@ -417,7 +423,7 @@ CMICmdCmdBreakDelete::~CMICmdCmdBreakDelete() {} //-- bool CMICmdCmdBreakDelete::ParseArgs() { m_setCmdArgs.Add( - new CMICmdArgValListOfN(m_constStrArgNamedBrkPt, true, true, + new CMICmdArgValListOfN(m_constStrArgNamedBreakpoint, true, true, CMICmdArgValListBase::eArgValType_Number)); return ParseValidateCmdOptions(); } @@ -434,42 +440,43 @@ bool CMICmdCmdBreakDelete::ParseArgs() { // Throws: None. //-- bool CMICmdCmdBreakDelete::Execute() { - CMICMDBASE_GETOPTION(pArgBrkPt, ListOfN, m_constStrArgNamedBrkPt); + CMICMDBASE_GETOPTION(pArgBreakpoint, ListOfN, m_constStrArgNamedBreakpoint); // ATM we only handle one break point ID - MIuint nMiStopPtId; - if (!pArgBrkPt->GetExpectedOption(nMiStopPtId)) { - SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), + MIuint nMiStoppointId; + if (!pArgBreakpoint->GetExpectedOption( + nMiStoppointId)) { + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), m_cmdData.strMiCmd.c_str(), - m_constStrArgNamedBrkPt.c_str())); + m_constStrArgNamedBreakpoint.c_str())); return MIstatus::failure; } CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(nMiStoppointId))); return MIstatus::failure; } bool bSuccess = false; lldb::SBTarget sbTarget = rSessionInfo.GetTarget(); - if (sStopPtInfo.m_eType == + if (sStoppointInfo.m_eType == CMICmnLLDBDebugSessionInfo::eStoppointType_Breakpoint) bSuccess = sbTarget.BreakpointDelete( - static_cast(sStopPtInfo.m_nLldbId)); + static_cast(sStoppointInfo.m_nLldbId)); else bSuccess = sbTarget.DeleteWatchpoint( - static_cast(sStopPtInfo.m_nLldbId)); + static_cast(sStoppointInfo.m_nLldbId)); if (!bSuccess) { - const CMIUtilString strBrkNum( - CMIUtilString::Format("%" PRIu64, static_cast(nMiStopPtId))); - SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), + const CMIUtilString strBrkNum(CMIUtilString::Format( + "%" PRIu64, static_cast(nMiStoppointId))); + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), m_cmdData.strMiCmd.c_str(), strBrkNum.c_str())); return MIstatus::failure; @@ -517,8 +524,8 @@ CMICmdBase *CMICmdCmdBreakDelete::CreateSelf() { // Throws: None. //-- CMICmdCmdBreakDisable::CMICmdCmdBreakDisable() - : m_constStrArgNamedBrkPt("breakpoint"), m_bBrkPtDisabledOk(false), - m_nMiStopPtId(0) { + : m_constStrArgNamedBreakpoint("breakpoint"), + m_bBreakpointDisabledOk(false), m_nMiStoppointId(0) { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "break-disable"; @@ -547,7 +554,7 @@ CMICmdCmdBreakDisable::~CMICmdCmdBreakDisable() {} //-- bool CMICmdCmdBreakDisable::ParseArgs() { m_setCmdArgs.Add( - new CMICmdArgValListOfN(m_constStrArgNamedBrkPt, true, true, + new CMICmdArgValListOfN(m_constStrArgNamedBreakpoint, true, true, CMICmdArgValListBase::eArgValType_Number)); return ParseValidateCmdOptions(); } @@ -564,45 +571,46 @@ bool CMICmdCmdBreakDisable::ParseArgs() { // Throws: None. //-- bool CMICmdCmdBreakDisable::Execute() { - CMICMDBASE_GETOPTION(pArgBrkPt, ListOfN, m_constStrArgNamedBrkPt); + CMICMDBASE_GETOPTION(pArgBreakpoint, ListOfN, m_constStrArgNamedBreakpoint); // ATM we only handle one break point ID - if (!pArgBrkPt->GetExpectedOption( - m_nMiStopPtId)) { - SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), + if (!pArgBreakpoint->GetExpectedOption( + m_nMiStoppointId)) { + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), m_cmdData.strMiCmd.c_str(), - m_constStrArgNamedBrkPt.c_str())); + m_constStrArgNamedBreakpoint.c_str())); return MIstatus::failure; } CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(m_nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(m_nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStoppointId))); return MIstatus::failure; } - auto disable = [&m_bBrkPtDisabledOk = m_bBrkPtDisabledOk](auto &vrPt) { + auto disable = [&m_bBreakpointDisabledOk = + m_bBreakpointDisabledOk](auto &vrPt) { if (vrPt.IsValid()) { - m_bBrkPtDisabledOk = true; + m_bBreakpointDisabledOk = true; vrPt.SetEnabled(false); } }; lldb::SBTarget sbTarget = rSessionInfo.GetTarget(); - if (sStopPtInfo.m_eType == + if (sStoppointInfo.m_eType == CMICmnLLDBDebugSessionInfo::eStoppointType_Breakpoint) { - lldb::SBBreakpoint brkPt = sbTarget.FindBreakpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - disable(brkPt); + lldb::SBBreakpoint breakpoint = sbTarget.FindBreakpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + disable(breakpoint); } else { - lldb::SBWatchpoint watchPt = sbTarget.FindWatchpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - disable(watchPt); + lldb::SBWatchpoint watchpoint = sbTarget.FindWatchpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + disable(watchpoint); } return MIstatus::success; @@ -619,17 +627,17 @@ bool CMICmdCmdBreakDisable::Execute() { // Throws: None. //-- bool CMICmdCmdBreakDisable::Acknowledge() { - if (m_bBrkPtDisabledOk) { + if (m_bBreakpointDisabledOk) { const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done); m_miResultRecord = miRecordResult; return MIstatus::success; } - const CMIUtilString strBrkPtId( - CMIUtilString::Format("%" PRIu64, static_cast(m_nMiStopPtId))); + const CMIUtilString strBreakpointId(CMIUtilString::Format( + "%" PRIu64, static_cast(m_nMiStoppointId))); const CMICmnMIValueConst miValueConst(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), strBrkPtId.c_str())); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), strBreakpointId.c_str())); const CMICmnMIValueResult miValueResult("msg", miValueConst); const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, @@ -660,8 +668,8 @@ CMICmdBase *CMICmdCmdBreakDisable::CreateSelf() { // Throws: None. //-- CMICmdCmdBreakEnable::CMICmdCmdBreakEnable() - : m_constStrArgNamedBrkPt("breakpoint"), m_bBrkPtEnabledOk(false), - m_nMiStopPtId(0) { + : m_constStrArgNamedBreakpoint("breakpoint"), m_bBreakpointEnabledOk(false), + m_nMiStoppointId(0) { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "break-enable"; @@ -690,7 +698,7 @@ CMICmdCmdBreakEnable::~CMICmdCmdBreakEnable() {} //-- bool CMICmdCmdBreakEnable::ParseArgs() { m_setCmdArgs.Add( - new CMICmdArgValListOfN(m_constStrArgNamedBrkPt, true, true, + new CMICmdArgValListOfN(m_constStrArgNamedBreakpoint, true, true, CMICmdArgValListBase::eArgValType_Number)); return ParseValidateCmdOptions(); } @@ -707,45 +715,45 @@ bool CMICmdCmdBreakEnable::ParseArgs() { // Throws: None. //-- bool CMICmdCmdBreakEnable::Execute() { - CMICMDBASE_GETOPTION(pArgBrkPt, ListOfN, m_constStrArgNamedBrkPt); + CMICMDBASE_GETOPTION(pArgBreakpoint, ListOfN, m_constStrArgNamedBreakpoint); // ATM we only handle one break point ID - if (!pArgBrkPt->GetExpectedOption( - m_nMiStopPtId)) { - SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), + if (!pArgBreakpoint->GetExpectedOption( + m_nMiStoppointId)) { + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), m_cmdData.strMiCmd.c_str(), - m_constStrArgNamedBrkPt.c_str())); + m_constStrArgNamedBreakpoint.c_str())); return MIstatus::failure; } CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(m_nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(m_nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStoppointId))); return MIstatus::failure; } - auto enable = [&m_bBrkPtEnabledOk = m_bBrkPtEnabledOk](auto &vrPt) { + auto enable = [&m_bBreakpointEnabledOk = m_bBreakpointEnabledOk](auto &vrPt) { if (vrPt.IsValid()) { - m_bBrkPtEnabledOk = true; + m_bBreakpointEnabledOk = true; vrPt.SetEnabled(true); } }; lldb::SBTarget sbTarget = rSessionInfo.GetTarget(); - if (sStopPtInfo.m_eType == + if (sStoppointInfo.m_eType == CMICmnLLDBDebugSessionInfo::eStoppointType_Breakpoint) { - lldb::SBBreakpoint brkPt = sbTarget.FindBreakpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - enable(brkPt); + lldb::SBBreakpoint breakpoint = sbTarget.FindBreakpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + enable(breakpoint); } else { - lldb::SBWatchpoint watchPt = sbTarget.FindWatchpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - enable(watchPt); + lldb::SBWatchpoint watchpoint = sbTarget.FindWatchpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + enable(watchpoint); } return MIstatus::success; @@ -762,17 +770,17 @@ bool CMICmdCmdBreakEnable::Execute() { // Throws: None. //-- bool CMICmdCmdBreakEnable::Acknowledge() { - if (m_bBrkPtEnabledOk) { + if (m_bBreakpointEnabledOk) { const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done); m_miResultRecord = miRecordResult; return MIstatus::success; } - const CMIUtilString strBrkPtId( - CMIUtilString::Format("%" PRIu64, static_cast(m_nMiStopPtId))); + const CMIUtilString strBreakpointId(CMIUtilString::Format( + "%" PRIu64, static_cast(m_nMiStoppointId))); const CMICmnMIValueConst miValueConst(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), strBrkPtId.c_str())); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), strBreakpointId.c_str())); const CMICmnMIValueResult miValueResult("msg", miValueConst); const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, @@ -804,7 +812,7 @@ CMICmdBase *CMICmdCmdBreakEnable::CreateSelf() { //-- CMICmdCmdBreakAfter::CMICmdCmdBreakAfter() : m_constStrArgNamedNumber("number"), m_constStrArgNamedCount("count"), - m_nMiStopPtId(0), m_nBrkPtCount(0) { + m_nMiStoppointId(0), m_nBreakpointCount(0) { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "break-after"; @@ -853,31 +861,31 @@ bool CMICmdCmdBreakAfter::Execute() { CMICMDBASE_GETOPTION(pArgNumber, Number, m_constStrArgNamedNumber); CMICMDBASE_GETOPTION(pArgCount, Number, m_constStrArgNamedCount); - m_nMiStopPtId = static_cast(pArgNumber->GetValue()); - m_nBrkPtCount = pArgCount->GetValue(); + m_nMiStoppointId = static_cast(pArgNumber->GetValue()); + m_nBreakpointCount = pArgCount->GetValue(); CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(m_nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(m_nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStoppointId))); return MIstatus::failure; } lldb::SBTarget sbTarget = rSessionInfo.GetTarget(); - if (sStopPtInfo.m_eType == + if (sStoppointInfo.m_eType == CMICmnLLDBDebugSessionInfo::eStoppointType_Breakpoint) { - lldb::SBBreakpoint brkPt = sbTarget.FindBreakpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - return SetIgnoreCount(rSessionInfo, brkPt); + lldb::SBBreakpoint breakpoint = sbTarget.FindBreakpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + return SetIgnoreCount(rSessionInfo, breakpoint); } - lldb::SBWatchpoint watchPt = sbTarget.FindWatchpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - return SetIgnoreCount(rSessionInfo, watchPt); + lldb::SBWatchpoint watchpoint = sbTarget.FindWatchpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + return SetIgnoreCount(rSessionInfo, watchpoint); } //++ @@ -920,17 +928,17 @@ CMICmdBase *CMICmdCmdBreakAfter::CreateSelf() { // MIstatus::failure - Functional failed. // Throws: None. //-- -bool CMICmdCmdBreakAfter::UpdateStopPtInfo( +bool CMICmdCmdBreakAfter::UpdateStoppointInfo( CMICmnLLDBDebugSessionInfo &rSessionInfo) { - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(m_nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(m_nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStoppointId))); return MIstatus::failure; } - sStopPtInfo.m_nIgnore = m_nBrkPtCount; - return rSessionInfo.RecordStopPtInfo(sStopPtInfo); + sStoppointInfo.m_nIgnore = m_nBreakpointCount; + return rSessionInfo.RecordStoppointInfo(sStoppointInfo); } //++ @@ -947,7 +955,7 @@ CMICmdCmdBreakCondition::CMICmdCmdBreakCondition() // need to handle expressions not // surrounded by quotes , - m_nMiStopPtId(0) { + m_nMiStoppointId(0) { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "break-condition"; @@ -1000,32 +1008,32 @@ bool CMICmdCmdBreakCondition::Execute() { CMICMDBASE_GETOPTION(pArgNumber, Number, m_constStrArgNamedNumber); CMICMDBASE_GETOPTION(pArgExpr, String, m_constStrArgNamedExpr); - m_nMiStopPtId = static_cast(pArgNumber->GetValue()); - m_strBrkPtExpr = pArgExpr->GetValue(); - m_strBrkPtExpr += GetRestOfExpressionNotSurroundedInQuotes(); + m_nMiStoppointId = static_cast(pArgNumber->GetValue()); + m_strBreakpointExpr = pArgExpr->GetValue(); + m_strBreakpointExpr += GetRestOfExpressionNotSurroundedInQuotes(); CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(m_nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(m_nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStoppointId))); return MIstatus::failure; } lldb::SBTarget sbTarget = rSessionInfo.GetTarget(); - if (sStopPtInfo.m_eType == + if (sStoppointInfo.m_eType == CMICmnLLDBDebugSessionInfo::eStoppointType_Breakpoint) { - lldb::SBBreakpoint brkPt = sbTarget.FindBreakpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - return SetCondition(rSessionInfo, brkPt); + lldb::SBBreakpoint breakpoint = sbTarget.FindBreakpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + return SetCondition(rSessionInfo, breakpoint); } - lldb::SBWatchpoint watchPt = sbTarget.FindWatchpointByID( - static_cast(sStopPtInfo.m_nLldbId)); - return SetCondition(rSessionInfo, watchPt); + lldb::SBWatchpoint watchpoint = sbTarget.FindWatchpointByID( + static_cast(sStoppointInfo.m_nLldbId)); + return SetCondition(rSessionInfo, watchpoint); } //++ @@ -1118,17 +1126,17 @@ CMICmdCmdBreakCondition::GetRestOfExpressionNotSurroundedInQuotes() { // MIstatus::failure - Functional failed. // Throws: None. //-- -bool CMICmdCmdBreakCondition::UpdateStopPtInfo( +bool CMICmdCmdBreakCondition::UpdateStoppointInfo( CMICmnLLDBDebugSessionInfo &rSessionInfo) { - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(m_nMiStopPtId, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(m_nMiStoppointId, sStoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND), - m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStopPtId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND), + m_cmdData.strMiCmd.c_str(), static_cast(m_nMiStoppointId))); return MIstatus::failure; } - sStopPtInfo.m_strCondition = m_strBrkPtExpr; - return rSessionInfo.RecordStopPtInfo(sStopPtInfo); + sStoppointInfo.m_strCondition = m_strBreakpointExpr; + return rSessionInfo.RecordStoppointInfo(sStoppointInfo); } // Details: CMICmdCmdBreakWatch constructor. @@ -1138,8 +1146,9 @@ bool CMICmdCmdBreakCondition::UpdateStopPtInfo( // Throws: None. //-- CMICmdCmdBreakWatch::CMICmdCmdBreakWatch() - : m_constStrArgNamedAccessWatchPt("a"), m_constStrArgNamedReadWatchPt("r"), - m_constStrArgNamedExpr("expr"), m_stopPtInfo(), m_watchPt() { + : m_constStrArgNamedAccessWatchpoint("a"), + m_constStrArgNamedReadWatchpoint("r"), m_constStrArgNamedExpr("expr"), + m_stoppointInfo(), m_watchpoint() { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "break-watch"; @@ -1157,10 +1166,10 @@ CMICmdCmdBreakWatch::CMICmdCmdBreakWatch() // Throws: None. //-- bool CMICmdCmdBreakWatch::ParseArgs() { - m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedAccessWatchPt, + m_setCmdArgs.Add(new CMICmdArgValOptionShort( + m_constStrArgNamedAccessWatchpoint, false, true)); + m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedReadWatchpoint, false, true)); - m_setCmdArgs.Add( - new CMICmdArgValOptionShort(m_constStrArgNamedReadWatchPt, false, true)); m_setCmdArgs.Add(new CMICmdArgValText(m_constStrArgNamedExpr, true, true)); return ParseValidateCmdOptions(); } @@ -1251,8 +1260,8 @@ static bool FindAddressByExpressionEvaluation(lldb::SBTarget &rSbTarget, //-- bool CMICmdCmdBreakWatch::Execute() { CMICMDBASE_GETOPTION(pArgAccess, OptionShort, - m_constStrArgNamedAccessWatchPt); - CMICMDBASE_GETOPTION(pArgRead, OptionShort, m_constStrArgNamedReadWatchPt); + m_constStrArgNamedAccessWatchpoint); + CMICMDBASE_GETOPTION(pArgRead, OptionShort, m_constStrArgNamedReadWatchpoint); CMICMDBASE_GETOPTION(pArgExpr, Text, m_constStrArgNamedExpr); // Ask LLDB for the target to check if we have valid or dummy one. @@ -1291,9 +1300,9 @@ bool CMICmdCmdBreakWatch::Execute() { bool write = !pArgRead->GetFound(); lldb::SBError sbError; - m_watchPt = sbTarget.WatchAddress(address, size, read, write, sbError); + m_watchpoint = sbTarget.WatchAddress(address, size, read, write, sbError); - if (!m_watchPt) { + if (!m_watchpoint) { const char *type = "write"; if (pArgAccess->GetFound()) type = "access"; @@ -1301,37 +1310,38 @@ bool CMICmdCmdBreakWatch::Execute() { type = "read"; SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_CREATE_WATCHPT), m_cmdData.strMiCmd.c_str(), type, + MIRSRC(IDS_CMD_ERR_CREATE_WATCHPOINT), m_cmdData.strMiCmd.c_str(), type, static_cast(address), static_cast(size))); return MIstatus::failure; } - if (!rSessionInfo.GetStopPtInfo(m_watchPt, m_stopPtInfo)) { + if (!rSessionInfo.GetStoppointInfo(m_watchpoint, m_stoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_WATCHPT_STOPPT_INFO_CREATE), - m_cmdData.strMiCmd.c_str(), static_cast(m_watchPt.GetID()))); + MIRSRC(IDS_CMD_ERR_WATCHPOINT_STOPPOINT_INFO_CREATE), + m_cmdData.strMiCmd.c_str(), + static_cast(m_watchpoint.GetID()))); return MIstatus::failure; } - m_stopPtInfo.m_bDisp = false; - m_stopPtInfo.m_bEnabled = m_watchPt.IsEnabled(); - m_stopPtInfo.m_bHaveArgOptionThreadGrp = false; - m_stopPtInfo.m_nTimes = m_watchPt.GetHitCount(); - m_stopPtInfo.m_watchPtVariable = isVariable; - m_stopPtInfo.m_watchPtExpr = expression; - m_stopPtInfo.m_watchPtRead = read; - m_stopPtInfo.m_watchPtWrite = write; - m_stopPtInfo.m_nIgnore = m_watchPt.GetIgnoreCount(); - m_stopPtInfo.m_bPending = false; - m_stopPtInfo.m_bCondition = m_watchPt.GetCondition() != nullptr; - m_stopPtInfo.m_strCondition = - m_stopPtInfo.m_bCondition ? m_watchPt.GetCondition() : ""; - m_stopPtInfo.m_bBrkPtThreadId = false; - - if (!rSessionInfo.RecordStopPtInfo(m_stopPtInfo)) { + m_stoppointInfo.m_bDisp = false; + m_stoppointInfo.m_bEnabled = m_watchpoint.IsEnabled(); + m_stoppointInfo.m_bHaveArgOptionThreadGrp = false; + m_stoppointInfo.m_nTimes = m_watchpoint.GetHitCount(); + m_stoppointInfo.m_watchpointVariable = isVariable; + m_stoppointInfo.m_watchpointExpr = expression; + m_stoppointInfo.m_watchpointRead = read; + m_stoppointInfo.m_watchpointWrite = write; + m_stoppointInfo.m_nIgnore = m_watchpoint.GetIgnoreCount(); + m_stoppointInfo.m_bPending = false; + m_stoppointInfo.m_bCondition = m_watchpoint.GetCondition() != nullptr; + m_stoppointInfo.m_strCondition = + m_stoppointInfo.m_bCondition ? m_watchpoint.GetCondition() : ""; + m_stoppointInfo.m_bBreakpointThreadId = false; + + if (!rSessionInfo.RecordStoppointInfo(m_stoppointInfo)) { SetError(CMIUtilString::Format( - MIRSRC(IDS_CMD_ERR_STOPPT_INFO_SET), m_cmdData.strMiCmd.c_str(), - static_cast(m_stopPtInfo.m_nMiId))); + MIRSRC(IDS_CMD_ERR_STOPPOINT_INFO_SET), m_cmdData.strMiCmd.c_str(), + static_cast(m_stoppointInfo.m_nMiId))); return MIstatus::failure; } @@ -1348,11 +1358,11 @@ bool CMICmdCmdBreakWatch::Execute() { // Throws: None. //-- bool CMICmdCmdBreakWatch::Acknowledge() { - assert(m_watchPt.IsValid()); + assert(m_watchpoint.IsValid()); CMICmnMIValueResult miValueResult; - CMICmnLLDBDebugSessionInfo::Instance().MIResponseFormWatchPtInfo( - m_stopPtInfo, miValueResult); + CMICmnLLDBDebugSessionInfo::Instance().MIResponseFormWatchpointInfo( + m_stoppointInfo, miValueResult); const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, diff --git a/src/MICmdCmdBreak.h b/src/MICmdCmdBreak.h index 83b16eb..c65a2e2 100644 --- a/src/MICmdCmdBreak.h +++ b/src/MICmdCmdBreak.h @@ -77,26 +77,27 @@ class CMICmdCmdBreakInsert : public CMICmdBase { // Attributes: private: - bool m_bBrkPtIsTemp; + bool m_bBreakpointIsTemp; bool m_bHaveArgOptionThreadGrp; CMIUtilString m_brkName; CMIUtilString m_strArgOptionThreadGrp; - lldb::SBBreakpoint m_brkPt; - bool m_bBrkPtIsPending; - MIuint m_nBrkPtIgnoreCount; - bool m_bBrkPtEnabled; - bool m_bBrkPtCondition; - CMIUtilString m_brkPtCondition; - bool m_bBrkPtThreadId; - MIuint m_nBrkPtThreadId; - const CMIUtilString m_constStrArgNamedTempBrkPt; - const CMIUtilString m_constStrArgNamedHWBrkPt; // Not handled by *this command - const CMIUtilString m_constStrArgNamedPendinfBrkPt; - const CMIUtilString m_constStrArgNamedDisableBrkPt; + lldb::SBBreakpoint m_breakpoint; + bool m_bBreakpointIsPending; + MIuint m_nBreakpointIgnoreCount; + bool m_bBreakpointEnabled; + bool m_bBreakpointCondition; + CMIUtilString m_breakpointCondition; + bool m_bBreakpointThreadId; + MIuint m_nBreakpointThreadId; + const CMIUtilString m_constStrArgNamedTempBreakpoint; + const CMIUtilString + m_constStrArgNamedHWBreakpoint; // Not handled by *this command + const CMIUtilString m_constStrArgNamedPendinfBreakpoint; + const CMIUtilString m_constStrArgNamedDisableBreakpoint; const CMIUtilString m_constStrArgNamedTracePt; // Not handled by *this command - const CMIUtilString m_constStrArgNamedConditionalBrkPt; + const CMIUtilString m_constStrArgNamedConditionalBreakpoint; const CMIUtilString m_constStrArgNamedInoreCnt; - const CMIUtilString m_constStrArgNamedRestrictBrkPtToThreadId; + const CMIUtilString m_constStrArgNamedRestrictBreakpointToThreadId; const CMIUtilString m_constStrArgNamedLocation; }; @@ -126,7 +127,7 @@ class CMICmdCmdBreakDelete : public CMICmdBase { // Attributes: private: - const CMIUtilString m_constStrArgNamedBrkPt; + const CMIUtilString m_constStrArgNamedBreakpoint; }; //++ @@ -155,9 +156,9 @@ class CMICmdCmdBreakDisable : public CMICmdBase { // Attributes: private: - const CMIUtilString m_constStrArgNamedBrkPt; - bool m_bBrkPtDisabledOk; - MIuint m_nMiStopPtId; + const CMIUtilString m_constStrArgNamedBreakpoint; + bool m_bBreakpointDisabledOk; + MIuint m_nMiStoppointId; }; //++ @@ -186,9 +187,9 @@ class CMICmdCmdBreakEnable : public CMICmdBase { // Attributes: private: - const CMIUtilString m_constStrArgNamedBrkPt; - bool m_bBrkPtEnabledOk; - MIuint m_nMiStopPtId; + const CMIUtilString m_constStrArgNamedBreakpoint; + bool m_bBreakpointEnabledOk; + MIuint m_nMiStoppointId; }; //++ @@ -217,29 +218,30 @@ class CMICmdCmdBreakAfter : public CMICmdBase { // Methods: private: - bool UpdateStopPtInfo(CMICmnLLDBDebugSessionInfo &rSessionInfo); + bool UpdateStoppointInfo(CMICmnLLDBDebugSessionInfo &rSessionInfo); template - bool SetIgnoreCount(CMICmnLLDBDebugSessionInfo &rSessionInfo, T &vrStopPt) { - if (!vrStopPt.IsValid()) { - const CMIUtilString strBrkPtId(CMIUtilString::Format( - "%" PRIu64, static_cast(m_nMiStopPtId))); - SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), + bool SetIgnoreCount(CMICmnLLDBDebugSessionInfo &rSessionInfo, + T &vrStoppoint) { + if (!vrStoppoint.IsValid()) { + const CMIUtilString strBreakpointId(CMIUtilString::Format( + "%" PRIu64, static_cast(m_nMiStoppointId))); + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), m_cmdData.strMiCmd.c_str(), - strBrkPtId.c_str())); + strBreakpointId.c_str())); return MIstatus::failure; } - vrStopPt.SetIgnoreCount(m_nBrkPtCount); + vrStoppoint.SetIgnoreCount(m_nBreakpointCount); - return UpdateStopPtInfo(rSessionInfo); + return UpdateStoppointInfo(rSessionInfo); } // Attributes: private: const CMIUtilString m_constStrArgNamedNumber; const CMIUtilString m_constStrArgNamedCount; - MIuint m_nMiStopPtId; - MIuint m_nBrkPtCount; + MIuint m_nMiStoppointId; + MIuint m_nBreakpointCount; }; //++ @@ -269,21 +271,21 @@ class CMICmdCmdBreakCondition : public CMICmdBase { // Methods: private: CMIUtilString GetRestOfExpressionNotSurroundedInQuotes(); - bool UpdateStopPtInfo(CMICmnLLDBDebugSessionInfo &rSessionInfo); + bool UpdateStoppointInfo(CMICmnLLDBDebugSessionInfo &rSessionInfo); template - bool SetCondition(CMICmnLLDBDebugSessionInfo &rSessionInfo, T &vrStopPt) { - if (!vrStopPt.IsValid()) { - const CMIUtilString strBrkPtId(CMIUtilString::Format( - "%" PRIu64, static_cast(m_nMiStopPtId))); - SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPT_INVALID), + bool SetCondition(CMICmnLLDBDebugSessionInfo &rSessionInfo, T &vrStoppoint) { + if (!vrStoppoint.IsValid()) { + const CMIUtilString strBreakpointId(CMIUtilString::Format( + "%" PRIu64, static_cast(m_nMiStoppointId))); + SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_STOPPOINT_INVALID), m_cmdData.strMiCmd.c_str(), - strBrkPtId.c_str())); + strBreakpointId.c_str())); return MIstatus::failure; } - vrStopPt.SetCondition(m_strBrkPtExpr.c_str()); + vrStoppoint.SetCondition(m_strBreakpointExpr.c_str()); - return UpdateStopPtInfo(rSessionInfo); + return UpdateStoppointInfo(rSessionInfo); } // Attributes: @@ -294,8 +296,8 @@ class CMICmdCmdBreakCondition : public CMICmdBase { // spec, we need to handle // expressions not // surrounded by quotes - MIuint m_nMiStopPtId; - CMIUtilString m_strBrkPtExpr; + MIuint m_nMiStoppointId; + CMIUtilString m_strBreakpointExpr; }; //++ @@ -326,10 +328,10 @@ class CMICmdCmdBreakWatch : public CMICmdBase { private: // Attributes: private: - const CMIUtilString m_constStrArgNamedAccessWatchPt; - const CMIUtilString m_constStrArgNamedReadWatchPt; + const CMIUtilString m_constStrArgNamedAccessWatchpoint; + const CMIUtilString m_constStrArgNamedReadWatchpoint; const CMIUtilString m_constStrArgNamedExpr; - CMICmnLLDBDebugSessionInfo::SStopPtInfo m_stopPtInfo; - lldb::SBWatchpoint m_watchPt; + CMICmnLLDBDebugSessionInfo::SStoppointInfo m_stoppointInfo; + lldb::SBWatchpoint m_watchpoint; }; diff --git a/src/MICmnLLDBDebugSessionInfo.cpp b/src/MICmnLLDBDebugSessionInfo.cpp index d03317b..731bf6b 100644 --- a/src/MICmnLLDBDebugSessionInfo.cpp +++ b/src/MICmnLLDBDebugSessionInfo.cpp @@ -45,14 +45,14 @@ // Throws: None. //-- CMICmnLLDBDebugSessionInfo::CMICmnLLDBDebugSessionInfo() - : m_nBrkPointCntMax(INT32_MAX), + : m_nBreakpointCntMax(INT32_MAX), m_currentSelectedThread(LLDB_INVALID_THREAD_ID), m_constStrSharedDataKeyWkDir("Working Directory"), m_constStrSharedDataSolibPath("Solib Path"), m_constStrPrintCharArrayAsString("Print CharArrayAsString"), m_constStrPrintExpandAggregates("Print ExpandAggregates"), m_constStrPrintAggregateFieldNames("Print AggregateFieldNames"), - m_bCreateTty(false), m_nNextMiStopPtId(1UL) {} + m_bCreateTty(false), m_nNextMiStoppointId(1UL) {} //++ // Details: CMICmnLLDBDebugSessionInfo destructor. @@ -129,23 +129,24 @@ bool CMICmnLLDBDebugSessionInfo::Shutdown() { void CMICmnLLDBDebugSessionInfo::SharedDataDestroy() { m_mapIdToSessionData.Clear(); m_vecVarObj.clear(); - m_mapMiStopPtIdToStopPtInfo.clear(); - m_mapLldbStopPtIdToMiStopPtId.clear(); + m_mapMiStoppointIdToStoppointInfo.clear(); + m_mapLldbStoppointIdToMiStoppointId.clear(); } //++ // Details: Record information about a LLDB stop point so that is can // be recalled in other commands or LLDB event handling functions. // Type: Method. -// Args: vrStopPtInfo - (R) Break point information object. +// Args: vrStoppointInfo - (R) Break point information object. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- -bool CMICmnLLDBDebugSessionInfo::RecordStopPtInfo( - const SStopPtInfo &vrStopPtInfo) { - MapPairMiStopPtIdToStopPtInfo_t pr(vrStopPtInfo.m_nMiId, vrStopPtInfo); - m_mapMiStopPtIdToStopPtInfo.insert(pr); +bool CMICmnLLDBDebugSessionInfo::RecordStoppointInfo( + const SStoppointInfo &vrStoppointInfo) { + MapPairMiStoppointIdToStoppointInfo_t pr(vrStoppointInfo.m_nMiId, + vrStoppointInfo); + m_mapMiStoppointIdToStoppointInfo.insert(pr); return MIstatus::success; } @@ -154,18 +155,18 @@ bool CMICmnLLDBDebugSessionInfo::RecordStopPtInfo( // Details: Retrieve information about a LLDB stop point previous // recorded either by commands or LLDB event handling functions. // Type: Method. -// Args: vnMiStopPtId - (R) MI stoppoint ID. -// vrwStopPtInfo - (W) Stoppoint information object. +// Args: vnMiStoppointId - (R) Mi stoppoint ID. +// vrwStoppointInfo - (W) Stoppoint information object. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- -bool CMICmnLLDBDebugSessionInfo::RecordStopPtInfoGet( - const MIuint vnMiStopPtId, SStopPtInfo &vrwStopPtInfo) const { - const MapMiStopPtIdToStopPtInfo_t::const_iterator it = - m_mapMiStopPtIdToStopPtInfo.find(vnMiStopPtId); - if (it != m_mapMiStopPtIdToStopPtInfo.end()) { - vrwStopPtInfo = (*it).second; +bool CMICmnLLDBDebugSessionInfo::RecordStoppointInfoGet( + const MIuint vnMiStoppointId, SStoppointInfo &vrwStoppointInfo) const { + const MapMiStoppointIdToStoppointInfo_t::const_iterator it = + m_mapMiStoppointIdToStoppointInfo.find(vnMiStoppointId); + if (it != m_mapMiStoppointIdToStoppointInfo.end()) { + vrwStoppointInfo = (*it).second; return MIstatus::success; } @@ -177,17 +178,17 @@ bool CMICmnLLDBDebugSessionInfo::RecordStopPtInfoGet( // object. This function should be called when a LLDB stop // point is deleted. // Type: Method. -// Args: vnMiStopPtId - (R) MI stoppoint ID. +// Args: vnMiStoppointId - (R) Mi stoppoint ID. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- -bool CMICmnLLDBDebugSessionInfo::RecordStopPtInfoDelete( - const MIuint vnMiStopPtId) { - const MapMiStopPtIdToStopPtInfo_t::const_iterator it = - m_mapMiStopPtIdToStopPtInfo.find(vnMiStopPtId); - if (it != m_mapMiStopPtIdToStopPtInfo.end()) { - m_mapMiStopPtIdToStopPtInfo.erase(it); +bool CMICmnLLDBDebugSessionInfo::RecordStoppointInfoDelete( + const MIuint vnMiStoppointId) { + const MapMiStoppointIdToStoppointInfo_t::const_iterator it = + m_mapMiStoppointIdToStoppointInfo.find(vnMiStoppointId); + if (it != m_mapMiStoppointIdToStoppointInfo.end()) { + m_mapMiStoppointIdToStoppointInfo.erase(it); return MIstatus::success; } @@ -198,23 +199,24 @@ bool CMICmnLLDBDebugSessionInfo::RecordStopPtInfoDelete( // Details: Get an existing MI stoppoint ID for the given LLDB break // or watch point ID and type or create new. // Type: Method. -// Args: vnLldbStopPtId - (R) LLDB stop point ID. -// veStopPtType - (R) The type of the stoppoint. +// Args: vnLldbStoppointId - (R) LLDB stop point ID. +// veStoppointType - (R) The type of the stoppoint. // Return: An MI stoppoint ID corresponding to the given break or // watchpoint ID. // Throws: None. //-- -MIuint CMICmnLLDBDebugSessionInfo::GetOrCreateMiStopPtId( - const MIuint vnLldbStopPtId, const StoppointType_e veStopPtType) { - auto key = std::make_pair(vnLldbStopPtId, veStopPtType); +MIuint CMICmnLLDBDebugSessionInfo::GetOrCreateMiStoppointId( + const MIuint vnLldbStoppointId, const StoppointType_e veStoppointType) { + auto key = std::make_pair(vnLldbStoppointId, veStoppointType); - std::lock_guard miStopPtIdsLock(m_miStopPtIdsMutex); - auto found = m_mapLldbStopPtIdToMiStopPtId.find(key); - if (found != m_mapLldbStopPtIdToMiStopPtId.end()) + std::lock_guard miStoppointIdsLock(m_miStoppointIdsMutex); + auto found = m_mapLldbStoppointIdToMiStoppointId.find(key); + if (found != m_mapLldbStoppointIdToMiStoppointId.end()) return found->second; - auto nNewId = m_nNextMiStopPtId++; - auto emplacementStatus = m_mapLldbStopPtIdToMiStopPtId.emplace(key, nNewId); + auto nNewId = m_nNextMiStoppointId++; + auto emplacementStatus = + m_mapLldbStoppointIdToMiStoppointId.emplace(key, nNewId); assert(emplacementStatus.second); return nNewId; @@ -224,18 +226,18 @@ MIuint CMICmnLLDBDebugSessionInfo::GetOrCreateMiStopPtId( // Details: Remove the stored connection between LLDB stoppoint ID // and MI stoppoint ID. // Type: Method. -// Args: vnLldbStopPtId - (R) LLDB stop point ID. -// veStopPtType - (R) The type of the stoppoint. +// Args: vnLldbStoppointId - (R) LLDB stop point ID. +// veStoppointType - (R) The type of the stoppoint. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- -bool CMICmnLLDBDebugSessionInfo::RemoveLldbToMiStopPtIdMapping( - const MIuint vnLldbStopPtId, const StoppointType_e veStopPtType) { - auto key = std::make_pair(vnLldbStopPtId, veStopPtType); +bool CMICmnLLDBDebugSessionInfo::RemoveLldbToMiStoppointIdMapping( + const MIuint vnLldbStoppointId, const StoppointType_e veStoppointType) { + auto key = std::make_pair(vnLldbStoppointId, veStoppointType); - std::lock_guard miStopPtIdsLock(m_miStopPtIdsMutex); - auto erased = m_mapLldbStopPtIdToMiStopPtId.erase(key); + std::lock_guard miStoppointIdsLock(m_miStoppointIdsMutex); + auto erased = m_mapLldbStoppointIdToMiStoppointId.erase(key); return erased == 1 ? MIstatus::success : MIstatus::failure; } @@ -704,31 +706,33 @@ bool CMICmnLLDBDebugSessionInfo::GetFrameInfo( // the // tuple type object past in. // Type: Method. -// Args: vrStopPtInfo - (R) Break point information object. +// Args: vrStoppointInfo - (R) Break point information object. // vwrMIValueTuple - (W) MI value tuple object. // Return: None. // Throws: None. //-- -void CMICmnLLDBDebugSessionInfo::MIResponseFormStopPtFrameInfo( - const SStopPtInfo &vrStopPtInfo, CMICmnMIValueTuple &vwrMiValueTuple) { +void CMICmnLLDBDebugSessionInfo::MIResponseFormStoppointFrameInfo( + const SStoppointInfo &vrStoppointInfo, + CMICmnMIValueTuple &vwrMiValueTuple) { const CMIUtilString strAddr( - CMIUtilString::Format("0x%016" PRIx64, vrStopPtInfo.m_addr)); + CMIUtilString::Format("0x%016" PRIx64, vrStoppointInfo.m_addr)); const CMICmnMIValueConst miValueConst2(strAddr); const CMICmnMIValueResult miValueResult2("addr", miValueConst2); vwrMiValueTuple.Add(miValueResult2); - const CMICmnMIValueConst miValueConst3(vrStopPtInfo.m_fnName); + const CMICmnMIValueConst miValueConst3(vrStoppointInfo.m_fnName); const CMICmnMIValueResult miValueResult3("func", miValueConst3); vwrMiValueTuple.Add(miValueResult3); - const CMICmnMIValueConst miValueConst5(vrStopPtInfo.m_fileName); + const CMICmnMIValueConst miValueConst5(vrStoppointInfo.m_fileName); const CMICmnMIValueResult miValueResult5("file", miValueConst5); vwrMiValueTuple.Add(miValueResult5); - const CMIUtilString strN5 = CMIUtilString::Format( - "%s/%s", vrStopPtInfo.m_path.c_str(), vrStopPtInfo.m_fileName.c_str()); + const CMIUtilString strN5 = + CMIUtilString::Format("%s/%s", vrStoppointInfo.m_path.c_str(), + vrStoppointInfo.m_fileName.c_str()); const CMICmnMIValueConst miValueConst6(strN5); const CMICmnMIValueResult miValueResult6("fullname", miValueConst6); vwrMiValueTuple.Add(miValueResult6); const CMIUtilString strLine( - CMIUtilString::Format("%d", vrStopPtInfo.m_nLine)); + CMIUtilString::Format("%d", vrStoppointInfo.m_nLine)); const CMICmnMIValueConst miValueConst7(strLine); const CMICmnMIValueResult miValueResult7("line", miValueConst7); vwrMiValueTuple.Add(miValueResult7); @@ -739,14 +743,15 @@ void CMICmnLLDBDebugSessionInfo::MIResponseFormStopPtFrameInfo( // the // tuple type object past in. // Type: Method. -// Args: vrStopPtInfo - (R) Break point information object. +// Args: vrStoppointInfo - (R) Break point information object. // vwrMIValueTuple - (W) MI value tuple object. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- -bool CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtInfo( - const SStopPtInfo &vrStopPtInfo, CMICmnMIValueTuple &vwrMiValueTuple) { +bool CMICmnLLDBDebugSessionInfo::MIResponseFormBreakpointInfo( + const SStoppointInfo &vrStoppointInfo, + CMICmnMIValueTuple &vwrMiValueTuple) { // MI print // "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016" // PRIx64 "\", @@ -755,76 +760,78 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtInfo( // "number=" const CMICmnMIValueConst miValueConst(CMIUtilString::Format( - "%" PRIu64, static_cast(vrStopPtInfo.m_nMiId))); + "%" PRIu64, static_cast(vrStoppointInfo.m_nMiId))); const CMICmnMIValueResult miValueResult("number", miValueConst); CMICmnMIValueTuple miValueTuple(miValueResult); // "type=" const CMICmnMIValueConst miValueConst2( - vrStopPtInfo.m_eType == eStoppointType_Breakpoint ? "breakpoint" - : "watchpoint"); + vrStoppointInfo.m_eType == eStoppointType_Breakpoint ? "breakpoint" + : "watchpoint"); const CMICmnMIValueResult miValueResult2("type", miValueConst2); miValueTuple.Add(miValueResult2); // "disp=" - const CMICmnMIValueConst miValueConst3(vrStopPtInfo.m_bDisp ? "del" : "keep"); + const CMICmnMIValueConst miValueConst3(vrStoppointInfo.m_bDisp ? "del" + : "keep"); const CMICmnMIValueResult miValueResult3("disp", miValueConst3); miValueTuple.Add(miValueResult3); // "enabled=" - const CMICmnMIValueConst miValueConst4(vrStopPtInfo.m_bEnabled ? "y" : "n"); + const CMICmnMIValueConst miValueConst4(vrStoppointInfo.m_bEnabled ? "y" + : "n"); const CMICmnMIValueResult miValueResult4("enabled", miValueConst4); miValueTuple.Add(miValueResult4); // "pending=" - if (vrStopPtInfo.m_bPending) { - const CMICmnMIValueConst miValueConst(vrStopPtInfo.m_strOrigLoc); + if (vrStoppointInfo.m_bPending) { + const CMICmnMIValueConst miValueConst(vrStoppointInfo.m_strOrigLoc); const CMICmnMIValueList miValueList(miValueConst); const CMICmnMIValueResult miValueResult("pending", miValueList); miValueTuple.Add(miValueResult); } - if (vrStopPtInfo.m_bHaveArgOptionThreadGrp) { - const CMICmnMIValueConst miValueConst(vrStopPtInfo.m_strOptThrdGrp); + if (vrStoppointInfo.m_bHaveArgOptionThreadGrp) { + const CMICmnMIValueConst miValueConst(vrStoppointInfo.m_strOptThrdGrp); const CMICmnMIValueList miValueList(miValueConst); const CMICmnMIValueResult miValueResult("thread-groups", miValueList); miValueTuple.Add(miValueResult); } // "times=" const CMICmnMIValueConst miValueConstB( - CMIUtilString::Format("%d", vrStopPtInfo.m_nTimes)); + CMIUtilString::Format("%d", vrStoppointInfo.m_nTimes)); const CMICmnMIValueResult miValueResultB("times", miValueConstB); miValueTuple.Add(miValueResultB); // "thread=" - if (vrStopPtInfo.m_bBrkPtThreadId) { + if (vrStoppointInfo.m_bBreakpointThreadId) { const CMICmnMIValueConst miValueConst( - CMIUtilString::Format("%d", vrStopPtInfo.m_nBrkPtThreadId)); + CMIUtilString::Format("%d", vrStoppointInfo.m_nBreakpointThreadId)); const CMICmnMIValueResult miValueResult("thread", miValueConst); miValueTuple.Add(miValueResult); } // "cond=" - if (vrStopPtInfo.m_bCondition) { - const CMICmnMIValueConst miValueConst(vrStopPtInfo.m_strCondition); + if (vrStoppointInfo.m_bCondition) { + const CMICmnMIValueConst miValueConst(vrStoppointInfo.m_strCondition); const CMICmnMIValueResult miValueResult("cond", miValueConst); miValueTuple.Add(miValueResult); } // "ignore=" - if (vrStopPtInfo.m_nIgnore != 0) { + if (vrStoppointInfo.m_nIgnore != 0) { const CMICmnMIValueConst miValueConst( - CMIUtilString::Format("%d", vrStopPtInfo.m_nIgnore)); + CMIUtilString::Format("%d", vrStoppointInfo.m_nIgnore)); const CMICmnMIValueResult miValueResult("ignore", miValueConst); miValueTuple.Add(miValueResult); } - if (vrStopPtInfo.m_eType == eStoppointType_Breakpoint) { + if (vrStoppointInfo.m_eType == eStoppointType_Breakpoint) { // "addr=" // "func=" // "file=" // "fullname=" // "line=" - MIResponseFormStopPtFrameInfo(vrStopPtInfo, miValueTuple); + MIResponseFormStoppointFrameInfo(vrStoppointInfo, miValueTuple); // "original-location=" - const CMICmnMIValueConst miValueConstC(vrStopPtInfo.m_strOrigLoc); + const CMICmnMIValueConst miValueConstC(vrStoppointInfo.m_strOrigLoc); const CMICmnMIValueResult miValueResultC("original-location", miValueConstC); miValueTuple.Add(miValueResultC); } else { // "what=" - const CMICmnMIValueConst miValueConstWhat(vrStopPtInfo.m_watchPtExpr); + const CMICmnMIValueConst miValueConstWhat(vrStoppointInfo.m_watchpointExpr); const CMICmnMIValueResult miValueResultWhat("what", miValueConstWhat); miValueTuple.Add(miValueResultWhat); } @@ -838,22 +845,23 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtInfo( // Details: Form MI wpt={number=...,exp="..."} response by the given // breakpoint info object. // Type: Method. -// Args: vrStopPtInfo - (R) Break (and watch) point information object. +// Args: vrStoppointInfo - (R) Break (and watch) point information object. // vwrMiValueResult - (W) Where to store wpt={} representation. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- -void CMICmnLLDBDebugSessionInfo::MIResponseFormWatchPtInfo( - const SStopPtInfo &vrStopPtInfo, CMICmnMIValueResult &vwrMiValueResult) { +void CMICmnLLDBDebugSessionInfo::MIResponseFormWatchpointInfo( + const SStoppointInfo &vrStoppointInfo, + CMICmnMIValueResult &vwrMiValueResult) { // "number=" const CMICmnMIValueConst miValueConstNumber(CMIUtilString::Format( - "%" PRIu64, static_cast(vrStopPtInfo.m_nMiId))); + "%" PRIu64, static_cast(vrStoppointInfo.m_nMiId))); const CMICmnMIValueResult miValueResultNumber("number", miValueConstNumber); CMICmnMIValueTuple miValueTuple(miValueResultNumber); // "exp=" - const CMICmnMIValueConst miValueConstExp(vrStopPtInfo.m_watchPtExpr); + const CMICmnMIValueConst miValueConstExp(vrStoppointInfo.m_watchpointExpr); const CMICmnMIValueResult miValueResultExp("exp", miValueConstExp); miValueTuple.Add(miValueResultExp); @@ -863,19 +871,19 @@ void CMICmnLLDBDebugSessionInfo::MIResponseFormWatchPtInfo( template static lldb::SBAddress GetBreakOrWatchPointAddress(lldb::SBTarget &vrTarget, - T &vrStopPt); + T &vrStoppoint); template <> lldb::SBAddress GetBreakOrWatchPointAddress(lldb::SBTarget &vrTarget, - lldb::SBBreakpoint &vrStopPt) { - lldb::SBBreakpointLocation brkPtLoc = vrStopPt.GetLocationAtIndex(0); - return brkPtLoc.GetAddress(); + lldb::SBBreakpoint &vrStoppoint) { + lldb::SBBreakpointLocation breakpointLoc = vrStoppoint.GetLocationAtIndex(0); + return breakpointLoc.GetAddress(); } template <> lldb::SBAddress GetBreakOrWatchPointAddress(lldb::SBTarget &vrTarget, - lldb::SBWatchpoint &vrStopPt) { - return lldb::SBAddress(vrStopPt.GetWatchAddress(), vrTarget); + lldb::SBWatchpoint &vrStoppoint) { + return lldb::SBAddress(vrStoppoint.GetWatchAddress(), vrTarget); } //++ @@ -885,20 +893,21 @@ lldb::SBAddress GetBreakOrWatchPointAddress(lldb::SBTarget &vrTarget, // information after calling this function. Mainly breakpoint location // information of information that is unlikely to change. // Type: Method. -// Args: vBrkPt - (R) LLDB break point object. -// vrwStopPtInfo - (W) Break point information object. +// Args: vBreakpoint - (R) LLDB break point object. +// vrwStoppointInfo - (W) Break point information object. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- template <> -bool CMICmnLLDBDebugSessionInfo::GetStopPtInfo(const lldb::SBBreakpoint &vBrkPt, - SStopPtInfo &vrwStopPtInfo) { - lldb::SBBreakpoint &rBrkPt = const_cast(vBrkPt); - lldb::SBBreakpointLocation brkPtLoc = rBrkPt.GetLocationAtIndex(0); - lldb::SBAddress brkPtAddr = brkPtLoc.GetAddress(); +bool CMICmnLLDBDebugSessionInfo::GetStoppointInfo( + const lldb::SBBreakpoint &vBreakpoint, SStoppointInfo &vrwStoppointInfo) { + lldb::SBBreakpoint &rBreakpoint = + const_cast(vBreakpoint); + lldb::SBBreakpointLocation breakpointLoc = rBreakpoint.GetLocationAtIndex(0); + lldb::SBAddress breakpointAddr = breakpointLoc.GetAddress(); lldb::SBSymbolContext symbolCntxt = - brkPtAddr.GetSymbolContext(lldb::eSymbolContextEverything); + breakpointAddr.GetSymbolContext(lldb::eSymbolContextEverything); const char *pUnkwn = "??"; lldb::SBModule rModule = symbolCntxt.GetModule(); const char *pModule = @@ -908,9 +917,9 @@ bool CMICmnLLDBDebugSessionInfo::GetStopPtInfo(const lldb::SBBreakpoint &vBrkPt, const char *pFn = pUnkwn; const char *pFilePath = pUnkwn; size_t nLine = 0; - lldb::addr_t nAddr = brkPtAddr.GetLoadAddress(GetTarget()); + lldb::addr_t nAddr = breakpointAddr.GetLoadAddress(GetTarget()); if (nAddr == LLDB_INVALID_ADDRESS) - nAddr = brkPtAddr.GetFileAddress(); + nAddr = breakpointAddr.GetFileAddress(); lldb::SBCompileUnit rCmplUnit = symbolCntxt.GetCompileUnit(); if (rCmplUnit.IsValid()) { @@ -925,16 +934,16 @@ bool CMICmnLLDBDebugSessionInfo::GetStopPtInfo(const lldb::SBBreakpoint &vBrkPt, nLine = rLnEntry.GetLine(); } - vrwStopPtInfo.m_nLldbId = vBrkPt.GetID(); - vrwStopPtInfo.m_eType = eStoppointType_Breakpoint; - vrwStopPtInfo.m_nMiId = - GetOrCreateMiStopPtId(vrwStopPtInfo.m_nLldbId, vrwStopPtInfo.m_eType); - vrwStopPtInfo.m_addr = nAddr; - vrwStopPtInfo.m_fnName = pFn; - vrwStopPtInfo.m_fileName = pFile; - vrwStopPtInfo.m_path = pFilePath; - vrwStopPtInfo.m_nLine = nLine; - vrwStopPtInfo.m_nTimes = vBrkPt.GetHitCount(); + vrwStoppointInfo.m_nLldbId = vBreakpoint.GetID(); + vrwStoppointInfo.m_eType = eStoppointType_Breakpoint; + vrwStoppointInfo.m_nMiId = GetOrCreateMiStoppointId( + vrwStoppointInfo.m_nLldbId, vrwStoppointInfo.m_eType); + vrwStoppointInfo.m_addr = nAddr; + vrwStoppointInfo.m_fnName = pFn; + vrwStoppointInfo.m_fileName = pFile; + vrwStoppointInfo.m_path = pFilePath; + vrwStoppointInfo.m_nLine = nLine; + vrwStoppointInfo.m_nTimes = vBreakpoint.GetHitCount(); return MIstatus::success; } @@ -946,28 +955,28 @@ bool CMICmnLLDBDebugSessionInfo::GetStopPtInfo(const lldb::SBBreakpoint &vBrkPt, // information after calling this function. Mainly breakpoint location // information of information that is unlikely to change. // Type: Method. -// Args: vWatchPt - (R) LLDB watch point object. -// vrwStopPtInfo - (W) Break point information object. +// Args: vWatchpoint - (R) LLDB watch point object. +// vrwStoppointInfo - (W) Break point information object. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- template <> -bool CMICmnLLDBDebugSessionInfo::GetStopPtInfo( - const lldb::SBWatchpoint &vWatchPt, SStopPtInfo &vrwStopPtInfo) { +bool CMICmnLLDBDebugSessionInfo::GetStoppointInfo( + const lldb::SBWatchpoint &vWatchpoint, SStoppointInfo &vrwStoppointInfo) { const char *pUnkwn = "??"; - auto &rWatchPt = const_cast(vWatchPt); - vrwStopPtInfo.m_nLldbId = rWatchPt.GetID(); - vrwStopPtInfo.m_eType = eStoppointType_Watchpoint; - vrwStopPtInfo.m_nMiId = - GetOrCreateMiStopPtId(vrwStopPtInfo.m_nLldbId, vrwStopPtInfo.m_eType); - vrwStopPtInfo.m_addr = rWatchPt.GetWatchAddress(); - vrwStopPtInfo.m_fnName = pUnkwn; - vrwStopPtInfo.m_fileName = pUnkwn; - vrwStopPtInfo.m_path = pUnkwn; - vrwStopPtInfo.m_nLine = 0UL; - vrwStopPtInfo.m_nTimes = rWatchPt.GetHitCount(); + auto &rWatchpoint = const_cast(vWatchpoint); + vrwStoppointInfo.m_nLldbId = rWatchpoint.GetID(); + vrwStoppointInfo.m_eType = eStoppointType_Watchpoint; + vrwStoppointInfo.m_nMiId = GetOrCreateMiStoppointId( + vrwStoppointInfo.m_nLldbId, vrwStoppointInfo.m_eType); + vrwStoppointInfo.m_addr = rWatchpoint.GetWatchAddress(); + vrwStoppointInfo.m_fnName = pUnkwn; + vrwStoppointInfo.m_fileName = pUnkwn; + vrwStoppointInfo.m_path = pUnkwn; + vrwStoppointInfo.m_nLine = 0UL; + vrwStoppointInfo.m_nTimes = rWatchpoint.GetHitCount(); return MIstatus::success; } diff --git a/src/MICmnLLDBDebugSessionInfo.h b/src/MICmnLLDBDebugSessionInfo.h index 92ecac3..3466bdd 100644 --- a/src/MICmnLLDBDebugSessionInfo.h +++ b/src/MICmnLLDBDebugSessionInfo.h @@ -103,13 +103,14 @@ class CMICmnLLDBDebugSessionInfo // about a break around and record stop point information to be // recalled by other commands or LLDB event handling functions. //-- - struct SStopPtInfo { - SStopPtInfo() + struct SStoppointInfo { + SStoppointInfo() : m_nLldbId(0), m_nMiId(0), m_bDisp(false), m_bEnabled(false), m_addr(0), m_nLine(0), m_bHaveArgOptionThreadGrp(false), m_nTimes(0), - m_watchPtVariable(false), m_watchPtRead(false), m_watchPtWrite(false), - m_bPending(false), m_nIgnore(0), m_bCondition(false), - m_bBrkPtThreadId(false), m_nBrkPtThreadId(0) {} + m_watchpointVariable(false), m_watchpointRead(false), + m_watchpointWrite(false), m_bPending(false), m_nIgnore(0), + m_bCondition(false), m_bBreakpointThreadId(false), + m_nBreakpointThreadId(0) {} MIuint m_nLldbId; // LLDB break or watch point ID. MIuint m_nMiId; // Emulated GDB-MI break point ID. @@ -126,10 +127,10 @@ class CMICmnLLDBDebugSessionInfo CMIUtilString m_strOptThrdGrp; // Thread group number. MIuint m_nTimes; // The count of the breakpoint existence. CMIUtilString m_strOrigLoc; // The name of the break point. - bool m_watchPtVariable; // Whether the watchpoint is set on var. - CMIUtilString m_watchPtExpr; // The expression of the watch point. - bool m_watchPtRead; // Whether the wpt is triggered on read. - bool m_watchPtWrite; // Whether the wpt is triggered on write. + bool m_watchpointVariable; // Whether the watchpoint is set on var. + CMIUtilString m_watchpointExpr; // The expression of the watch point. + bool m_watchpointRead; // Whether the wpt is triggered on read. + bool m_watchpointWrite; // Whether the wpt is triggered on write. bool m_bPending; // True = the breakpoint has not been established yet, // false = location found MIuint m_nIgnore; // The number of time the breakpoint is run over before it @@ -137,10 +138,11 @@ class CMICmnLLDBDebugSessionInfo bool m_bCondition; // True = break point is conditional, use condition // expression, false = no condition CMIUtilString m_strCondition; // Break point condition expression - bool m_bBrkPtThreadId; // True = break point is specified to work with a - // specific thread, false = no specified thread given - MIuint - m_nBrkPtThreadId; // Restrict the breakpoint to the specified thread-id + bool m_bBreakpointThreadId; // True = break point is specified to work with + // a specific thread, false = no specified + // thread given + MIuint m_nBreakpointThreadId; // Restrict the breakpoint to the specified + // thread-id }; // Typedefs: @@ -180,24 +182,24 @@ class CMICmnLLDBDebugSessionInfo CMICmnMIValueList &vwrMiValueList, const MIuint vnMaxDepth = 10, const bool vbMarkArgs = false); - void MIResponseFormStopPtFrameInfo(const SStopPtInfo &vrStopPtInfo, - CMICmnMIValueTuple &vwrMiValueTuple); - bool MIResponseFormBrkPtInfo(const SStopPtInfo &vrStopPtInfo, - CMICmnMIValueTuple &vwrMiValueTuple); - void MIResponseFormWatchPtInfo(const SStopPtInfo &vrStopPtInfo, - CMICmnMIValueResult &vwrMiValueResult); + void MIResponseFormStoppointFrameInfo(const SStoppointInfo &vrStoppointInfo, + CMICmnMIValueTuple &vwrMiValueTuple); + bool MIResponseFormBreakpointInfo(const SStoppointInfo &vrStoppointInfo, + CMICmnMIValueTuple &vwrMiValueTuple); + void MIResponseFormWatchpointInfo(const SStoppointInfo &vrStoppointInfo, + CMICmnMIValueResult &vwrMiValueResult); template ::value || std::is_same::value>> - bool GetStopPtInfo(const T &vrStopPt, SStopPtInfo &vrwStopPtInfo); - bool RecordStopPtInfo(const SStopPtInfo &vrStopPtInfo); - bool RecordStopPtInfoGet(const MIuint vnMiStopPtId, - SStopPtInfo &vrwStopPtInfo) const; - bool RecordStopPtInfoDelete(const MIuint vnMiStopPtId); - MIuint GetOrCreateMiStopPtId(const MIuint vnLldbStopPtId, - const StoppointType_e veStopPtType); - bool RemoveLldbToMiStopPtIdMapping(const MIuint vnLldbStopPtId, - const StoppointType_e veStopPtType); + bool GetStoppointInfo(const T &vrStoppoint, SStoppointInfo &vrwStoppointInfo); + bool RecordStoppointInfo(const SStoppointInfo &vrStoppointInfo); + bool RecordStoppointInfoGet(const MIuint vnMiStoppointId, + SStoppointInfo &vrwStoppointInfo) const; + bool RecordStoppointInfoDelete(const MIuint vnMiStoppointId); + MIuint GetOrCreateMiStoppointId(const MIuint vnLldbStoppointId, + const StoppointType_e veStoppointType); + bool RemoveLldbToMiStoppointIdMapping(const MIuint vnLldbStoppointId, + const StoppointType_e veStoppointType); CMIUtilThreadMutex &GetSessionMutex() { return m_sessionMutex; } lldb::SBDebugger &GetDebugger() const; lldb::SBListener &GetListener() const; @@ -210,7 +212,7 @@ class CMICmnLLDBDebugSessionInfo // Attributes: public: // The following are available to all command instances - const MIuint m_nBrkPointCntMax; + const MIuint m_nBreakpointCntMax; VecActiveThreadId_t m_vecActiveThreadId; lldb::tid_t m_currentSelectedThread; @@ -226,10 +228,11 @@ class CMICmnLLDBDebugSessionInfo // Typedefs: private: typedef std::vector VecVarObj_t; - typedef std::map MapMiStopPtIdToStopPtInfo_t; - typedef std::pair MapPairMiStopPtIdToStopPtInfo_t; + typedef std::map MapMiStoppointIdToStoppointInfo_t; + typedef std::pair + MapPairMiStoppointIdToStoppointInfo_t; typedef std::map, MIuint> - MapLldbStopPtIdToMiStopPtId_t; + MapLldbStoppointIdToMiStoppointId_t; // Methods: private: @@ -263,11 +266,11 @@ class CMICmnLLDBDebugSessionInfo // data available across all // commands VecVarObj_t m_vecVarObj; // Vector of session variable objects - MapMiStopPtIdToStopPtInfo_t m_mapMiStopPtIdToStopPtInfo; + MapMiStoppointIdToStoppointInfo_t m_mapMiStoppointIdToStoppointInfo; CMIUtilThreadMutex m_sessionMutex; - MapLldbStopPtIdToMiStopPtId_t m_mapLldbStopPtIdToMiStopPtId; - MIuint m_nNextMiStopPtId; - std::mutex m_miStopPtIdsMutex; + MapLldbStoppointIdToMiStoppointId_t m_mapLldbStoppointIdToMiStoppointId; + MIuint m_nNextMiStoppointId; + std::mutex m_miStoppointIdsMutex; bool m_bCreateTty; // Created inferiors should launch with new TTYs }; diff --git a/src/MICmnLLDBDebuggerHandleEvents.cpp b/src/MICmnLLDBDebuggerHandleEvents.cpp index 6ca1526..968a09b 100644 --- a/src/MICmnLLDBDebuggerHandleEvents.cpp +++ b/src/MICmnLLDBDebuggerHandleEvents.cpp @@ -344,11 +344,12 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointLocationsAdded( if (nLoc == 0) return MIstatus::success; - lldb::SBBreakpoint brkPt = lldb::SBBreakpoint::GetBreakpointFromEvent(vEvent); + lldb::SBBreakpoint breakpoint = + lldb::SBBreakpoint::GetBreakpointFromEvent(vEvent); const CMIUtilString plural((nLoc == 1) ? "" : "s"); const CMIUtilString msg( CMIUtilString::Format("%d location%s added to breakpoint %d", nLoc, - plural.c_str(), brkPt.GetID())); + plural.c_str(), breakpoint.GetID())); return TextToStdout(msg); } @@ -356,62 +357,66 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointLocationsAdded( //++ // Details: Handle a LLDB SBBreakpoint or SBWatchpoint event. // Type: Method. -// Args: vrStopPt - (R) An LLDB breakpoint or watchpoint. +// Args: vrStoppoint - (R) An LLDB breakpoint or watchpoint. // Return: MIstatus::success - Functionality succeeded. // MIstatus::failure - Functionality failed. // Throws: None. //-- template -bool CMICmnLLDBDebuggerHandleEvents::HandleEventStoppointCmn(T &vrStopPt) { - if (!vrStopPt.IsValid()) +bool CMICmnLLDBDebuggerHandleEvents::HandleEventStoppointCmn(T &vrStoppoint) { + if (!vrStoppoint.IsValid()) return MIstatus::success; CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.GetStopPtInfo(vrStopPt, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.GetStoppointInfo(vrStoppoint, sStoppointInfo)) { const char *ptType = std::is_same, lldb::SBBreakpoint>::value ? "breakpoint" : "watchpoint"; SetErrorDescription( - CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPT_INFO_GET), - __func__, ptType, vrStopPt.GetID())); + CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPOINT_INFO_GET), + __func__, ptType, vrStoppoint.GetID())); return MIstatus::failure; } // CODETAG_LLDB_BREAKPOINT_CREATION // This is in a worker thread // Add more breakpoint information or overwrite existing information - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfoRec; - if (!rSessionInfo.RecordStopPtInfoGet(sStopPtInfo.m_nMiId, sStopPtInfoRec)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfoRec; + if (!rSessionInfo.RecordStoppointInfoGet(sStoppointInfo.m_nMiId, + sStoppointInfoRec)) { SetErrorDescription(CMIUtilString::Format( - MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPT_NOTFOUND), __func__, - static_cast(sStopPtInfo.m_nMiId))); + MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPOINT_NOTFOUND), __func__, + static_cast(sStoppointInfo.m_nMiId))); return MIstatus::failure; } - sStopPtInfo.m_bDisp = sStopPtInfoRec.m_bDisp; - sStopPtInfo.m_bEnabled = vrStopPt.IsEnabled(); - sStopPtInfo.m_bHaveArgOptionThreadGrp = false; - sStopPtInfo.m_strOptThrdGrp = ""; - sStopPtInfo.m_nTimes = vrStopPt.GetHitCount(); - sStopPtInfo.m_strOrigLoc = sStopPtInfoRec.m_strOrigLoc; - sStopPtInfo.m_nIgnore = sStopPtInfoRec.m_nIgnore; - sStopPtInfo.m_bPending = sStopPtInfoRec.m_bPending; - sStopPtInfo.m_bCondition = sStopPtInfoRec.m_bCondition; - sStopPtInfo.m_strCondition = sStopPtInfoRec.m_strCondition; - sStopPtInfo.m_bBrkPtThreadId = sStopPtInfoRec.m_bBrkPtThreadId; - sStopPtInfo.m_nBrkPtThreadId = sStopPtInfoRec.m_nBrkPtThreadId; - sStopPtInfo.m_watchPtExpr = sStopPtInfoRec.m_watchPtExpr; - sStopPtInfo.m_watchPtRead = sStopPtInfoRec.m_watchPtRead; - sStopPtInfo.m_watchPtWrite = sStopPtInfoRec.m_watchPtWrite; + sStoppointInfo.m_bDisp = sStoppointInfoRec.m_bDisp; + sStoppointInfo.m_bEnabled = vrStoppoint.IsEnabled(); + sStoppointInfo.m_bHaveArgOptionThreadGrp = false; + sStoppointInfo.m_strOptThrdGrp = ""; + sStoppointInfo.m_nTimes = vrStoppoint.GetHitCount(); + sStoppointInfo.m_strOrigLoc = sStoppointInfoRec.m_strOrigLoc; + sStoppointInfo.m_nIgnore = sStoppointInfoRec.m_nIgnore; + sStoppointInfo.m_bPending = sStoppointInfoRec.m_bPending; + sStoppointInfo.m_bCondition = sStoppointInfoRec.m_bCondition; + sStoppointInfo.m_strCondition = sStoppointInfoRec.m_strCondition; + sStoppointInfo.m_bBreakpointThreadId = + sStoppointInfoRec.m_bBreakpointThreadId; + sStoppointInfo.m_nBreakpointThreadId = + sStoppointInfoRec.m_nBreakpointThreadId; + sStoppointInfo.m_watchpointExpr = sStoppointInfoRec.m_watchpointExpr; + sStoppointInfo.m_watchpointRead = sStoppointInfoRec.m_watchpointRead; + sStoppointInfo.m_watchpointWrite = sStoppointInfoRec.m_watchpointWrite; // MI print // "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016" // PRIx64 "\", // func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}" CMICmnMIValueTuple miValueTuple; - if (!rSessionInfo.MIResponseFormBrkPtInfo(sStopPtInfo, miValueTuple)) { + if (!rSessionInfo.MIResponseFormBreakpointInfo(sStoppointInfo, + miValueTuple)) { SetErrorDescription(CMIUtilString::Format( MIRSRC(IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE), __func__)); return MIstatus::failure; @@ -432,36 +437,35 @@ template bool CMICmnLLDBDebuggerHandleEvents::HandleEventStoppointCmn(lldb::SBWatchpoint &); template -static void -FillInPointTypeDependentInfo(T &vrStopPt, - CMICmnLLDBDebugSessionInfo::SStopPtInfo &vrInfo); +static void FillInPointTypeDependentInfo( + T &vrStoppoint, CMICmnLLDBDebugSessionInfo::SStoppointInfo &vrInfo); template <> void FillInPointTypeDependentInfo( - lldb::SBBreakpoint &vrStopPt, - CMICmnLLDBDebugSessionInfo::SStopPtInfo &vrInfo) { - vrInfo.m_bDisp = vrStopPt.IsOneShot(); - vrInfo.m_bBrkPtThreadId = vrStopPt.GetThreadID() != 0; - vrInfo.m_nBrkPtThreadId = vrStopPt.GetThreadID(); + lldb::SBBreakpoint &vrStoppoint, + CMICmnLLDBDebugSessionInfo::SStoppointInfo &vrInfo) { + vrInfo.m_bDisp = vrStoppoint.IsOneShot(); + vrInfo.m_bBreakpointThreadId = vrStoppoint.GetThreadID() != 0; + vrInfo.m_nBreakpointThreadId = vrStoppoint.GetThreadID(); } template <> void FillInPointTypeDependentInfo( - lldb::SBWatchpoint &vrStopPt, - CMICmnLLDBDebugSessionInfo::SStopPtInfo &vrInfo) { + lldb::SBWatchpoint &vrStoppoint, + CMICmnLLDBDebugSessionInfo::SStoppointInfo &vrInfo) { // The original expression is known by `break-watch` command implementation // only. So, if the event is handled before the command finished then the // command will put a real value later. In case a watchpoint is added via // typing a command directly into the console, we cannot determine the // original expression at all. So, we use the address as an expression here. - vrInfo.m_watchPtExpr = CMIUtilString::Format( - "0x%08" PRIx64, static_cast(vrStopPt.GetWatchAddress())); + vrInfo.m_watchpointExpr = CMIUtilString::Format( + "0x%08" PRIx64, static_cast(vrStoppoint.GetWatchAddress())); // There is no way to figure out the type of the watchpoint by the watchpoint // itself, so here the default values are set and the real values must be set // by `break-watch` command implementation. - vrInfo.m_watchPtRead = false; - vrInfo.m_watchPtWrite = true; + vrInfo.m_watchpointRead = false; + vrInfo.m_watchpointWrite = true; vrInfo.m_bDisp = false; } @@ -477,7 +481,7 @@ void FillInPointTypeDependentInfo( // create a // breakpoint directly, hence no MI command, hence no previous record // of the -// breakpoint so RecordStopPtInfoGet() will fail. We still get the +// breakpoint so RecordStoppointInfoGet() will fail. We still get the // event though so need to create a breakpoint info object here and // send appropriate MI response. // Type: Method. @@ -487,71 +491,74 @@ void FillInPointTypeDependentInfo( // Throws: None. //-- template -bool CMICmnLLDBDebuggerHandleEvents::HandleEventStoppointAdded(T &vrStopPt) { - if (!vrStopPt.IsValid()) +bool CMICmnLLDBDebuggerHandleEvents::HandleEventStoppointAdded(T &vrStoppoint) { + if (!vrStoppoint.IsValid()) return MIstatus::failure; CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.GetStopPtInfo(vrStopPt, sStopPtInfo)) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.GetStoppointInfo(vrStoppoint, sStoppointInfo)) { const char *ptType = std::is_same, lldb::SBBreakpoint>::value ? "breakpoint" : "watchpoint"; SetErrorDescription( - CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPT_INFO_GET), - __func__, ptType, vrStopPt.GetID())); + CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPOINT_INFO_GET), + __func__, ptType, vrStoppoint.GetID())); return MIstatus::failure; } // CODETAG_LLDB_BREAKPOINT_CREATION // This is in a worker thread - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfoRec; - const bool bBrkPtExistAlready = - rSessionInfo.RecordStopPtInfoGet(sStopPtInfo.m_nMiId, sStopPtInfoRec); - if (bBrkPtExistAlready) { + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfoRec; + const bool bBreakpointExistAlready = rSessionInfo.RecordStoppointInfoGet( + sStoppointInfo.m_nMiId, sStoppointInfoRec); + if (bBreakpointExistAlready) { // Update breakpoint information object - sStopPtInfo.m_bDisp = sStopPtInfoRec.m_bDisp; - sStopPtInfo.m_bEnabled = vrStopPt.IsEnabled(); - sStopPtInfo.m_bHaveArgOptionThreadGrp = false; - sStopPtInfo.m_strOptThrdGrp.clear(); - sStopPtInfo.m_nTimes = vrStopPt.GetHitCount(); - sStopPtInfo.m_strOrigLoc = sStopPtInfoRec.m_strOrigLoc; - sStopPtInfo.m_nIgnore = sStopPtInfoRec.m_nIgnore; - sStopPtInfo.m_bPending = sStopPtInfoRec.m_bPending; - sStopPtInfo.m_bCondition = sStopPtInfoRec.m_bCondition; - sStopPtInfo.m_strCondition = sStopPtInfoRec.m_strCondition; - sStopPtInfo.m_bBrkPtThreadId = sStopPtInfoRec.m_bBrkPtThreadId; - sStopPtInfo.m_nBrkPtThreadId = sStopPtInfoRec.m_nBrkPtThreadId; - sStopPtInfo.m_watchPtExpr = sStopPtInfoRec.m_watchPtExpr; - sStopPtInfo.m_watchPtRead = sStopPtInfoRec.m_watchPtRead; - sStopPtInfo.m_watchPtWrite = sStopPtInfoRec.m_watchPtWrite; + sStoppointInfo.m_bDisp = sStoppointInfoRec.m_bDisp; + sStoppointInfo.m_bEnabled = vrStoppoint.IsEnabled(); + sStoppointInfo.m_bHaveArgOptionThreadGrp = false; + sStoppointInfo.m_strOptThrdGrp.clear(); + sStoppointInfo.m_nTimes = vrStoppoint.GetHitCount(); + sStoppointInfo.m_strOrigLoc = sStoppointInfoRec.m_strOrigLoc; + sStoppointInfo.m_nIgnore = sStoppointInfoRec.m_nIgnore; + sStoppointInfo.m_bPending = sStoppointInfoRec.m_bPending; + sStoppointInfo.m_bCondition = sStoppointInfoRec.m_bCondition; + sStoppointInfo.m_strCondition = sStoppointInfoRec.m_strCondition; + sStoppointInfo.m_bBreakpointThreadId = + sStoppointInfoRec.m_bBreakpointThreadId; + sStoppointInfo.m_nBreakpointThreadId = + sStoppointInfoRec.m_nBreakpointThreadId; + sStoppointInfo.m_watchpointExpr = sStoppointInfoRec.m_watchpointExpr; + sStoppointInfo.m_watchpointRead = sStoppointInfoRec.m_watchpointRead; + sStoppointInfo.m_watchpointWrite = sStoppointInfoRec.m_watchpointWrite; } else { // Create a breakpoint information object - sStopPtInfo.m_bEnabled = vrStopPt.IsEnabled(); - sStopPtInfo.m_bHaveArgOptionThreadGrp = false; - sStopPtInfo.m_strOptThrdGrp.clear(); - sStopPtInfo.m_strOrigLoc = CMIUtilString::Format( - "%s:%d", sStopPtInfo.m_fileName.c_str(), sStopPtInfo.m_nLine); - sStopPtInfo.m_nIgnore = vrStopPt.GetIgnoreCount(); - sStopPtInfo.m_bPending = false; - const char *pStrCondition = vrStopPt.GetCondition(); - sStopPtInfo.m_bCondition = pStrCondition != nullptr; - sStopPtInfo.m_strCondition = + sStoppointInfo.m_bEnabled = vrStoppoint.IsEnabled(); + sStoppointInfo.m_bHaveArgOptionThreadGrp = false; + sStoppointInfo.m_strOptThrdGrp.clear(); + sStoppointInfo.m_strOrigLoc = CMIUtilString::Format( + "%s:%d", sStoppointInfo.m_fileName.c_str(), sStoppointInfo.m_nLine); + sStoppointInfo.m_nIgnore = vrStoppoint.GetIgnoreCount(); + sStoppointInfo.m_bPending = false; + const char *pStrCondition = vrStoppoint.GetCondition(); + sStoppointInfo.m_bCondition = pStrCondition != nullptr; + sStoppointInfo.m_strCondition = (pStrCondition != nullptr) ? pStrCondition : "??"; - FillInPointTypeDependentInfo(vrStopPt, sStopPtInfo); + FillInPointTypeDependentInfo(vrStoppoint, sStoppointInfo); } CMICmnMIValueTuple miValueTuple; - if (!rSessionInfo.MIResponseFormBrkPtInfo(sStopPtInfo, miValueTuple)) { + if (!rSessionInfo.MIResponseFormBreakpointInfo(sStoppointInfo, + miValueTuple)) { SetErrorDescription(CMIUtilString::Format( MIRSRC(IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE), __func__)); return MIstatus::failure; } bool bOk = MIstatus::success; - if (bBrkPtExistAlready) { + if (bBreakpointExistAlready) { // MI print // "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016" // PRIx64 @@ -562,18 +569,18 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventStoppointAdded(T &vrStopPt) { bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord); bOk = bOk && CMICmnStreamStdout::WritePrompt(); } else { - // CODETAG_LLDB_STOPPT_ID_MAX - if (sStopPtInfo.m_nMiId > rSessionInfo.m_nBrkPointCntMax) { + // CODETAG_LLDB_STOPPOINT_ID_MAX + if (sStoppointInfo.m_nMiId > rSessionInfo.m_nBreakpointCntMax) { SetErrorDescription(CMIUtilString::Format( - MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPT_CNT_EXCEEDED), __func__, - static_cast(rSessionInfo.m_nBrkPointCntMax), - static_cast(sStopPtInfo.m_nMiId))); + MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPOINT_CNT_EXCEEDED), __func__, + static_cast(rSessionInfo.m_nBreakpointCntMax), + static_cast(sStoppointInfo.m_nMiId))); return MIstatus::failure; } - if (!rSessionInfo.RecordStopPtInfo(sStopPtInfo)) { + if (!rSessionInfo.RecordStoppointInfo(sStoppointInfo)) { SetErrorDescription(CMIUtilString::Format( - MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPT_INFO_SET), __func__, - static_cast(sStopPtInfo.m_nMiId))); + MIRSRC(IDS_LLDBOUTOFBAND_ERR_STOPPOINT_INFO_SET), __func__, + static_cast(sStoppointInfo.m_nMiId))); return MIstatus::failure; } @@ -597,7 +604,7 @@ template bool CMICmnLLDBDebuggerHandleEvents::HandleEventStoppointAdded(lldb::SBWatchpoint &); template -bool CMICmnLLDBDebuggerHandleEvents::RemoveStoppointInfo(T &vrStopPt) { +bool CMICmnLLDBDebuggerHandleEvents::RemoveStoppointInfo(T &vrStoppoint) { auto eType = std::is_same, lldb::SBBreakpoint>::value ? CMICmnLLDBDebugSessionInfo::eStoppointType_Breakpoint : CMICmnLLDBDebugSessionInfo::eStoppointType_Watchpoint; @@ -605,12 +612,13 @@ bool CMICmnLLDBDebuggerHandleEvents::RemoveStoppointInfo(T &vrStopPt) { CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - auto nMiStopPtId = - rSessionInfo.GetOrCreateMiStopPtId(vrStopPt.GetID(), eType); - if (!rSessionInfo.RecordStopPtInfoDelete(nMiStopPtId)) + auto nMiStoppointId = + rSessionInfo.GetOrCreateMiStoppointId(vrStoppoint.GetID(), eType); + if (!rSessionInfo.RecordStoppointInfoDelete(nMiStoppointId)) return MIstatus::failure; - return rSessionInfo.RemoveLldbToMiStopPtIdMapping(vrStopPt.GetID(), eType); + return rSessionInfo.RemoveLldbToMiStoppointIdMapping(vrStoppoint.GetID(), + eType); } //++ @@ -1431,13 +1439,13 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonBreakpoint() { lldb::SBProcess sbProcess = CMICmnLLDBDebugSessionInfo::Instance().GetProcess(); - const MIuint64 brkPtId = + const MIuint64 breakpointId = sbProcess.GetSelectedThread().GetStopReasonDataAtIndex(0); - lldb::SBBreakpoint brkPt = + lldb::SBBreakpoint breakpoint = CMICmnLLDBDebugSessionInfo::Instance().GetTarget().FindBreakpointByID( - (MIuint)brkPtId); + (MIuint)breakpointId); - return MiStoppedAtBreakPoint(brkPtId, brkPt); + return MiStoppedAtBreakPoint(breakpointId, breakpoint); } //++ @@ -1460,27 +1468,27 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonWatchpoint() { lldb::SBProcess sbProcess = CMICmnLLDBDebugSessionInfo::Instance().GetProcess(); - const auto watchPtId = static_cast( + const auto watchpointId = static_cast( sbProcess.GetSelectedThread().GetStopReasonDataAtIndex(0U)); - lldb::SBWatchpoint watchPt = + lldb::SBWatchpoint watchpoint = CMICmnLLDBDebugSessionInfo::Instance().GetTarget().FindWatchpointByID( - watchPtId); + watchpointId); - return MiStoppedAtWatchpoint(watchPt); + return MiStoppedAtWatchpoint(watchpoint); } //++ // Details: Form the MI Out-of-band response for stopped reason on hitting a // break point. // Type: Method. -// Args: vBrkPtId - (R) The LLDB break point's ID -// vBrkPt - (R) THe LLDB break point object. +// Args: vBreakpointId - (R) The LLDB break point's ID +// vBreakpoint - (R) THe LLDB break point object. // Return: MIstatus::success - Functionality succeeded. // MIstatus::failure - Functionality failed. // Throws: None. //-- bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint( - const MIuint64 vBrkPtId, const lldb::SBBreakpoint &vBrkPt) { + const MIuint64 vBreakpointId, const lldb::SBBreakpoint &vBreakpoint) { bool bOk = MIstatus::success; lldb::SBProcess sbProcess = @@ -1497,7 +1505,7 @@ bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint( const CMICmnMIValueConst miValueConst2("del"); const CMICmnMIValueResult miValueResult2("disp", miValueConst2); miOutOfBandRecord.Add(miValueResult2); - const CMIUtilString strBkp(CMIUtilString::Format("%d", vBrkPtId)); + const CMIUtilString strBkp(CMIUtilString::Format("%d", vBreakpointId)); const CMICmnMIValueConst miValueConst3(strBkp); CMICmnMIValueResult miValueResult3("bkptno", miValueConst3); miOutOfBandRecord.Add(miValueResult3); @@ -1505,7 +1513,7 @@ bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint( const CMICmnMIValueResult miValueResult4("frame", miValueConst4); miOutOfBandRecord.Add(miValueResult4); const CMIUtilString strThreadId( - CMIUtilString::Format("%d", vBrkPt.GetThreadIndex())); + CMIUtilString::Format("%d", vBreakpoint.GetThreadIndex())); const CMICmnMIValueConst miValueConst5(strThreadId); const CMICmnMIValueResult miValueResult5("thread-id", miValueConst5); miOutOfBandRecord.Add(miValueResult5); @@ -1531,7 +1539,7 @@ bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint( const CMICmnMIValueConst miValueConstA("del"); const CMICmnMIValueResult miValueResultA("disp", miValueConstA); miOutOfBandRecord.Add(miValueResultA); - const CMIUtilString strBkp(CMIUtilString::Format("%d", vBrkPtId)); + const CMIUtilString strBkp(CMIUtilString::Format("%d", vBreakpointId)); const CMICmnMIValueConst miValueConstB(strBkp); CMICmnMIValueResult miValueResultB("bkptno", miValueConstB); miOutOfBandRecord.Add(miValueResultB); @@ -1571,25 +1579,26 @@ bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint( // Details: Form the MI Out-of-band response for stopped reason on hitting a // watch point. // Type: Method. -// Args: vrWatchPtId - (R) The LLDB watch point. +// Args: vrWatchpointId - (R) The LLDB watch point. // Return: MIstatus::success - Functionality succeeded. // MIstatus::failure - Functionality failed. // Throws: None. //-- bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtWatchpoint( - lldb::SBWatchpoint &vrWatchPt) { + lldb::SBWatchpoint &vrWatchpoint) { CMICmnLLDBDebugSessionInfo &rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance()); - auto nGdbBrkPtId = rSessionInfo.GetOrCreateMiStopPtId( - vrWatchPt.GetID(), CMICmnLLDBDebugSessionInfo::eStoppointType_Watchpoint); + auto nGdbBreakpointId = rSessionInfo.GetOrCreateMiStoppointId( + vrWatchpoint.GetID(), + CMICmnLLDBDebugSessionInfo::eStoppointType_Watchpoint); - CMICmnLLDBDebugSessionInfo::SStopPtInfo sStopPtInfo; - if (!rSessionInfo.RecordStopPtInfoGet(nGdbBrkPtId, sStopPtInfo)) + CMICmnLLDBDebugSessionInfo::SStoppointInfo sStoppointInfo; + if (!rSessionInfo.RecordStoppointInfoGet(nGdbBreakpointId, sStoppointInfo)) return MIstatus::failure; - const char *reason = sStopPtInfo.m_watchPtRead - ? sStopPtInfo.m_watchPtWrite + const char *reason = sStoppointInfo.m_watchpointRead + ? sStoppointInfo.m_watchpointWrite ? "access-watchpoint-trigger" : "read-watchpoint-trigger" : "watchpoint-trigger"; @@ -1604,7 +1613,7 @@ bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtWatchpoint( // wpt={...} CMICmnMIValueResult miValueResultWpt; - rSessionInfo.MIResponseFormWatchPtInfo(sStopPtInfo, miValueResultWpt); + rSessionInfo.MIResponseFormWatchpointInfo(sStoppointInfo, miValueResultWpt); miOutOfBandRecord.Add(miValueResultWpt); // frame={...} diff --git a/src/MICmnLLDBDebuggerHandleEvents.h b/src/MICmnLLDBDebuggerHandleEvents.h index 8a5485e..2c21d1b 100644 --- a/src/MICmnLLDBDebuggerHandleEvents.h +++ b/src/MICmnLLDBDebuggerHandleEvents.h @@ -59,15 +59,15 @@ class CMICmnLLDBDebuggerHandleEvents template ::value || std::is_same::value>> - bool HandleEventStoppointCmn(T &vrStopPt); + bool HandleEventStoppointCmn(T &vrStoppoint); template ::value || std::is_same::value>> - bool HandleEventStoppointAdded(T &vrStopPt); + bool HandleEventStoppointAdded(T &vrStoppoint); template ::value || std::is_same::value>> - bool RemoveStoppointInfo(T &vrStopPt); + bool RemoveStoppointInfo(T &vrStoppoint); bool HandleEventSBProcess(const lldb::SBEvent &vEvent); bool HandleEventSBTarget(const lldb::SBEvent &vEvent); bool HandleEventSBThread(const lldb::SBEvent &vEvent); @@ -95,9 +95,9 @@ class CMICmnLLDBDebuggerHandleEvents bool MiResultRecordToStdout(const CMICmnMIResultRecord &vrMiResultRecord); bool MiOutOfBandRecordToStdout(const CMICmnMIOutOfBandRecord &vrMiResultRecord); - bool MiStoppedAtBreakPoint(const MIuint64 vBrkPtId, - const lldb::SBBreakpoint &vBrkPt); - bool MiStoppedAtWatchpoint(lldb::SBWatchpoint &vrWatchPt); + bool MiStoppedAtBreakPoint(const MIuint64 vBreakpointId, + const lldb::SBBreakpoint &vBreakpoint); + bool MiStoppedAtWatchpoint(lldb::SBWatchpoint &vrWatchpoint); bool TextToStdout(const CMIUtilString &vrTxt); bool TextToStderr(const CMIUtilString &vrTxt); bool UpdateSelectedThread(); diff --git a/src/MICmnResources.cpp b/src/MICmnResources.cpp index 7e181a2..621e7ae 100644 --- a/src/MICmnResources.cpp +++ b/src/MICmnResources.cpp @@ -222,13 +222,13 @@ const CMICmnResources::SRsrcTextData "not recognised"}, {IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID, "LLDB Out-of-band. Invalid '%s' in '%s'"}, - {IDS_LLDBOUTOFBAND_ERR_STOPPT_NOTFOUND, + {IDS_LLDBOUTOFBAND_ERR_STOPPOINT_NOTFOUND, "LLDB Out-of-band. %s(). Stoppoint information for stoppoint ID " "%" PRIu64 " not found"}, - {IDS_LLDBOUTOFBAND_ERR_STOPPT_INFO_GET, + {IDS_LLDBOUTOFBAND_ERR_STOPPOINT_INFO_GET, "LLDB Out-of-band. %s(). Failed to retrieve stoppoint information for " "for %s with LLDB ID %" PRId32}, - {IDS_LLDBOUTOFBAND_ERR_STOPPT_INFO_SET, + {IDS_LLDBOUTOFBAND_ERR_STOPPOINT_INFO_SET, "LLDB Out-of-band. %s(). Failed to set stoppoint information for " "unified breakpoint ID %" PRIu64}, {IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE, @@ -238,7 +238,7 @@ const CMICmnResources::SRsrcTextData {IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE, "LLDB Out-of-band. %s(). Event handler tried to set new MI Driver " "running state and failed. %s"}, - {IDS_LLDBOUTOFBAND_ERR_STOPPT_CNT_EXCEEDED, + {IDS_LLDBOUTOFBAND_ERR_STOPPOINT_CNT_EXCEEDED, "LLDB Out-of-band. '%s'. Number of valid stoppoint exceeded %" PRIu64 ". Cannot create new breakpoint with ID %" PRIu64}, {IDS_DBGSESSION_ERR_SHARED_DATA_ADD, "LLDB debug session info. Failed " @@ -372,26 +372,26 @@ const CMICmnResources::SRsrcTextData {IDS_CMD_ERR_NOT_IMPLEMENTED_DEPRECATED, "Command '%s'. Command not implemented as it has been deprecated"}, {IDS_CMD_ERR_CREATE_TARGET, "Command '%s'. Create target failed: %s"}, - {IDS_CMD_ERR_BRKPT_LOCATION_FORMAT, + {IDS_CMD_ERR_BREAKPOINT_LOCATION_FORMAT, "Command '%s'. Incorrect format for breakpoint location '%s'"}, - {IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND, + {IDS_CMD_ERR_BREAKPOINT_LOCATION_NOT_FOUND, "Command '%s'. Breakpoint location '%s' not found"}, - {IDS_CMD_ERR_STOPPT_INVALID, "Command '%s'. Stoppoint '%s' invalid"}, - {IDS_CMD_ERR_STOPPT_CNT_EXCEEDED, + {IDS_CMD_ERR_STOPPOINT_INVALID, "Command '%s'. Stoppoint '%s' invalid"}, + {IDS_CMD_ERR_STOPPOINT_CNT_EXCEEDED, "Command '%s'. Number of valid stoppoint exceeded %" PRIu64 ". Cannot create new stoppoint %" PRIu64}, {IDS_CMD_ERR_INVALID_FRAME, "Command '%s'. The selected frame is invalid."}, - {IDS_CMD_ERR_WATCHPT_STOPPT_INFO_CREATE, + {IDS_CMD_ERR_WATCHPOINT_STOPPOINT_INFO_CREATE, "Command '%s'. Failed to create stoppoint " "information for watchpoint LLDB ID %" PRIu64}, - {IDS_CMD_ERR_STOPPT_INFO_SET, + {IDS_CMD_ERR_STOPPOINT_INFO_SET, "Command '%s'. Failed to set stoppoint " "information for unified stoppoint ID %" PRIu64}, {IDS_CMD_ERR_FIND_EXPR_ADDRESS, "Command '%s'. Expression '%s' does not specify a locally visible " "or global variable and cannot be interpreted as an address"}, - {IDS_CMD_ERR_CREATE_WATCHPT, + {IDS_CMD_ERR_CREATE_WATCHPOINT, "Command '%s'. Couldn't create %s watchpoint at address 0x%" PRIx64 "with size %" PRIu64}, {IDS_CMD_ERR_SOME_ERROR, "Command '%s'. Error: %s"}, @@ -437,7 +437,7 @@ const CMICmnResources::SRsrcTextData "Command '%s'. Invalid location format '%s'"}, {IDS_CMD_ERR_INVALID_FORMAT_TYPE, "Command '%s'. Invalid var format type '%s'"}, - {IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND, + {IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND, "Command '%s'. Stoppoint information for unified stoppoint ID %" PRIu64 " not found"}, {IDS_CMD_ERR_LLDB_ERR_WRITE_MEM_BYTES, "Command '%s'. Unable to write " diff --git a/src/MICmnResources.h b/src/MICmnResources.h index 888bb58..732d462 100644 --- a/src/MICmnResources.h +++ b/src/MICmnResources.h @@ -144,13 +144,13 @@ enum { IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT, IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID, - IDS_LLDBOUTOFBAND_ERR_STOPPT_NOTFOUND, - IDS_LLDBOUTOFBAND_ERR_STOPPT_INFO_GET, - IDS_LLDBOUTOFBAND_ERR_STOPPT_INFO_SET, + IDS_LLDBOUTOFBAND_ERR_STOPPOINT_NOTFOUND, + IDS_LLDBOUTOFBAND_ERR_STOPPOINT_INFO_GET, + IDS_LLDBOUTOFBAND_ERR_STOPPOINT_INFO_SET, IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE, IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET, IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE, - IDS_LLDBOUTOFBAND_ERR_STOPPT_CNT_EXCEEDED, + IDS_LLDBOUTOFBAND_ERR_STOPPOINT_CNT_EXCEEDED, IDS_DBGSESSION_ERR_SHARED_DATA_ADD, @@ -232,15 +232,15 @@ enum { IDS_CMD_ERR_NOT_IMPLEMENTED, IDS_CMD_ERR_NOT_IMPLEMENTED_DEPRECATED, IDS_CMD_ERR_CREATE_TARGET, - IDS_CMD_ERR_BRKPT_LOCATION_FORMAT, - IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND, - IDS_CMD_ERR_STOPPT_INVALID, - IDS_CMD_ERR_STOPPT_CNT_EXCEEDED, + IDS_CMD_ERR_BREAKPOINT_LOCATION_FORMAT, + IDS_CMD_ERR_BREAKPOINT_LOCATION_NOT_FOUND, + IDS_CMD_ERR_STOPPOINT_INVALID, + IDS_CMD_ERR_STOPPOINT_CNT_EXCEEDED, IDS_CMD_ERR_INVALID_FRAME, - IDS_CMD_ERR_WATCHPT_STOPPT_INFO_CREATE, - IDS_CMD_ERR_STOPPT_INFO_SET, + IDS_CMD_ERR_WATCHPOINT_STOPPOINT_INFO_CREATE, + IDS_CMD_ERR_STOPPOINT_INFO_SET, IDS_CMD_ERR_FIND_EXPR_ADDRESS, - IDS_CMD_ERR_CREATE_WATCHPT, + IDS_CMD_ERR_CREATE_WATCHPOINT, IDS_CMD_ERR_SOME_ERROR, IDS_CMD_ERR_THREAD_INVALID, IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID, @@ -261,7 +261,7 @@ enum { IDS_CMD_ERR_INVALID_PRINT_VALUES, IDS_CMD_ERR_INVALID_LOCATION_FORMAT, IDS_CMD_ERR_INVALID_FORMAT_TYPE, - IDS_CMD_ERR_STOPPT_INFO_OBJ_NOT_FOUND, + IDS_CMD_ERR_STOPPOINT_INFO_OBJ_NOT_FOUND, IDS_CMD_ERR_LLDB_ERR_WRITE_MEM_BYTES, IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK, IDS_CMD_ERR_SET_NEW_DRIVER_STATE,