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


C++ clDebugEvent::GetProjectName方法代码示例

本文整理汇总了C++中clDebugEvent::GetProjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ clDebugEvent::GetProjectName方法的具体用法?C++ clDebugEvent::GetProjectName怎么用?C++ clDebugEvent::GetProjectName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clDebugEvent的用法示例。


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

示例1: OnDebugStart

void LLDBDebuggerPlugin::OnDebugStart(clDebugEvent& event)
{
    event.Skip();
    return;
    
    if ( ::PromptForYesNoDialogWithCheckbox(_("Would you like to use LLDB debugger as your primary debugger?"), "UseLLDB") != wxID_YES ) {
        event.Skip();
        return;
    }
    
    // Get the executable to debug
    wxString errMsg;
    ProjectPtr pProject = WorkspaceST::Get()->FindProjectByName(event.GetProjectName(), errMsg);
    if ( !pProject ) {
        event.Skip();
        return;
    }
    
    wxSetWorkingDirectory ( pProject->GetFileName().GetPath() );
    BuildConfigPtr bldConf = WorkspaceST::Get()->GetProjBuildConf ( pProject->GetName(), wxEmptyString );
    if ( !bldConf ) {
        event.Skip();
        return;
    }
    
    // Show the terminal
    ShowTerminal("LLDB Console Window");
    if ( m_debugger.Start("/home/eran/devl/TestArea/TestHang/Debug/TestHang") ) {
        m_debugger.AddBreakpoint("main");
        m_debugger.ApplyBreakpoints();
        m_debugger.Run("/tmp/in", "/tmp/out", "/tmp/err", wxArrayString(), wxArrayString(), ::wxGetCwd());
    }
}
开发者ID:idkqh7,项目名称:codelite,代码行数:33,代码来源:lldbdebugger-plugin.cpp

示例2: OnDebugStart

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
            //////////////////////////////////////////////////////////////////////

//.........这里部分代码省略.........
开发者ID:eranif,项目名称:codelite,代码行数:101,代码来源:LLDBPlugin.cpp


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