Commit 60de95af authored by hjk's avatar hjk
Browse files

debugger: Remove dead code



Change-Id: Id59c9df315f7b19cd8a705e4283e749fb71b4dce
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 8184d8e7
......@@ -343,71 +343,6 @@ DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *erro
return 0;
}
bool isCdbEngineEnabled()
{
#ifdef Q_OS_WIN
return CdbOptionsPage::instance() && CdbOptionsPage::instance()->options()->isValid();
#else
return false;
#endif
}
static inline QString msgNoCdbBinaryForToolChain(const Abi &tc)
{
return CdbEngine::tr("There is no CDB binary available for binaries in format '%1'").arg(tc.toString());
}
static inline bool isMsvcFlavor(Abi::OSFlavor osf)
{
return osf == Abi::WindowsMsvc2005Flavor
|| osf == Abi::WindowsMsvc2008Flavor
|| osf == Abi::WindowsMsvc2010Flavor
|| osf == Abi::WindowsMsvc2012Flavor;
}
//bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
//{
//#ifdef Q_OS_WIN
// const Abi abi = sp.toolChainAbi;
// if (!isCdbEngineEnabled()) {
// check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine required for %1 is currently disabled.").
// arg(abi.toString()));
// check->settingsCategory = QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
// check->settingsPage = CdbOptionsPage::settingsId();
// return false;
// }
// if (!validMode(sp.startMode)) {
// check->errorDetails.push_back(CdbEngine::tr("The CDB engine does not support start mode %1.").arg(sp.startMode));
// return false;
// }
// if (abi.binaryFormat() != Abi::PEFormat || abi.os() != Abi::WindowsOS) {
// check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine does not support the %1 ABI.").
// arg(abi.toString()));
// return false;
// }
// if (sp.startMode == AttachCore && !isMsvcFlavor(abi.osFlavor())) {
// check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine cannot debug gdb core files."));
// return false;
// }
// if (sp.debuggerCommand.isEmpty()) {
// check->errorDetails.push_back(msgNoCdbBinaryForToolChain(abi));
// check->settingsCategory = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
// check->settingsPage = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
// return false;
// }
// return true;
//#else
// Q_UNUSED(sp);
// check->errorDetails.push_back(QString::fromLatin1("Unsupported debug mode"));
// return false;
//#endif
//}
void addCdbOptionPages(QList<Core::IOptionsPage *> *opts)
{
#ifdef Q_OS_WIN
......
......@@ -247,7 +247,6 @@ void DebuggerMainWindowPrivate::updateActiveLanguages()
if (newLanguages != m_activeDebugLanguages) {
m_activeDebugLanguages = newLanguages;
debuggerCore()->languagesChanged();
emit q->activeDebugLanguagesChanged(m_activeDebugLanguages);
}
if (m_changingUI || !m_inDebugMode)
......
......@@ -86,9 +86,6 @@ public:
private slots:
void raiseDebuggerWindow();
signals:
void activeDebugLanguagesChanged(Debugger::DebuggerLanguages);
private:
friend class Internal::DebuggerMainWindowPrivate;
Internal::DebuggerMainWindowPrivate *d;
......
......@@ -783,7 +783,6 @@ public slots:
void attachToRunningApplication();
void attachToQmlPort();
void startRemoteEngine();
//Q_SLOT void attachToLocalProcess(ProjectExplorer::RunControl *rc);
void runScheduled();
void attachCore();
......@@ -804,7 +803,6 @@ public slots:
void runControlStarted(DebuggerEngine *engine);
void runControlFinished(DebuggerEngine *engine);
DebuggerLanguages activeLanguages() const;
// QString debuggerForAbi(const Abi &abi, DebuggerEngineType et = NoEngineType) const;
void remoteCommand(const QStringList &options, const QStringList &);
bool isReverseDebugging() const;
......@@ -815,7 +813,6 @@ public slots:
void setConfigValue(const QString &name, const QVariant &value);
QVariant configValue(const QString &name) const;
//void startDebugger(RunControl *runControl);
void displayDebugger(DebuggerEngine *engine, bool updateEngine = true);
void dumpLog();
......@@ -1546,11 +1543,6 @@ void DebuggerPluginPrivate::attachToRemoteServer()
}
}
//const char LastProfile[] = "Debugger/LastProfile";
//const char LastDevice[] = "Debugger/LastDevice";
//const char LastProcessName[] = "Debugger/LastProcessName";
//const char LastLocalExecutable[] = "Debugger/LastLocalExecutable";
void DebuggerPluginPrivate::startRemoteServer()
{
attachToProcess(true);
......@@ -1592,8 +1584,6 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
}
#endif
//setConfigValue(_("LastAttachExternalProfileIndex"), QVariant(dlg->profileChooser()->currentProfileId()));
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
DebuggerStartParameters sp;
fillParameters(&sp, profile->id());
......@@ -1925,12 +1915,6 @@ void DebuggerPluginPrivate::displayDebugger(DebuggerEngine *engine, bool updateE
engine->updateViews();
}
//void DebuggerPluginPrivate::startDebugger(RunControl *rc)
//{
// QTC_ASSERT(rc, return);
// ProjectExplorerPlugin::instance()->startRunControl(rc, DebugRunMode);
//}
void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
{
if (!engine)
......@@ -1950,8 +1934,6 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
m_sourceFilesWindow->setModel(engine->sourceFilesModel());
m_stackWindow->setModel(engine->stackModel());
m_threadsWindow->setModel(engine->threadsModel());
//m_threadBox->setModel(engine->threadsModel());
//m_threadBox->setModelColumn(ThreadData::ComboNameColumn);
m_watchersWindow->setModel(engine->watchersModel());
m_inspectorWindow->setModel(engine->inspectorModel());
m_qtMessageLogWindow->setModel(engine->qtMessageLogModel());
......@@ -2350,13 +2332,6 @@ void DebuggerPluginPrivate::aboutToUnloadSession()
{
m_breakHandler->removeSessionData();
m_toolTipManager->sessionAboutToChange();
// Stop debugging the active project when switching sessions.
// Note that at startup, session switches may occur, which interfere
// with command-line debugging startup.
// FIXME ABC: Still wanted? Iterate?
//if (d->m_engine && state() != DebuggerNotReady
// && engine()->sp().startMode == StartInternal)
// d->m_engine->shutdown();
}
void DebuggerPluginPrivate::aboutToSaveSession()
......@@ -3318,11 +3293,6 @@ void DebuggerPlugin::remoteCommand(const QStringList &options,
theDebuggerCore->remoteCommand(options, list);
}
//void DebuggerPlugin::startDebugger(RunControl *runControl)
//{
// theDebuggerCore->startDebugger(runControl);
//}
DebuggerRunControl *DebuggerPlugin::createDebugger
(const DebuggerStartParameters &sp, RunConfiguration *rc)
{
......
......@@ -71,7 +71,6 @@
#include <QErrorMessage>
#include <QFormLayout>
#include <QLabel>
#include <QMessageBox>
using namespace Debugger::Internal;
using namespace ProjectExplorer;
......@@ -82,11 +81,7 @@ enum { debug = 0 };
namespace Debugger {
namespace Internal {
bool isCdbEngineEnabled(); // Check the configuration page
//bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check);
DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *error);
//bool checkGdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check);
DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp);
DebuggerEngine *createScriptEngine(const DebuggerStartParameters &sp);
DebuggerEngine *createPdbEngine(const DebuggerStartParameters &sp);
......@@ -94,8 +89,6 @@ DebuggerEngine *createQmlEngine(const DebuggerStartParameters &sp);
DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp, QString *error);
DebuggerEngine *createLldbEngine(const DebuggerStartParameters &sp);
extern QString msgNoBinaryForToolChain(const Abi &abi);
static const char *engineTypeName(DebuggerEngineType et)
{
switch (et) {
......@@ -121,28 +114,6 @@ static const char *engineTypeName(DebuggerEngineType et)
return "No engine";
}
static inline QString engineTypeNames(const QList<DebuggerEngineType> &l)
{
QString rc;
foreach (DebuggerEngineType et, l) {
if (!rc.isEmpty())
rc.append(QLatin1String(", "));
rc += QLatin1String(engineTypeName(et));
}
return rc;
}
static QString msgEngineNotAvailable(const char *engine)
{
return DebuggerPlugin::tr("The application requires the debugger engine '%1', "
"which is disabled.").arg(_(engine));
}
static inline QString msgEngineNotAvailable(DebuggerEngineType et)
{
return msgEngineNotAvailable(engineTypeName(et));
}
////////////////////////////////////////////////////////////////////////
//
// DebuggerRunConfigWidget
......@@ -490,7 +461,6 @@ RunConfiguration *DebuggerRunControl::runConfiguration() const
//
////////////////////////////////////////////////////////////////////////
// A factory to create DebuggerRunControls
DebuggerRunControlFactory::DebuggerRunControlFactory(QObject *parent)
: IRunControlFactory(parent)
{}
......@@ -506,36 +476,6 @@ QString DebuggerRunControlFactory::displayName() const
return DebuggerPlugin::tr("Debug");
}
// Find Qt installation by running qmake
static inline QString findQtInstallPath(const FileName &qmakePath)
{
QProcess proc;
QStringList args;
args.append(_("-query"));
args.append(_("QT_INSTALL_HEADERS"));
proc.start(qmakePath.toString(), args);
if (!proc.waitForStarted()) {
qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(qmakePath.toString()),
qPrintable(proc.errorString()));
return QString();
}
proc.closeWriteChannel();
if (!proc.waitForFinished()) {
SynchronousProcess::stopProcess(proc);
qWarning("%s: Timeout running '%s'.", Q_FUNC_INFO, qPrintable(qmakePath.toString()));
return QString();
}
if (proc.exitStatus() != QProcess::NormalExit) {
qWarning("%s: '%s' crashed.", Q_FUNC_INFO, qPrintable(qmakePath.toString()));
return QString();
}
const QByteArray ba = proc.readAllStandardOutput().trimmed();
QDir dir(QString::fromLocal8Bit(ba));
if (dir.exists() && dir.cdUp())
return dir.absolutePath();
return QString();
}
static DebuggerStartParameters localStartParameters(RunConfiguration *runConfiguration)
{
DebuggerStartParameters sp;
......@@ -744,7 +684,6 @@ DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
return rc;
}
RunConfigWidget *DebuggerRunControlFactory::createConfigurationWidget
(RunConfiguration *runConfiguration)
{
......
......@@ -4634,27 +4634,6 @@ static QString gdbBinary(const DebuggerStartParameters &sp)
return sp.debuggerCommand;
}
//bool checkGdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
//{
// const QString binary = gdbBinary(sp);
// const Abi abi = sp.toolChainAbi;
// if (binary.isEmpty()) {
// check->errorDetails.push_back(msgNoGdbBinaryForToolChain(abi));
// check->settingsCategory = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
// check->settingsPage = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
// return false;
// }
// if (abi.os() == Abi::WindowsOS && !QFileInfo(binary).isAbsolute()) {
// // See initialization below, we need an absolute path to be able to locate Python on Windows.
// check->errorDetails.push_back(GdbEngine::tr("The gdb location must be given as an "
// "absolute path in the debugger settings (%1).").arg(binary));
// check->settingsCategory = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
// check->settingsPage = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
// return false;
// }
// return true;
//}
//
// Starting up & shutting down
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment