本文整理汇总了C++中LLDBSettings类的典型用法代码示例。如果您正苦于以下问题:C++ LLDBSettings类的具体用法?C++ LLDBSettings怎么用?C++ LLDBSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLDBSettings类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializeUI
void LLDBPlugin::OnLLDBStarted(LLDBEvent& event)
{
event.Skip();
InitializeUI();
LoadLLDBPerspective();
// If this is a normal debug session, a start notification
// should follow a 'Run' command
switch(event.GetSessionType()) {
case kDebugSessionTypeCore:
CL_DEBUG("CODELITE>> LLDB started (core file)");
break;
case kDebugSessionTypeAttach: {
LLDBSettings settings;
m_raisOnBpHit = settings.Load().IsRaiseWhenBreakpointHit();
CL_DEBUG("CODELITE>> LLDB started (attached)");
m_connector.SetAttachedToProcess(event.GetSessionType() == kDebugSessionTypeAttach);
// m_connector.Continue();
break;
}
case kDebugSessionTypeNormal: {
LLDBSettings settings;
m_raisOnBpHit = settings.Load().IsRaiseWhenBreakpointHit();
CL_DEBUG("CODELITE>> LLDB started (normal)");
m_connector.Run();
break;
}
}
wxCommandEvent e2(wxEVT_DEBUG_STARTED);
EventNotifier::Get()->AddPendingEvent(e2);
}
示例2:
FolderMappingDlg::~FolderMappingDlg()
{
LLDBSettings settings;
settings.Load();
settings.SetLastLocalFolder(m_dirPickerLocal->GetPath() );
settings.SetLastRemoteFolder(m_textCtrlRemote->GetValue() );
settings.Save();
}
示例3: FolderMappingBaseDlg
FolderMappingDlg::FolderMappingDlg(wxWindow* parent)
: FolderMappingBaseDlg(parent)
{
LLDBSettings settings;
settings.Load();
m_dirPickerLocal->SetPath( settings.GetLastLocalFolder() );
m_textCtrlRemote->ChangeValue( settings.GetLastRemoteFolder() );
}
示例4: Connect
bool LLDBConnector::Connect(LLDBConnectReturnObject &ret, const LLDBSettings& settings, int timeout)
{
ret.Clear();
if ( settings.IsUsingRemoteProxy() ) {
return ConnectToRemoteDebugger(settings.GetProxyIp(), settings.GetProxyPort(), ret, timeout);
} else {
return ConnectToLocalDebugger(ret, timeout);
}
}
示例5: GetConnectString
wxString LLDBConnector::GetConnectString() const
{
wxString connectString;
LLDBSettings settings;
bool useTcp = settings.Load().IsUsingRemoteProxy();
if(useTcp) {
connectString << settings.GetProxyIp() << ":" << settings.GetProxyPort();
} else {
connectString << GetDebugServerPath();
}
return connectString;
}
示例6: _
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;
}
}
示例7: _
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;
}
}
示例8: TerminateTerminal
bool LLDBPlugin::DoInitializeDebugger(clDebugEvent& event, bool redirectOutput, const wxString& terminalTitle)
{
if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) {
event.Skip();
return false;
}
if(m_connector.IsRunning()) {
// Another debug session is already in progress
::wxMessageBox(_("Another debug session is already in progress. Please stop it first"),
"CodeLite",
wxOK | wxCENTER | wxICON_WARNING);
return false;
}
TerminateTerminal();
// If terminal is required, launch it now
bool isWindows = wxPlatformInfo::Get().GetOperatingSystemId() & wxOS_WINDOWS;
if(redirectOutput && !isWindows) {
wxString realPts;
::LaunchTerminalForDebugger(
terminalTitle.IsEmpty() ? event.GetExecutableName() : terminalTitle, m_terminalTTY, realPts, m_terminalPID);
if(m_terminalPID != wxNOT_FOUND) {
CL_DEBUG("Successfully launched terminal");
} else {
// Failed to launch it...
DoCleanup();
::wxMessageBox(_("Failed to start terminal for debugger"), "CodeLite", wxICON_ERROR | wxOK | wxCENTER);
return false;
}
}
// Launch local server if needed
LLDBSettings settings;
settings.Load();
if(!settings.IsUsingRemoteProxy() && !m_connector.LaunchLocalDebugServer()) {
DoCleanup();
return false;
}
return true;
}
示例9: Start
void LLDBConnector::Start(const LLDBCommand& runCommand)
{
LLDBCommand startCommand;
startCommand.SetExecutable(runCommand.GetExecutable());
startCommand.SetCommandType(kCommandStart);
startCommand.SetWorkingDirectory(runCommand.GetWorkingDirectory());
// send the settings as well
LLDBSettings settings;
settings.Load();
startCommand.SetSettings(settings);
SendCommand(startCommand);
// stash the runCommand for the future 'Run()' call
m_runCommand.Clear();
m_runCommand = runCommand;
m_runCommand.SetCommandType(kCommandRun);
}
示例10: CL_DEBUG
void LLDBPlugin::OnDebugStart(clDebugEvent& event)
{
if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) {
event.Skip();
return;
}
CL_DEBUG("LLDB: Initial working directory is restored to: " + ::wxGetCwd());
{
// Get the executable to debug
wxString errMsg;
ProjectPtr pProject = clCxxWorkspaceST::Get()->FindProjectByName(event.GetProjectName(), errMsg);
if(!pProject) {
::wxMessageBox(wxString() << _("Could not locate project: ") << event.GetProjectName(), "LLDB Debugger",
wxICON_ERROR | wxOK | wxCENTER);
return;
}
DirSaver ds;
::wxSetWorkingDirectory(pProject->GetFileName().GetPath());
// Load LLDB settings
LLDBSettings settings;
settings.Load();
BuildConfigPtr bldConf = clCxxWorkspaceST::Get()->GetProjBuildConf(pProject->GetName(), wxEmptyString);
if(!bldConf) {
::wxMessageBox(wxString() << _("Could not locate the requested buid configuration"), "LLDB Debugger",
wxICON_ERROR | wxOK | wxCENTER);
return;
}
// Launch codelite-lldb now.
// Choose wether we need to debug a local or remote target
// Honour the project settings
if(bldConf->GetIsDbgRemoteTarget()) {
long nPort(wxNOT_FOUND);
bldConf->GetDbgHostPort().ToCLong(&nPort);
settings.SetProxyIp(bldConf->GetDbgHostName());
settings.SetProxyPort(nPort);
settings.EnableFlag(kLLDBOptionUseRemoteProxy, true);
}
if(!settings.IsUsingRemoteProxy()) {
// Not using a remote proxy, launch the debug server
if(!m_connector.LaunchLocalDebugServer(settings.GetDebugserver())) { return; }
}
// 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
//////////////////////////////////////////////////////////////////////
//.........这里部分代码省略.........