forked from qt-creator/qt-creator
Debugger/MinGW: Set environment correctly.
Extend the environment instead of clobbering it with the Python setup. Reviewed-by: dt
This commit is contained in:
@@ -4041,13 +4041,14 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
|
|||||||
gdbArgs += args;
|
gdbArgs += args;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// Set python path. By convention, python is located below gdb executable.
|
// Set python path. By convention, python is located below gdb executable.
|
||||||
|
// Extend the environment set on the process in startAdapter().
|
||||||
const QFileInfo fi(location);
|
const QFileInfo fi(location);
|
||||||
bool foundPython = false;
|
bool foundPython = false;
|
||||||
if (fi.isAbsolute()) {
|
if (fi.isAbsolute()) {
|
||||||
const QString winPythonVersion = QLatin1String(winPythonVersionC);
|
const QString winPythonVersion = QLatin1String(winPythonVersionC);
|
||||||
const QDir dir = fi.absoluteDir();
|
const QDir dir = fi.absoluteDir();
|
||||||
if (dir.exists(winPythonVersion)) {
|
if (dir.exists(winPythonVersion)) {
|
||||||
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment environment = m_gdbProc.processEnvironment();
|
||||||
const QString pythonPathVariable = QLatin1String("PYTHONPATH");
|
const QString pythonPathVariable = QLatin1String("PYTHONPATH");
|
||||||
// Check for existing values.
|
// Check for existing values.
|
||||||
if (environment.contains(pythonPathVariable)) {
|
if (environment.contains(pythonPathVariable)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user