Beispiel #1
0
void XDebugManager::DoStartDebugger()
{
    wxDELETE( m_readerThread );
    m_readerThread = new XDebugComThread(this, GetPort() );
    m_readerThread->Start();

    // Starting event
    XDebugEvent eventStarting(wxEVT_XDEBUG_SESSION_STARTING);
    EventNotifier::Get()->ProcessEvent( eventStarting );
    
    PHPConfigurationData conf;
    conf.Load();
    if ( !conf.HasFlag(PHPConfigurationData::kDontPromptForMissingFileMapping) && GetFileMapping(PHPWorkspace::Get()->GetActiveProject()).empty() ) {
        // Issue a warning
        wxString message;
        message << _("This project has no file mapping defined. This may result in breakpoints not applied\n")
                << _("To fix this, set file mapping from Project Settings -> Debug");
                
        wxRichMessageDialog dlg(EventNotifier::Get()->TopFrame(), message, "CodeLite", wxICON_WARNING|wxOK|wxOK_DEFAULT|wxCANCEL);
        dlg.ShowCheckBox(_("Remember my answer and don't show this message again"));
        dlg.SetOKCancelLabels(_("OK, Continue to Debug"), _("Stop the debugger"));
        int dlgResult = dlg.ShowModal();
        conf.EnableFlag( PHPConfigurationData::kDontPromptForMissingFileMapping, dlg.IsCheckBoxChecked() ).Save();
        if ( dlgResult == wxID_CANCEL ) {
            // Stop the debugger
            DoStopDebugger();
            return;
        }
    }
    
    // Now we can run the project
    if ( !PHPWorkspace::Get()->RunProject(true, "", conf.GetXdebugIdeKey()) ) {
        DoStopDebugger();
        return;
    }

    // Notify about debug session started
    XDebugEvent eventStart(wxEVT_XDEBUG_SESSION_STARTED);
    EventNotifier::Get()->AddPendingEvent( eventStart );

}