Debugger/MinGW: Set environment correctly.

Extend the environment instead of clobbering
it with the Python setup.
Reviewed-by: dt
This commit is contained in:
Friedemann Kleint
2010-04-01 11:18:02 +02:00
parent d86f7dcd68
commit e632c9fcb2

View File

@@ -4041,13 +4041,14 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
gdbArgs += args;
#ifdef Q_OS_WIN
// Set python path. By convention, python is located below gdb executable.
// Extend the environment set on the process in startAdapter().
const QFileInfo fi(location);
bool foundPython = false;
if (fi.isAbsolute()) {
const QString winPythonVersion = QLatin1String(winPythonVersionC);
const QDir dir = fi.absoluteDir();
if (dir.exists(winPythonVersion)) {
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QProcessEnvironment environment = m_gdbProc.processEnvironment();
const QString pythonPathVariable = QLatin1String("PYTHONPATH");
// Check for existing values.
if (environment.contains(pythonPathVariable)) {