本文整理汇总了C++中rSessionInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ rSessionInfo函数的具体用法?C++ rSessionInfo怎么用?C++ rSessionInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rSessionInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetError
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Synopsis: -target-attach file
// Ref: http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Target-Manipulation.html#GDB_002fMI-Target-Manipulation
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool
CMICmdCmdTargetDetach::Execute()
{
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::SBProcess process = rSessionInfo.GetProcess();
if (!process.IsValid())
{
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_PROCESS), m_cmdData.strMiCmd.c_str()));
return MIstatus::failure;
}
process.Detach();
return MIstatus::success;
}
示例2: strModuleFilePath
//++ ------------------------------------------------------------------------------------
// Details: Carry out work to complete the request to prepare and send back information
// asked for.
// Type: Method.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool
CMICmdCmdGdbInfo::PrintFnSharedLibrary(void)
{
CMICmnStreamStdout &rStdout = CMICmnStreamStdout::Instance();
bool bOk = rStdout.TextToStdout("~\"From To Syms Read Shared Object Library\"");
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::SBTarget sbTarget = rSessionInfo.GetTarget();
const MIuint nModules = sbTarget.GetNumModules();
for (MIuint i = 0; bOk && (i < nModules); i++)
{
lldb::SBModule module = sbTarget.GetModuleAtIndex(i);
if (module.IsValid())
{
const CMIUtilString strModuleFilePath(module.GetFileSpec().GetDirectory());
const CMIUtilString strModuleFileName(module.GetFileSpec().GetFilename());
const CMIUtilString strModuleFullPath(CMIUtilString::Format("%s/%s", strModuleFilePath.c_str(), strModuleFileName.c_str()));
const CMIUtilString strHasSymbols = (module.GetNumSymbols() > 0) ? "Yes" : "No";
lldb::addr_t addrLoadS = 0xffffffff;
lldb::addr_t addrLoadSize = 0;
bool bHaveAddrLoad = false;
const MIuint nSections = module.GetNumSections();
for (MIuint j = 0; j < nSections; j++)
{
lldb::SBSection section = module.GetSectionAtIndex(j);
lldb::addr_t addrLoad = section.GetLoadAddress(sbTarget);
if (addrLoad != (lldb::addr_t) - 1)
{
if (!bHaveAddrLoad)
{
bHaveAddrLoad = true;
addrLoadS = addrLoad;
}
addrLoadSize += section.GetByteSize();
}
}
bOk = bOk &&
rStdout.TextToStdout(CMIUtilString::Format("~\"0x%08x\t0x%08x\t%s\t\t%s\"", addrLoadS, addrLoadS + addrLoadSize,
strHasSymbols.c_str(), strModuleFullPath.c_str()));
}
}
return bOk;
}
示例3: CMICMDBASE_GETOPTION
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool CMICmdCmdStackInfoDepth::Execute( void )
{
CMICMDBASE_GETOPTION( pArgThread, OptionLong, m_constStrArgThread );
CMICMDBASE_GETOPTION( pArgMaxDepth, Number, m_constStrArgMaxDepth );
// Retrieve the --thread option's thread ID (only 1)
MIuint64 nThreadId = UINT64_MAX;
if( !pArgThread->GetExpectedOption< CMICmdArgValNumber, MIuint64 >( nThreadId ) )
{
SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_OPTION_NOT_FOUND ), m_cmdData.strMiCmd.c_str(), m_constStrArgThread.c_str() ) );
return MIstatus::failure;
}
CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
m_nThreadFrames = rSessionInfo.m_lldbProcess.GetThreadByIndexID( nThreadId ).GetNumFrames();
return MIstatus::success;
}
示例4: SetError
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Function succeeded.
// MIstatus::failure - Function failed.
// Throws: None.
//--
bool
CMICmdCmdStackInfoFrame::Execute(void)
{
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::SBProcess sbProcess = rSessionInfo.GetProcess();
if (!sbProcess.IsValid())
{
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_PROCESS), m_cmdData.strMiCmd.c_str()));
return MIstatus::failure;
}
lldb::SBThread sbThread = sbProcess.GetSelectedThread();
MIuint nFrameId = sbThread.GetSelectedFrame().GetFrameID();
if (!rSessionInfo.MIResponseFormFrameInfo(sbThread, nFrameId, m_miValueTuple))
return MIstatus::failure;
return MIstatus::success;
}
示例5: CMICMDBASE_GETOPTION
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Function succeeded.
// MIstatus::failure - Function failed.
// Throws: None.
//--
bool
CMICmdCmdStackSelectFrame::Execute(void)
{
CMICMDBASE_GETOPTION(pArgFrame, Number, m_constStrArgFrame);
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::SBThread sbThread = rSessionInfo.GetProcess().GetSelectedThread();
const MIuint nFrameId = pArgFrame->GetValue();
m_bFrameInvalid = (nFrameId >= sbThread.GetNumFrames());
if (m_bFrameInvalid)
return MIstatus::success;
lldb::SBFrame sbFrame = sbThread.SetSelectedFrame(nFrameId);
m_bFrameInvalid = !sbFrame.IsValid();
return MIstatus::success;
}
示例6: strCmd
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool
CMICmdCmdExecInterrupt::Execute()
{
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
CMIUtilString strCmd("process interrupt");
const lldb::ReturnStatus status = rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult, false);
MIunused(status);
// CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
if (!CMIDriver::Instance().SetDriverStateRunningNotDebugging())
{
const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE), strCmd.c_str(), rErrMsg.c_str()));
return MIstatus::failure;
}
return MIstatus::success;
}
示例7: CMICMDBASE_GETOPTION
//++
//------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this
// function.
// The command is likely to communicate with the LLDB SBDebugger in
// here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool CMICmdCmdInterpreterExec::Execute() {
CMICMDBASE_GETOPTION(pArgInterpreter, String, m_constStrArgNamedInterpreter);
CMICMDBASE_GETOPTION(pArgCommand, String, m_constStrArgNamedCommand);
// Handle the interpreter parameter by do nothing on purpose (set to 'handled'
// in
// the arg definition above)
const CMIUtilString &rStrInterpreter(pArgInterpreter->GetValue());
MIunused(rStrInterpreter);
const CMIUtilString &rStrCommand(pArgCommand->GetValue());
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
const lldb::ReturnStatus rtn =
rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(
rStrCommand.c_str(), m_lldbResult, true);
MIunused(rtn);
return MIstatus::success;
}
示例8: SetError
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Function succeeded.
// MIstatus::failure - Function failed.
// Throws: None.
//--
bool
CMICmdCmdExecAbort::Execute()
{
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::SBProcess sbProcess = rSessionInfo.GetProcess();
if (!sbProcess.IsValid())
{
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_PROCESS), m_cmdData.strMiCmd.c_str()));
return MIstatus::failure;
}
lldb::SBError sbError = sbProcess.Destroy();
if (sbError.Fail())
{
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_LLDBPROCESS_DESTROY), m_cmdData.strMiCmd.c_str(), sbError.GetCString()));
return MIstatus::failure;
}
return MIstatus::success;
}
示例9: miValueResultD
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command prepares a MI Record Result
// for the work carried out in the Execute().
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool
CMICmdCmdBreakInsert::Acknowledge()
{
// Get breakpoint information
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfo;
if (!rSessionInfo.RecordBrkPtInfoGet(m_brkPt.GetID(), sBrkPtInfo))
return MIstatus::failure;
// MI print
// "^done,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016" PRIx64 "\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",thread-groups=[\"%s\"],times=\"%d\",original-location=\"%s\"}"
CMICmnMIValueTuple miValueTuple;
if (!rSessionInfo.MIResponseFormBrkPtInfo(sBrkPtInfo, miValueTuple))
return MIstatus::failure;
const CMICmnMIValueResult miValueResultD("bkpt", miValueTuple);
const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResultD);
m_miResultRecord = miRecordResult;
return MIstatus::success;
}
示例10: miRecordResult
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command prepares a MI Record Result
// for the work carried out in the Execute().
// Called only if Execute() set status as successful on completion.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool
CMICmdCmdExecRun::Acknowledge()
{
const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
m_miResultRecord = miRecordResult;
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::pid_t pid = rSessionInfo.GetProcess().GetProcessID();
// Give the client '=thread-group-started,id="i1" pid="xyz"'
m_bHasResultRecordExtra = true;
const CMICmnMIValueConst miValueConst2("i1");
const CMICmnMIValueResult miValueResult2("id", miValueConst2);
const CMIUtilString strPid(CMIUtilString::Format("%lld", pid));
const CMICmnMIValueConst miValueConst(strPid);
const CMICmnMIValueResult miValueResult("pid", miValueConst);
CMICmnMIOutOfBandRecord miOutOfBand(CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupStarted, miValueResult2);
miOutOfBand.Add(miValueResult);
m_miResultRecordExtra = miOutOfBand.GetString();
return MIstatus::success;
}
示例11: miRecordResult
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command prepares a MI Record Result
// for the work carried out in the Execute().
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool CMICmdCmdTargetSelect::Acknowledge( void )
{
const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Connected );
m_miResultRecord = miRecordResult;
CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
lldb::pid_t pid = rSessionInfo.m_lldbProcess.GetProcessID();
// Prod the client i.e. Eclipse with out-of-band results to help it 'continue' because it is using LLDB debugger
// Give the client '=thread-group-started,id="i1"'
m_bHasResultRecordExtra = true;
const CMICmnMIValueConst miValueConst2( "i1" );
const CMICmnMIValueResult miValueResult2( "id", miValueConst2 );
const CMIUtilString strPid( CMIUtilString::Format( "%lld", pid ) );
const CMICmnMIValueConst miValueConst( strPid );
const CMICmnMIValueResult miValueResult( "pid", miValueConst );
CMICmnMIOutOfBandRecord miOutOfBand( CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupStarted, miValueResult2 );
miOutOfBand.Add( miValueResult );
m_miResultRecordExtra = miOutOfBand.GetString();
return MIstatus::success;
}
示例12: CMICMDBASE_GETOPTION
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool
CMICmdCmdExecFinish::Execute()
{
CMICMDBASE_GETOPTION(pArgThread, OptionLong, m_constStrArgThread);
// Retrieve the --thread option's thread ID (only 1)
MIuint64 nThreadId = UINT64_MAX;
if (pArgThread->GetFound() && !pArgThread->GetExpectedOption<CMICmdArgValNumber, MIuint64>(nThreadId))
{
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_OPTION_NOT_FOUND), m_cmdData.strMiCmd.c_str(), m_constStrArgThread.c_str()));
return MIstatus::failure;
}
CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
CMIUtilString strCmd("thread step-out");
if (nThreadId != UINT64_MAX)
strCmd += CMIUtilString::Format(" %llu", nThreadId);
rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult, false);
return MIstatus::success;
}
示例13: rSessionInfo
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command prepares a MI Record Result
// for the work carried out in the Execute().
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool CMICmdCmdBreakInsert::Acknowledge( void )
{
// Get breakpoint information
CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfo;
if( !rSessionInfo.GetBrkPtInfo( m_brkPt, sBrkPtInfo ) )
{
return MIstatus::failure;
}
// CODETAG_LLDB_BREAKPOINT_CREATION
// Add more breakpoint information or overwrite existing information
sBrkPtInfo.m_bDisp = m_bBrkPtIsTemp;
sBrkPtInfo.m_bEnabled = m_bBrkPtEnabled;
sBrkPtInfo.m_bHaveArgOptionThreadGrp = m_bHaveArgOptionThreadGrp;
sBrkPtInfo.m_strOptThrdGrp = m_strArgOptionThreadGrp;
sBrkPtInfo.m_nTimes = m_brkPt.GetNumLocations();
sBrkPtInfo.m_strOrigLoc = m_brkName;
sBrkPtInfo.m_nIgnore = m_nBrkPtIgnoreCount;
sBrkPtInfo.m_bPending = m_bBrkPtIsPending;
sBrkPtInfo.m_bCondition = m_bBrkPtCondition;
sBrkPtInfo.m_strCondition = m_brkPtCondition;
sBrkPtInfo.m_bBrkPtThreadId = m_bBrkPtThreadId;
sBrkPtInfo.m_nBrkPtThreadId = m_nBrkPtThreadId;
// MI print "^done,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",thread-groups=[\"%s\"],times=\"%d\",original-location=\"%s\"}"
CMICmnMIValueTuple miValueTuple;
if( !rSessionInfo.MIResponseFormBrkPtInfo( sBrkPtInfo, miValueTuple ) )
{
return MIstatus::failure;
}
const CMICmnMIValueResult miValueResultD( "bkpt", miValueTuple );
const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResultD );
m_miResultRecord = miRecordResult;
return MIstatus::success;
}
示例14: GetSimpleValue
//++
//------------------------------------------------------------------------------------
// Details: Retrieve from the LLDB SB Value object the value of the variable
// described in
// text. If the value is invalid (or the SBValue object invalid) then
// "??" is
// returned.
// Type: Method.
// Args: None.
// Return: CMIUtilString - Text description of the variable's value or "??".
// Throws: None.
//--
CMIUtilString CMICmnLLDBUtilSBValue::GetValue(
const bool vbExpandAggregates /* = false */) const {
if (!m_bValidSBValue)
return m_pUnkwn;
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
bool bPrintExpandAggregates = false;
bPrintExpandAggregates = rSessionInfo.SharedDataRetrieve<bool>(
rSessionInfo.m_constStrPrintExpandAggregates,
bPrintExpandAggregates) &&
bPrintExpandAggregates;
const bool bHandleArrayTypeAsSimple =
m_bHandleArrayType && !vbExpandAggregates && !bPrintExpandAggregates;
CMIUtilString value;
const bool bIsSimpleValue = GetSimpleValue(bHandleArrayTypeAsSimple, value);
if (bIsSimpleValue)
return value;
if (!vbExpandAggregates && !bPrintExpandAggregates)
return m_pComposite;
bool bPrintAggregateFieldNames = false;
bPrintAggregateFieldNames =
!rSessionInfo.SharedDataRetrieve<bool>(
rSessionInfo.m_constStrPrintAggregateFieldNames,
bPrintAggregateFieldNames) ||
bPrintAggregateFieldNames;
CMICmnMIValueTuple miValueTuple;
const bool bOk = GetCompositeValue(bPrintAggregateFieldNames, miValueTuple);
if (!bOk)
return m_pUnkwn;
value = miValueTuple.GetString();
return value;
}
示例15: CMICMDBASE_GETOPTION
//++ ------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this function.
// The command is likely to communicate with the LLDB SBDebugger in here.
// Type: Overridden.
// Args: None.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool CMICmdCmdBreakEnable::Execute( void )
{
CMICMDBASE_GETOPTION( pArgBrkPt, ListOfN, m_constStrArgNamedBrkPt );
// ATM we only handle one break point ID
MIuint64 nBrk = UINT64_MAX;
if( !pArgBrkPt->GetExpectedOption< CMICmdArgValNumber, MIuint64 >( nBrk ) )
{
SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_BRKPT_INVALID ), m_cmdData.strMiCmd.c_str(), m_constStrArgNamedBrkPt.c_str() ) );
return MIstatus::failure;
}
CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
lldb::SBBreakpoint brkPt = rSessionInfo.m_lldbTarget.FindBreakpointByID( static_cast< lldb::break_id_t >( nBrk ) );
if( brkPt.IsValid() )
{
m_bBrkPtEnabledOk = true;
brkPt.SetEnabled( false );
m_nBrkPtId = nBrk;
}
return MIstatus::success;
}