overhaul process argument handling

get away from argument stringlists. instead, use native shell command
lines which support quoting/splitting, environment variable expansion
and redirections with well-understood semantics.

Task-number: QTCREATORBUG-542
Task-number: QTCREATORBUG-1564
This commit is contained in:
Oswald Buddenhagen
2010-10-19 11:14:03 +02:00
parent 531c70f05b
commit 1e362b0f8b
91 changed files with 592 additions and 572 deletions

View File

@@ -32,6 +32,7 @@
#include "remoteplaingdbadapter.h"
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <QtCore/QFileInfo>
@@ -143,11 +144,11 @@ void RemoteGdbProcess::handleAppOutputReaderStarted()
connect(m_appOutputReader.data(), SIGNAL(outputAvailable(QByteArray)),
this, SLOT(handleAppOutput(QByteArray)));
QByteArray cmdLine = "DISPLAY=:0.0 " + m_command.toUtf8() + ' '
+ m_cmdArgs.join(QLatin1String(" ")).toUtf8()
QByteArray cmdLine = "DISPLAY=:0.0 " + Utils::QtcProcess::quoteArgUnix(m_command).toUtf8() + ' '
+ Utils::QtcProcess::joinArgsUnix(m_cmdArgs).toUtf8()
+ " -tty=" + m_appOutputFileName;
if (!m_wd.isEmpty())
cmdLine.prepend("cd " + m_wd.toUtf8() + " && ");
cmdLine.prepend("cd " + Utils::QtcProcess::quoteArgUnix(m_wd).toUtf8() + " && ");
m_gdbProc = m_conn->createRemoteProcess(cmdLine);
connect(m_gdbProc.data(), SIGNAL(started()), this,
SLOT(handleGdbStarted()));