diff --git a/share/qtcreator/debugger/pdumper.py b/share/qtcreator/debugger/pdbbridge.py similarity index 100% rename from share/qtcreator/debugger/pdumper.py rename to share/qtcreator/debugger/pdbbridge.py diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 48c5cb24d63..dc5711d30b3 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -402,7 +402,7 @@ DebuggerRunControl *DebuggerRunControlFactory::doCreate } if (sp.masterEngineType == NoEngineType) { - if (sp.executable.endsWith(_(".py"))) { + if (sp.executable.endsWith(_(".py")) || sp.executable == _("/usr/bin/python")) { sp.masterEngineType = PdbEngineType; } else { if (RunConfiguration *rc = sp.runConfiguration) { diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index a6a2acb2268..286d82fceca 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -195,7 +195,7 @@ void PdbEngine::setupInferior() { QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); - QString fileName = QFileInfo(startParameters().executable).absoluteFilePath(); + QString fileName = mainPythonFile(); QFile scriptFile(fileName); if (!scriptFile.open(QIODevice::ReadOnly|QIODevice::Text)) { Core::AsynchronousMessageBox::critical(tr("Python Error"), @@ -207,17 +207,21 @@ void PdbEngine::setupInferior() notifyInferiorSetupOk(); } +QString PdbEngine::mainPythonFile() const +{ + return QFileInfo(startParameters().processArgs).absoluteFilePath(); +} + void PdbEngine::runEngine() { QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); showStatusMessage(tr("Running requested..."), 5000); const QByteArray dumperSourcePath = Core::ICore::resourcePath().toLocal8Bit() + "/debugger/"; - QString fileName = QFileInfo(startParameters().executable).absoluteFilePath(); postDirectCommand("import sys"); - postDirectCommand("sys.argv.append('" + fileName.toLocal8Bit() + "')"); + postDirectCommand("sys.argv.append('" + mainPythonFile().toLocal8Bit() + "')"); postDirectCommand("execfile('/usr/bin/pdb')"); - postDirectCommand("execfile('" + dumperSourcePath + "pdumper.py')"); + postDirectCommand("execfile('" + dumperSourcePath + "pdbbridge.py')"); attemptBreakpointSynchronization(); notifyEngineRunAndInferiorStopOk(); continueInferior(); diff --git a/src/plugins/debugger/pdb/pdbengine.h b/src/plugins/debugger/pdb/pdbengine.h index 41dc68a119a..a6ace0ef861 100644 --- a/src/plugins/debugger/pdb/pdbengine.h +++ b/src/plugins/debugger/pdb/pdbengine.h @@ -108,6 +108,7 @@ private: bool supportsThreads() const { return true; } bool isSynchronous() const { return true; } void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags); + QString mainPythonFile() const; signals: void outputReady(const QByteArray &data);