~ubuntu-branches/ubuntu/karmic/kdevelop/karmic

« back to all changes in this revision

Viewing changes to debuggers/gdb/debuggerplugin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-06-28 20:48:13 UTC
  • mfrom: (1.1.12 upstream) (2.3.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20090628204813-m6qlb9e92ig9h04m
Tags: 4:3.9.94-1ubuntu1
* Merge from Debian experimental, remaining changes:
  - Conflict/replace -kde4 packages
  - Remove gdb from recommends, version >= 6.8.50 is not yet in Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
#include <language/interfaces/editorcontext.h>
67
67
#include <interfaces/idebugcontroller.h>
68
68
#include <interfaces/iplugincontroller.h>
69
 
#include <execute/executepluginconstants.h>
 
69
#include <execute/iexecuteplugin.h>
70
70
#include <interfaces/launchconfigurationtype.h>
71
71
 
72
72
#include "variablewidget.h"
79
79
#include "gdbglobal.h"
80
80
#include "variablecollection.h"
81
81
#include "debugsession.h"
 
82
#include "selectcoredialog.h"
82
83
 
83
84
#include <iostream>
84
85
#include "gdblaunchconfig.h"
174
175
 
175
176
    setupDBus();
176
177
 
177
 
    KDevelop::LaunchConfigurationType* type = core()->runController()->launchConfigurationTypeForId( ExecutePlugin::nativeAppConfigTypeId );
 
178
    IExecutePlugin* iface = KDevelop::ICore::self()->pluginController()->pluginForExtension("org.kdevelop.IExecutePlugin")->extension<IExecutePlugin>();
 
179
    Q_ASSERT(iface);
 
180
    KDevelop::LaunchConfigurationType* type = core()->runController()->launchConfigurationTypeForId( iface->nativeAppConfigTypeId() );
178
181
    Q_ASSERT(type);
179
182
    type->addLauncher( new GdbLauncher( this ) );
180
183
    
344
347
 
345
348
DebugSession* CppDebuggerPlugin::createSession()
346
349
{
347
 
    if (m_session) {
348
 
        delete m_session;
349
 
    }
350
 
    m_session = new DebugSession(m_controller);
351
 
    KDevelop::ICore::self()->debugController()->addSession(m_session);
352
 
    connect(m_session, SIGNAL(showMessage(QString,int)), SLOT(controllerMessage(QString,int)));
353
 
    connect(m_session, SIGNAL(reset()), SIGNAL(reset()));
354
 
    connect(m_session, SIGNAL(finished()), SLOT(slotFinished()));
355
 
    connect(m_session, SIGNAL(raiseOutputViews()), SIGNAL(raiseOutputViews()));
356
 
    connect(m_session, SIGNAL(raiseVariableViews()), SIGNAL(raiseVariableViews()));
357
 
    return m_session;
358
 
}
359
 
 
360
 
 
361
 
void CppDebuggerPlugin::projectClosed()
362
 
{
363
 
    if (m_session) {
364
 
        m_session->stopDebugger();
365
 
    }
 
350
    DebugSession *session = new DebugSession(m_controller);
 
351
    KDevelop::ICore::self()->debugController()->addSession(session);
 
352
    connect(session, SIGNAL(showMessage(QString,int)), SLOT(controllerMessage(QString,int)));
 
353
    connect(session, SIGNAL(reset()), SIGNAL(reset()));
 
354
    connect(session, SIGNAL(finished()), SLOT(slotFinished()));
 
355
    connect(session, SIGNAL(raiseOutputViews()), SIGNAL(raiseOutputViews()));
 
356
    connect(session, SIGNAL(raiseVariableViews()), SIGNAL(raiseVariableViews()));
 
357
    return session;
366
358
}
367
359
 
368
360
void CppDebuggerPlugin::slotExamineCore()
369
361
{
370
362
    emit showMessage(this, i18n("Choose a core file to examine..."), 1000);
371
363
 
372
 
    KUrl coreFile = KFileDialog::getOpenUrl(QDir::homePath());
373
 
    if (!coreFile.isValid())
 
364
    SelectCoreDialog dlg(KDevelop::ICore::self()->uiController()->activeMainWindow());
 
365
    if (dlg.exec() == KDialog::Rejected) {
374
366
        return;
375
 
 
376
 
    emit showMessage(this, i18n("Examining core file %1", coreFile.url()), 1000);
377
 
 
378
 
    createSession()->examineCoreFile(coreFile);
 
367
    }
 
368
 
 
369
    emit showMessage(this, i18n("Examining core file %1", dlg.core().toLocalFile()), 1000);
 
370
 
 
371
    createSession()->examineCoreFile(dlg.binary(), dlg.core());
379
372
}
380
373
 
381
374