From 1e362b0f8b0dfd712337df35cd26c5dc98dfc294 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 19 Oct 2010 11:14:03 +0200 Subject: 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 --- src/plugins/debugger/gdb/remotegdbprocess.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins/debugger/gdb/remotegdbprocess.cpp') 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 +#include #include @@ -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())); -- cgit v1.2.1