本文整理汇总了C++中SBError::Fail方法的典型用法代码示例。如果您正苦于以下问题:C++ SBError::Fail方法的具体用法?C++ SBError::Fail怎么用?C++ SBError::Fail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SBError
的用法示例。
在下文中一共展示了SBError::Fail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: error
int
main (int argc, char const *argv[], const char *envp[])
{
SBDebugger::Initialize();
SBHostOS::ThreadCreated ("<lldb.driver.main-thread>");
signal (SIGPIPE, SIG_IGN);
signal (SIGWINCH, sigwinch_handler);
signal (SIGINT, sigint_handler);
signal (SIGTSTP, sigtstp_handler);
signal (SIGCONT, sigcont_handler);
// Create a scope for driver so that the driver object will destroy itself
// before SBDebugger::Terminate() is called.
{
Driver driver;
bool exiting = false;
SBError error (driver.ParseArgs (argc, argv, stdout, exiting));
if (error.Fail())
{
const char *error_cstr = error.GetCString ();
if (error_cstr)
::fprintf (stderr, "error: %s\n", error_cstr);
}
else if (!exiting)
{
driver.MainLoop ();
}
}
SBDebugger::Terminate();
return 0;
}
示例2: if
//.........这里部分代码省略.........
}
else if (!m_option_data.m_process_name.empty())
{
commands_stream.Printf ("process attach --name %s", EscapeString(m_option_data.m_process_name).c_str());
if (m_option_data.m_wait_for)
commands_stream.Printf(" --waitfor");
commands_stream.Printf("\n");
}
else if (LLDB_INVALID_PROCESS_ID != m_option_data.m_process_pid)
{
commands_stream.Printf ("process attach --pid %" PRIu64 "\n", m_option_data.m_process_pid);
}
WriteCommandsForSourcing(eCommandPlacementAfterFile, commands_stream);
if (GetDebugMode())
{
result.PutError(m_debugger.GetErrorFileHandle());
result.PutOutput(m_debugger.GetOutputFileHandle());
}
bool handle_events = true;
bool spawn_thread = false;
if (m_option_data.m_repl)
{
const char *repl_options = NULL;
if (!m_option_data.m_repl_options.empty())
repl_options = m_option_data.m_repl_options.c_str();
SBError error (m_debugger.RunREPL(m_option_data.m_repl_lang, repl_options));
if (error.Fail())
{
const char *error_cstr = error.GetCString();
if (error_cstr && error_cstr[0])
fprintf (stderr, "error: %s\n", error_cstr);
else
fprintf (stderr, "error: %u\n", error.GetError());
}
}
else
{
// Check if we have any data in the commands stream, and if so, save it to a temp file
// so we can then run the command interpreter using the file contents.
const char *commands_data = commands_stream.GetData();
const size_t commands_size = commands_stream.GetSize();
// The command file might have requested that we quit, this variable will track that.
bool quit_requested = false;
bool stopped_for_crash = false;
if (commands_data && commands_size)
{
int initial_commands_fds[2];
bool success = true;
FILE *commands_file = PrepareCommandsForSourcing (commands_data, commands_size, initial_commands_fds);
if (commands_file)
{
m_debugger.SetInputFileHandle (commands_file, true);
// Set the debugger into Sync mode when running the command file. Otherwise command files
// that run the target won't run in a sensible way.
bool old_async = m_debugger.GetAsync();
m_debugger.SetAsync(false);
int num_errors;