本文整理汇总了C++中lldb::SBError::GetCString方法的典型用法代码示例。如果您正苦于以下问题:C++ SBError::GetCString方法的具体用法?C++ SBError::GetCString怎么用?C++ SBError::GetCString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lldb::SBError
的用法示例。
在下文中一共展示了SBError::GetCString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DriverParseArgs
//++ ------------------------------------------------------------------------------------
// 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;
}
示例2: HandleSBError
//++
// Details: Short cut function to check MI command's execute status and
// set an error in case of failure.
// Type: Method.
// Args: error - (R) Error description object.
// successHandler - (R) function describing actions to execute
// in case of success state of passed SBError object.
// errorHandler - (R) function describing actions to execute
// in case of fail status of passed SBError object.
// Return: bool.
// Throws: None.
//--
bool CMICmdBase::HandleSBError(const lldb::SBError &error,
const std::function<bool()> &successHandler,
const std::function<void()> &errorHandler) {
if (error.Success())
return successHandler();
SetError(error.GetCString());
errorHandler();
return MIstatus::failure;
}
示例3: filename_spec
lldb::SBTarget
SBDebugger::CreateTarget (const char *filename,
const char *target_triple,
const char *platform_name,
bool add_dependent_modules,
lldb::SBError& sb_error)
{
SBTarget sb_target;
TargetSP target_sp;
if (m_opaque_sp)
{
sb_error.Clear();
FileSpec filename_spec (filename, true);
OptionGroupPlatform platform_options (false);
platform_options.SetPlatformName (platform_name);
sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
filename_spec,
target_triple,
add_dependent_modules,
&platform_options,
target_sp);
if (sb_error.Success())
sb_target.SetSP (target_sp);
}
else
{
sb_error.SetErrorString("invalid target");
}
LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
{
log->Printf ("SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, platform_name=%s, add_dependent_modules=%u, error=%s) => SBTarget(%p)",
m_opaque_sp.get(),
filename,
target_triple,
platform_name,
add_dependent_modules,
sb_error.GetCString(),
target_sp.get());
}
return sb_target;
}