当前位置: 首页>>代码示例>>C++>>正文


C++ MIRSRC函数代码示例

本文整理汇总了C++中MIRSRC函数的典型用法代码示例。如果您正苦于以下问题:C++ MIRSRC函数的具体用法?C++ MIRSRC怎么用?C++ MIRSRC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MIRSRC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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 CMICmdCmdBreakDelete::Execute() {
  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());
  const bool bBrkPt = rSessionInfo.GetTarget().BreakpointDelete(
      static_cast<lldb::break_id_t>(nBrk));
  if (!bBrkPt) {
    const CMIUtilString strBrkNum(CMIUtilString::Format("%d", nBrk));
    SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_BRKPT_INVALID),
                                   m_cmdData.strMiCmd.c_str(),
                                   strBrkNum.c_str()));
    return MIstatus::failure;
  }

  return MIstatus::success;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:38,代码来源:MICmdCmdBreak.cpp

示例2: errMsg

//++ ------------------------------------------------------------------------------------
// Details:	Get the current driver to validate executable command line arguments.
// Type:	Method.
// Args:	argc		- (R)	An integer that contains the count of arguments that follow in 
//								argv. The argc parameter is always greater than or equal to 1.
//			argv		- (R)	An array of null-terminated strings representing command-line 
//								arguments entered by the user of the program. By convention, 
//								argv[0] is the command with which the program is invoked.
//			vpStdOut	- (R)	Point to a standard output stream. 
//			vwbExiting	- (W)	True = *this want to exit, false = continue to work. 
// Return:	MIstatus::success - Functional succeeded.
//			MIstatus::failure - Functional failed.
// Throws:	None.
//--
bool CMIDriverMgr::DriverParseArgs( const int argc, const char * argv[], FILE * vpStdOut, bool & vwbExiting )
{
	if( m_pDriverCurrent == nullptr )
	{
		const CMIUtilString errMsg( CMIUtilString::Format( MIRSRC( IDS_DRIVER_ERR_CURRENT_NOT_SET ) ) );
		CMICmnStreamStdout::Instance().Write( errMsg, true );
		return MIstatus::failure;
	}

	const lldb::SBError error( m_pDriverCurrent->DoParseArgs( argc, argv, vpStdOut, vwbExiting ) );
	bool bOk = !error.Fail();
	if( !bOk )
	{
		CMIUtilString errMsg;
		const MIchar * pErrorCstr = error.GetCString();
		if( pErrorCstr != nullptr )
			errMsg = CMIUtilString::Format( MIRSRC( IDS_DRIVER_ERR_PARSE_ARGS ), m_pDriverCurrent->GetName().c_str(), pErrorCstr );
		else
			errMsg = CMIUtilString::Format( MIRSRC( IDS_DRIVER_ERR_PARSE_ARGS_UNKNOWN ), m_pDriverCurrent->GetName().c_str() );

		bOk = CMICmnStreamStdout::Instance().Write( errMsg, true );
	}

	return bOk;
}
开发者ID:chee-z,项目名称:lldb,代码行数:39,代码来源:MIDriverMgr.cpp

示例3: miValueConst

//++ ------------------------------------------------------------------------------------
// 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
CMICmdCmdGdbInfo::Acknowledge(void)
{
    if (!m_bPrintFnRecognised)
    {
        const CMICmnMIValueConst miValueConst(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND), m_strPrintFnName.c_str()));
        const CMICmnMIValueResult miValueResult("msg", miValueConst);
        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult);
        m_miResultRecord = miRecordResult;
        return MIstatus::success;
    }

    if (m_bPrintFnSuccessful)
    {
        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
        m_miResultRecord = miRecordResult;
        return MIstatus::success;
    }

    const CMICmnMIValueConst miValueConst(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INFO_PRINTFN_FAILED), m_strPrintFnError.c_str()));
    const CMICmnMIValueResult miValueResult("msg", miValueConst);
    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult);
    m_miResultRecord = miRecordResult;

    return MIstatus::success;
}
开发者ID:johndpope,项目名称:lldb,代码行数:35,代码来源:MICmdCmdGdbInfo.cpp

示例4: 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
CMICmdCmdExecRun::Execute()
{
    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
    lldb::SBError error;
    lldb::SBStream errMsg;
    lldb::SBLaunchInfo launchInfo = rSessionInfo.GetTarget().GetLaunchInfo();
    launchInfo.SetListener(rSessionInfo.GetListener());

    // Run to first instruction or main() requested?
    CMICMDBASE_GETOPTION(pArgStart, OptionLong, m_constStrArgStart);
    if (pArgStart->GetFound())
    {
        launchInfo.SetLaunchFlags(launchInfo.GetLaunchFlags() | lldb::eLaunchFlagStopAtEntry);
    }

    lldb::SBProcess process = rSessionInfo.GetTarget().Launch(launchInfo, error);
    if ((!process.IsValid()) || (error.Fail()))
    {
        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_PROCESS), m_cmdData.strMiCmd.c_str(), errMsg.GetData()));
        return MIstatus::failure;
    }

    if (!CMIDriver::Instance().SetDriverStateRunningDebugging())
    {
        const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE), m_cmdData.strMiCmd.c_str(), rErrMsg.c_str()));
        return MIstatus::failure;
    }
    return MIstatus::success;
}
开发者ID:2asoft,项目名称:freebsd,代码行数:40,代码来源:MICmdCmdExec.cpp

示例5: ClrErrorDescription

//++ ------------------------------------------------------------------------------------
// Details: Determine and form the medium file's directory path and name.
// Type:    Method.
// Args:    None.
// Return:  MIstatus::success - Functional succeeded.
//          MIstatus::failure - Functional failed.
// Throws:  None.
//--
bool
CMICmnLogMediumFile::FileFormFileNamePath()
{
    ClrErrorDescription();

    m_fileNamePath = MIRSRC(IDS_MEDIUMFILE_ERR_INVALID_PATH);

    if (m_strMediumFileDirectory.compare(MIRSRC(IDS_MEDIUMFILE_ERR_INVALID_PATH)) != 0)
    {
        CMIUtilDateTimeStd date;
        m_strMediumFileName = CMIUtilString::Format(m_constMediumFileNameFormat.c_str(), date.GetDateTimeLogFilename().c_str());

#if defined(_MSC_VER)
        m_fileNamePath = CMIUtilString::Format("%s\\%s", m_strMediumFileDirectory.c_str(), m_strMediumFileName.c_str());
#else
        m_fileNamePath = CMIUtilString::Format("%s/%s", m_strMediumFileDirectory.c_str(), m_strMediumFileName.c_str());
#endif // defined ( _MSC_VER )

        return MIstatus::success;
    }

    SetErrorDescription(MIRSRC(IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS));

    return MIstatus::failure;
}
开发者ID:JuliaLang,项目名称:lldb,代码行数:33,代码来源:MICmnLogMediumFile.cpp

示例6: SetErrorDescription

//++ ------------------------------------------------------------------------------------
// Details: Register a command's creator function with the command identifier the MI
//          command name i.e. 'file-exec-and-symbols'.
// Type:    Method.
// Args:    vMiCmd          - (R) Command's name, the MI command.
//          vCmdCreateFn    - (R) Command's creator function pointer.
// Return:  MIstatus::success - Functionality succeeded.
//          MIstatus::failure - Functionality failed.
// Throws:  None.
//--
bool
CMICmdFactory::CmdRegister(const CMIUtilString &vMiCmd, CmdCreatorFnPtr vCmdCreateFn)
{
    if (!IsValid(vMiCmd))
    {
        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_INVALID_CMD_NAME), vMiCmd.c_str()));
        return MIstatus::failure;
    }
    if (vCmdCreateFn == nullptr)
    {
        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN), vMiCmd.c_str()));
        return MIstatus::failure;
    }

    if (HaveAlready(vMiCmd))
    {
        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED), vMiCmd.c_str()));
        return MIstatus::failure;
    }

    MapPairMiCmdToCmdCreatorFn_t pr(vMiCmd, vCmdCreateFn);
    m_mapMiCmdToCmdCreatorFn.insert(pr);

    return MIstatus::success;
}
开发者ID:gnuhub,项目名称:lldb,代码行数:35,代码来源:MICmdFactory.cpp

示例7: ClrErrorDescription

//++ ------------------------------------------------------------------------------------
// Details:	Determine and form the medium file's directory path and name.
// Type:	Method.
// Args:	None.
// Return:	MIstatus::success - Functional succeeded.
//			MIstatus::failure - Functional failed.
// Throws:	None.
//--
bool CMICmnLogMediumFile::FileFormFileNamePath( void )
{
	ClrErrorDescription();

	m_fileNamePath = MIRSRC( IDS_MEDIUMFILE_ERR_INVALID_PATH );

	CMIUtilString strPathName;
	if( CMIUtilSystem().GetLogFilesPath( strPathName ) )
	{
		const CMIUtilString strPath = CMIUtilFileStd().StripOffFileName( strPathName );

		// ToDo: Review this LINUX log file quick fix so not hidden
        // AD: 
        //      Linux was creating a log file here called '.\log.txt'.  The '.' on linux
        //      signifies that this file is 'hidden' and not normally visible.  A quick fix
        //      is to remove the path component all together.  Linux also normally uses '/'
        //      as directory separators, again leading to the problem of the hidden log.
#if defined ( _MSC_VER )
        m_fileNamePath = CMIUtilString::Format( "%s\\%s", strPath.c_str(), m_constMediumFileName.c_str() );
#else
        m_fileNamePath = CMIUtilString::Format( "%s", m_constMediumFileName.c_str() );
#endif // defined ( _MSC_VER )

		return MIstatus::success;
	}

	SetErrorDescription( MIRSRC( IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS ) );
	
	return MIstatus::failure;
}
开发者ID:chee-z,项目名称:lldb,代码行数:38,代码来源:MICmnLogMediumFile.cpp

示例8: 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 CMICmdCmdEnvironmentCd::Execute() {
  CMICMDBASE_GETOPTION(pArgPathDir, File, m_constStrArgNamePathDir);
  const CMIUtilString &strWkDir(pArgPathDir->GetValue());
  CMICmnLLDBDebugger &rDbg(CMICmnLLDBDebugger::Instance());
  lldb::SBDebugger &rLldbDbg = rDbg.GetTheDebugger();
  bool bOk = rLldbDbg.SetCurrentPlatformSDKRoot(strWkDir.c_str());
  if (bOk) {
    const CMIUtilString &rStrKeyWkDir(
        m_rLLDBDebugSessionInfo.m_constStrSharedDataKeyWkDir);
    if (!m_rLLDBDebugSessionInfo.SharedDataAdd<CMIUtilString>(rStrKeyWkDir,
                                                              strWkDir)) {
      SetError(CMIUtilString::Format(MIRSRC(IDS_DBGSESSION_ERR_SHARED_DATA_ADD),
                                     m_cmdData.strMiCmd.c_str(),
                                     rStrKeyWkDir.c_str()));
      bOk = MIstatus::failure;
    }
  } else
    SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_FNFAILED),
                                   m_cmdData.strMiCmd.c_str(),
                                   "SetCurrentPlatformSDKRoot()"));

  lldb::SBTarget sbTarget = m_rLLDBDebugSessionInfo.GetTarget();
  if (sbTarget.IsValid()) {
    lldb::SBLaunchInfo sbLaunchInfo = sbTarget.GetLaunchInfo();
    sbLaunchInfo.SetWorkingDirectory(strWkDir.c_str());
    sbTarget.SetLaunchInfo(sbLaunchInfo);
  }

  return bOk;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:42,代码来源:MICmdCmdEnviro.cpp

示例9: SetErrorDescription

//++ ------------------------------------------------------------------------------------
// Details: Register with the debugger, the SBListener, the type of events you are interested
//          in. Others, like commands, may have already set the mask.
// Type:    Method.
// Args:    vClientName     - (R) ID of the client who wants these events set.
//          vBroadcaster    - (R) An SBBroadcaster's derived class.
//          vEventMask      - (R) The mask of events to listen for.
// Return:  MIstatus::success - Functionality succeeded.
//          MIstatus::failure - Functionality failed.
// Throws:  None.
//--
bool
CMICmnLLDBDebugger::RegisterForEvent(const CMIUtilString &vClientName, const lldb::SBBroadcaster &vBroadcaster, const MIuint vEventMask)
{
    const char *pBroadcasterName = vBroadcaster.GetName();
    if (pBroadcasterName == nullptr)
    {
        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_BROADCASTER_NAME), MIRSRC(IDS_WORD_INVALIDNULLPTR)));
        return MIstatus::failure;
    }
    CMIUtilString broadcasterName(pBroadcasterName);
    if (broadcasterName.length() == 0)
    {
        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_BROADCASTER_NAME), MIRSRC(IDS_WORD_INVALIDEMPTY)));
        return MIstatus::failure;
    }

    MIuint existingMask = 0;
    if (!BroadcasterGetMask(broadcasterName, existingMask))
        return MIstatus::failure;

    if (!ClientSaveMask(vClientName, broadcasterName, vEventMask))
        return MIstatus::failure;

    MIuint eventMask = vEventMask;
    eventMask += existingMask;
    const MIuint result = m_lldbListener.StartListeningForEvents(vBroadcaster, eventMask);
    if (result == 0)
    {
        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_STARTLISTENER), pBroadcasterName));
        return MIstatus::failure;
    }

    return BroadcasterSaveMask(broadcasterName, eventMask);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:45,代码来源:MICmnLLDBDebugger.cpp

示例10: SetErrorDescription

//++ ------------------------------------------------------------------------------------
// Details:	Create a command given the specified MI command name. The command data object
//			contains the options for the command.
// Type:	Method.
// Args:	vMiCmd		- (R) Command's name, the MI command.
//			vCmdData	- (RW) Command's metadata status/information/result object.		
//			vpNewCmd	- (W) New command instance.
// Return:	MIstatus::success - Functionality succeeded.
//			MIstatus::failure - Functionality failed.
// Throws:	None.
//--
bool CMICmdFactory::CmdCreate( const CMIUtilString & vMiCmd, const SMICmdData & vCmdData, CMICmdBase *& vpNewCmd )
{
	bool bOk = MIstatus::success;

	vpNewCmd = nullptr;

	if( !IsValid( vMiCmd ) )
	{
		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMDFACTORY_ERR_INVALID_CMD_NAME ), vMiCmd.c_str() ) );
		return MIstatus::failure;
	}
	if( !HaveAlready( vMiCmd ) )
	{
		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED ), vMiCmd.c_str() ) );
		return MIstatus::failure;
	}

	const MapMiCmdToCmdCreatorFn_t::const_iterator it = m_mapMiCmdToCmdCreatorFn.find( vMiCmd );
	const CMIUtilString & rMiCmd( (*it).first ); MIunused( rMiCmd );
	CmdCreatorFnPtr pFn = (*it).second;
	CMICmdBase * pCmd = (*pFn)();

	SMICmdData cmdData( vCmdData );
	cmdData.id = pCmd->GetGUID();
	bOk = pCmd->SetCmdData( cmdData );
	if( bOk )
		vpNewCmd = pCmd;

	return bOk;
}
开发者ID:Jean-Daniel,项目名称:lldb,代码行数:41,代码来源:MICmdFactory.cpp

示例11: MIRSRC

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the resource text data for the given resource ID. If a resource ID
//          cannot be found and error is given returning the ID of the resource that
//          cannot be located.
// Type:    Method.
// Args:    vResourceId         - (R) MI resource ID.
//          vrwResourceString   - (W) Text.
// Return:  MIstatus::success - Functional succeeded.
//          MIstatus::failure - Functional failed.
// Throws:  None.
//--
bool
CMICmnResources::GetStringFromResource(const MIuint vResourceId, CMIUtilString &vrwResourceString) const
{
    MapRscrIdToTextData_t::const_iterator it = m_mapRscrIdToTextData.find(vResourceId);
    if (it == m_mapRscrIdToTextData.end())
    {
        // Check this is a static variable init that needs this before we are ready
        if (!m_bInitialized)
        {
            (const_cast<CMICmnResources *>(this))->Initialize();
            it = m_mapRscrIdToTextData.find(vResourceId);
            if (it == m_mapRscrIdToTextData.end())
            {
                vrwResourceString = MIRSRC(IDS_RESOURCES_ERR_STRING_TABLE_INVALID);
                return MIstatus::failure;
            }
        }

        if (it == m_mapRscrIdToTextData.end())
        {
            vrwResourceString = CMIUtilString::Format(MIRSRC(IDS_RESOURCES_ERR_STRING_NOT_FOUND), vResourceId);
            return MIstatus::failure;
        }
    }

    const MIuint nRsrcId((*it).first);
    MIunused(nRsrcId);
    const MIchar *pRsrcData((*it).second);

    // Return result
    vrwResourceString = pRsrcData;

    return MIstatus::success;
}
开发者ID:CTSRD-CHERI,项目名称:lldb,代码行数:45,代码来源:MICmnResources.cpp

示例12: SetErrorDescriptionn

//++ ------------------------------------------------------------------------------------
// Details:	Write data to existing opened file.
// Type:	Method.
// Args:	vData - (R) Text data.
// Return:	MIstatus::success - Functional succeeded.
//			MIstatus::failure - Functional failed.
// Throws:	None.
//--
bool CMIUtilFileStd::Write( const CMIUtilString & vData )
{
	if( vData.size() == 0 )
		return MIstatus::success;

	if( m_bFileError )
		return MIstatus::failure;

	if( m_pFileHandle == nullptr )
	{
		m_bFileError = true;
		SetErrorDescriptionn( MIRSRC( IDE_UTIL_FILE_ERR_WRITING_NOTOPEN ), m_fileNamePath.c_str() );
		return MIstatus::failure;
	}

	// Get the string size
	MIuint size = vData.size();
	if( ::fwrite( vData.c_str(), 1, size, m_pFileHandle ) == size )
	{
		// Flush the data to the file
		::fflush( m_pFileHandle );
		return MIstatus::success;
	}
	
	// Not all of the data has been transferred
	m_bFileError = true;
	SetErrorDescriptionn( MIRSRC( IDE_UTIL_FILE_ERR_WRITING_FILE ), m_fileNamePath.c_str() );
	return MIstatus::failure;
}
开发者ID:chee-z,项目名称:lldb,代码行数:37,代码来源:MIUtilFileStd.cpp

示例13: 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 CMICmdCmdBreakCondition::Execute( void )
{
	CMICMDBASE_GETOPTION( pArgNumber, Number, m_constStrArgNamedNumber );
	CMICMDBASE_GETOPTION( pArgExpr, String, m_constStrArgNamedExpr );					

	m_nBrkPtId = pArgNumber->GetValue();
	m_strBrkPtExpr = pArgExpr->GetValue();
	m_strBrkPtExpr += GetRestOfExpressionNotSurroundedInQuotes();

	CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
	lldb::SBBreakpoint brkPt = rSessionInfo.m_lldbTarget.FindBreakpointByID( static_cast< lldb::break_id_t >( m_nBrkPtId ) );
	if( brkPt.IsValid() )
	{
		brkPt.SetCondition( m_strBrkPtExpr.c_str() );

		CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfo;
		if( !rSessionInfo.RecordBrkPtInfoGet( m_nBrkPtId, sBrkPtInfo ) )
		{
			SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_BRKPT_INFO_OBJ_NOT_FOUND ), m_cmdData.strMiCmd.c_str(), m_nBrkPtId ) );
			return MIstatus::failure;
		}
		sBrkPtInfo.m_strCondition = m_strBrkPtExpr;
		rSessionInfo.RecordBrkPtInfo( m_nBrkPtId, sBrkPtInfo );
	}
	else
	{
		const CMIUtilString strBrkPtId( CMIUtilString::Format( "%d", m_nBrkPtId ) );
		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_BRKPT_INVALID ), m_cmdData.strMiCmd.c_str(), strBrkPtId.c_str() ) );
		return MIstatus::failure;
	}

	return MIstatus::success;
}
开发者ID:Jean-Daniel,项目名称:lldb,代码行数:42,代码来源:MICmdCmdBreak.cpp

示例14: errMsg

//++ ------------------------------------------------------------------------------------
// Details: Having previously had the potential command validated and found valid now
//          get the command executed.
//          If the Functionalityity returns MIstatus::failure call GetErrorDescription().
//          This function is used by the application's main thread.
// Type:    Method.
// Args:    vCmdData    - (RW) Command meta data.
// Return:  MIstatus::success - Functionality succeeded.
//          MIstatus::failure - Functionality failed.
// Throws:  None.
//--
bool
CMICmdMgr::CmdExecute(const SMICmdData &vCmdData)
{
    bool bOk = MIstatus::success;

    // Pass the command's meta data structure to the command
    // so it can update it if required. (Need to copy it out of the
    // command before the command is deleted)
    CMICmdBase *pCmd = nullptr;
    bOk = m_factory.CmdCreate(vCmdData.strMiCmd, vCmdData, pCmd);
    if (!bOk)
    {
        const CMIUtilString errMsg(
            CMIUtilString::Format(MIRSRC(IDS_CMDMGR_ERR_CMD_FAILED_CREATE), m_factory.GetErrorDescription().c_str()));
        SetErrorDescription(errMsg);
        return MIstatus::failure;
    }

    bOk = m_invoker.CmdExecute(*pCmd);
    if (!bOk)
    {
        const CMIUtilString errMsg(CMIUtilString::Format(MIRSRC(IDS_CMDMGR_ERR_CMD_INVOKER), m_invoker.GetErrorDescription().c_str()));
        SetErrorDescription(errMsg);
        return MIstatus::failure;
    }

    return bOk;
}
开发者ID:CODECOMMUNITY,项目名称:lldb,代码行数:39,代码来源:MICmdMgr.cpp

示例15: miValueConst

//++
//------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command prepares a MI Record
// Result
//          for the work carried out in the Execute() method.
// Type:    Overridden.
// Args:    None.
// Return:  MIstatus::success - Functional succeeded.
//          MIstatus::failure - Functional failed.
// Throws:  None.
//--
bool CMICmdCmdGdbSet::Acknowledge() {
  // Print error if option isn't recognized:
  // ^error,msg="The request '%s' was not recognized, not implemented"
  if (!m_bGdbOptionRecognised) {
    const CMICmnMIValueConst miValueConst(
        CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND),
                              m_strGdbOptionName.c_str()));
    const CMICmnMIValueResult miValueResult("msg", miValueConst);
    const CMICmnMIResultRecord miRecordResult(
        m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
        miValueResult);
    m_miResultRecord = miRecordResult;
    return MIstatus::success;
  }

  // ^done,value="%s"
  if (m_bGdbOptionFnSuccessful) {
    const CMICmnMIResultRecord miRecordResult(
        m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
    m_miResultRecord = miRecordResult;
    return MIstatus::success;
  }

  // Print error if request failed:
  // ^error,msg="The request '%s' failed.
  const CMICmnMIValueConst miValueConst(CMIUtilString::Format(
      MIRSRC(IDS_CMD_ERR_INFO_PRINTFN_FAILED), m_strGdbOptionFnError.c_str()));
  const CMICmnMIValueResult miValueResult("msg", miValueConst);
  const CMICmnMIResultRecord miRecordResult(
      m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
      miValueResult);
  m_miResultRecord = miRecordResult;

  return MIstatus::success;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:46,代码来源:MICmdCmdGdbSet.cpp


注:本文中的MIRSRC函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。