summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdb/remotegdbprocess.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-10-19 11:14:03 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-11-17 13:19:07 +0100
commit1e362b0f8b0dfd712337df35cd26c5dc98dfc294 (patch)
treedbb61c65fc1c3e84b507e03c2b3f62a36acd6488 /src/plugins/debugger/gdb/remotegdbprocess.cpp
parent531c70f05bfc8355f856f2af41be533fb13b85e6 (diff)
downloadqt-creator-1e362b0f8b0dfd712337df35cd26c5dc98dfc294.tar.gz
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
Diffstat (limited to 'src/plugins/debugger/gdb/remotegdbprocess.cpp')
-rw-r--r--src/plugins/debugger/gdb/remotegdbprocess.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/debugger/gdb/remotegdbprocess.cpp b/src/plugins/debugger/gdb/remotegdbprocess.cpp
index 4ad44945df..c88c0ba2d3 100644
--- a/src/plugins/debugger/gdb/remotegdbprocess.cpp
+++ b/src/plugins/debugger/gdb/remotegdbprocess.cpp
@@ -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()));