Debugger[new CDB]: Handle command line arguments correctly.

This commit is contained in:
Friedemann Kleint
2010-11-18 16:06:02 +01:00
parent 0b3ef78ca6
commit 1a6737cbee

View File

@@ -401,9 +401,7 @@ bool CdbEngine::doSetupEngine(QString *errorMessage)
switch (sp.startMode) {
case StartInternal:
case StartExternal:
arguments << sp.executable;
foreach(const QString &arg, sp.processArgs)
arguments << arg; // @TODO quoting/env
arguments << QDir::toNativeSeparators(sp.executable);
break;
case AttachExternal:
case AttachCrashedExternal: // @TODO: event handle for crashed?
@@ -425,6 +423,10 @@ bool CdbEngine::doSetupEngine(QString *errorMessage)
m_outputBuffer.clear();
m_process.setEnvironment(mergeEnvironment(sp.environment.toStringList(), extensionFi.absolutePath()));
#ifdef Q_OS_WIN
if (!sp.processArgs.isEmpty()) // Appends
m_process.setNativeArguments(sp.processArgs);
#endif
m_process.start(executable, arguments);
if (!m_process.waitForStarted()) {
*errorMessage = QString::fromLatin1("Internal error: Cannot start process %1: %2").