summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdb/gdbengine.cpp
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-02-05 10:43:21 +0100
committerEike Ziller <eike.ziller@digia.com>2014-02-19 09:19:28 +0100
commitc68ebeed2e47c7a78d790bb732a080edaf07d9ba (patch)
treeab861674989f5b4aaf8f8f70275d53a2e075b0f2 /src/plugins/debugger/gdb/gdbengine.cpp
parenta0d29eeb03cfe51ed929a83374c18e3301fefdaf (diff)
downloadqt-creator-c68ebeed2e47c7a78d790bb732a080edaf07d9ba.tar.gz
QtcProcess: Introduce a QtcProcess::Arguments class
This is used to get a platform-agnostic handle on "command line arguments". It essentially wraps a single QString on Windows, and a QStringList everywhere else. As a consequence, several occurrences of #ifdef Q_OS_* can be removed from the codebase. Change-Id: Ic93118c1bd0bce0ebb58f416d395dbaebb861772 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/plugins/debugger/gdb/gdbengine.cpp')
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index f8ef1af82e..b828ceaac0 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -4771,19 +4771,20 @@ void GdbEngine::write(const QByteArray &data)
bool GdbEngine::prepareCommand()
{
-#ifdef Q_OS_WIN
- Utils::QtcProcess::SplitError perr;
- startParameters().processArgs = Utils::QtcProcess::prepareArgs(
- startParameters().processArgs, &perr,
- &startParameters().environment, &startParameters().workingDirectory);
- if (perr != Utils::QtcProcess::SplitOk) {
- // perr == BadQuoting is never returned on Windows
- // FIXME? QTCREATORBUG-2809
- handleAdapterStartFailed(QCoreApplication::translate("DebuggerEngine", // Same message in CdbEngine
- "Debugging complex command lines is currently not supported on Windows."), Core::Id());
- return false;
+ if (HostOsInfo::isWindowsHost()) {
+ DebuggerStartParameters &sp = startParameters();
+ QtcProcess::SplitError perr;
+ sp.processArgs = QtcProcess::prepareArgs(sp.processArgs, &perr,
+ Utils::HostOsInfo::hostOs(),
+ &sp.environment, &sp.workingDirectory).toWindowsArgs();
+ if (perr != Utils::QtcProcess::SplitOk) {
+ // perr == BadQuoting is never returned on Windows
+ // FIXME? QTCREATORBUG-2809
+ handleAdapterStartFailed(QCoreApplication::translate("DebuggerEngine", // Same message in CdbEngine
+ "Debugging complex command lines is currently not supported on Windows."), Core::Id());
+ return false;
+ }
}
-#endif
return true;
}