本文整理汇总了C++中LLDBCommand::FillEnvFromMemory方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDBCommand::FillEnvFromMemory方法的具体用法?C++ LLDBCommand::FillEnvFromMemory怎么用?C++ LLDBCommand::FillEnvFromMemory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDBCommand
的用法示例。
在下文中一共展示了LLDBCommand::FillEnvFromMemory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDebugQuickDebug
void LLDBPlugin::OnDebugQuickDebug(clDebugEvent& event)
{
#ifdef __WXMSW__
::wxMessageBox(
_("Quick Debug with LLDB is not supported under Windows"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING);
return;
#endif
if(!DoInitializeDebugger(event, true)) {
return;
}
LLDBConnectReturnObject retObj;
LLDBSettings settings;
settings.Load();
if(m_connector.Connect(retObj, settings, 5)) {
// Apply the environment
EnvSetter env;
// Get list of breakpoints and add them ( we will apply them later on )
BreakpointInfo::Vec_t gdbBps;
m_mgr->GetAllBreakpoints(gdbBps);
// remove all breakpoints from previous session
m_connector.DeleteAllBreakpoints();
// apply the serialized breakpoints
// In 'Quick Debug' we stop on main
m_connector.AddBreakpoint("main");
m_connector.AddBreakpoints(gdbBps);
LLDBCommand startCommand;
startCommand.FillEnvFromMemory();
startCommand.SetExecutable(event.GetExecutableName());
startCommand.SetCommandArguments(event.GetArguments());
startCommand.SetWorkingDirectory(event.GetWorkingDirectory());
startCommand.SetStartupCommands(event.GetStartupCommands());
startCommand.SetRedirectTTY(m_terminalTTY);
m_connector.Start(startCommand);
} else {
// Failed to connect, notify and perform cleanup
DoCleanup();
wxString message;
message << _("Could not connect to codelite-lldb at '") << m_connector.GetConnectString() << "'";
::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER);
return;
}
}
示例2: OnDebugCoreFile
void LLDBPlugin::OnDebugCoreFile(clDebugEvent& event)
{
if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) {
event.Skip();
return;
}
#ifdef __WXMSW__
::wxMessageBox(
_("Debug core file with LLDB is not supported under Windows"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING);
return;
#endif
if(!DoInitializeDebugger(event, false)) {
return;
}
LLDBConnectReturnObject retObj;
LLDBSettings settings;
settings.Load();
if(m_connector.Connect(retObj, settings, 5)) {
// Apply the environment
EnvSetter env;
// remove all breakpoints from previous session
m_connector.DeleteAllBreakpoints();
LLDBCommand startCommand;
startCommand.FillEnvFromMemory();
startCommand.SetCommandType(kCommandDebugCoreFile);
startCommand.SetExecutable(event.GetExecutableName());
startCommand.SetCorefile(event.GetCoreFile());
startCommand.SetWorkingDirectory(event.GetWorkingDirectory());
startCommand.SetRedirectTTY(m_terminalTTY);
m_connector.OpenCoreFile(startCommand);
} else {
// Failed to connect, notify and perform cleanup
DoCleanup();
wxString message;
message << _("Could not connect to codelite-lldb at '") << m_connector.GetConnectString() << "'";
::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER);
return;
}
}
示例3: OnDebugStart
//.........这里部分代码省略.........
}
// Determine the executable to debug, working directory and arguments
EnvSetter env(NULL, NULL, pProject ? pProject->GetName() : wxString(), bldConf->GetName());
wxString exepath = bldConf->GetCommand();
wxString args;
wxString workingDirectory;
// Get the debugging arguments.
if(bldConf->GetUseSeparateDebugArgs()) {
args = bldConf->GetDebugArgs();
} else {
args = bldConf->GetCommandArguments();
}
workingDirectory = ::ExpandVariables(bldConf->GetWorkingDirectory(), pProject, m_mgr->GetActiveEditor());
exepath = ::ExpandVariables(exepath, pProject, m_mgr->GetActiveEditor());
{
DirSaver ds;
::wxSetWorkingDirectory(workingDirectory);
wxFileName execToDebug(exepath);
if(execToDebug.IsRelative()) { execToDebug.MakeAbsolute(); }
//////////////////////////////////////////////////////////////////////
// Launch terminal for IO redirection
//////////////////////////////////////////////////////////////////////
TerminateTerminal();
bool isWindows = wxPlatformInfo::Get().GetOperatingSystemId() & wxOS_WINDOWS;
if(!bldConf->IsGUIProgram() && !isWindows) {
m_debuggerTerminal.Launch(clDebuggerTerminalPOSIX::MakeExeTitle(execToDebug.GetFullPath(), args));
if(m_debuggerTerminal.IsValid()) {
CL_DEBUG("Successfully launched terminal %s", m_debuggerTerminal.GetTty());
} else {
// Failed to launch it...
DoCleanup();
::wxMessageBox(_("Failed to start terminal for debugger"), "CodeLite",
wxICON_ERROR | wxOK | wxCENTER);
return;
}
}
if(!isWindows) { workingDirectory = ::wxGetCwd(); }
CL_DEBUG("LLDB: Using executable : " + execToDebug.GetFullPath());
CL_DEBUG("LLDB: Working directory: " + workingDirectory);
//////////////////////////////////////////////////////////////////////
// Initiate the connection to codelite-lldb
//////////////////////////////////////////////////////////////////////
LLDBConnectReturnObject retObj;
if(m_connector.Connect(retObj, settings, 5)) {
// Get list of breakpoints and add them ( we will apply them later on )
BreakpointInfo::Vec_t gdbBps;
m_mgr->GetAllBreakpoints(gdbBps);
// remove all breakpoints from previous session
m_connector.DeleteAllBreakpoints();
// apply the serialized breakpoints
m_connector.AddBreakpoints(gdbBps);
// Setup pivot folder if needed
SetupPivotFolder(retObj);
LLDBCommand startCommand;
startCommand.FillEnvFromMemory();
// If the current platform is Windows, use the executable as it appears in the project settings
startCommand.SetExecutable(isWindows ? exepath : execToDebug.GetFullPath());
startCommand.SetCommandArguments(args);
// Since we called 'wxSetWorkingDirectory' earlier, wxGetCwd() should give use the
// correct working directory for the debugger
startCommand.SetWorkingDirectory(workingDirectory);
startCommand.SetRedirectTTY(m_debuggerTerminal.GetTty());
m_connector.Start(startCommand);
clDebugEvent cl_event(wxEVT_DEBUG_STARTED);
EventNotifier::Get()->AddPendingEvent(cl_event);
} else {
// Failed to connect, notify and perform cleanup
DoCleanup();
wxString message;
message << _("Could not connect to codelite-lldb at '")
<< (settings.IsUsingRemoteProxy() ? settings.GetTcpConnectString()
: m_connector.GetConnectString())
<< "'";
::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER);
return;
}
}
}
CL_DEBUG("LLDB: Working directory is restored to: " + ::wxGetCwd());
}