forked from qt-creator/qt-creator
Debugger: Centralize some parameter sanitization
Change-Id: I00e7c22adcf32ba8251b357e75eb9207b6f98f1b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -455,9 +455,6 @@ void CdbEngine::setupEngine()
|
||||
if (debug)
|
||||
qDebug(">setupEngine");
|
||||
|
||||
if (!prepareCommand())
|
||||
return;
|
||||
|
||||
init();
|
||||
if (!m_logTime.elapsed())
|
||||
m_logTime.start();
|
||||
|
@@ -1239,30 +1239,6 @@ QString DebuggerEngine::nativeStartupCommands() const
|
||||
runParameters().additionalStartupCommands}).join('\n'));
|
||||
}
|
||||
|
||||
bool DebuggerEngine::prepareCommand()
|
||||
{
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
DebuggerRunParameters &rp = runParameters();
|
||||
QtcProcess::SplitError perr;
|
||||
rp.inferior.commandLineArguments =
|
||||
QtcProcess::prepareArgs(rp.inferior.commandLineArguments, &perr,
|
||||
HostOsInfo::hostOs(), nullptr,
|
||||
&rp.inferior.workingDirectory).toWindowsArgs();
|
||||
if (perr != QtcProcess::SplitOk) {
|
||||
// perr == BadQuoting is never returned on Windows
|
||||
// FIXME? QTCREATORBUG-2809
|
||||
showMessage("ADAPTER START FAILED");
|
||||
const QString title = tr("Adapter start failed");
|
||||
const QString msg = tr("Debugging complex command lines "
|
||||
"is currently not supported on Windows.");
|
||||
ICore::showWarningWithOptions(title, msg);
|
||||
notifyEngineSetupFailed();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DebuggerEngine::updateBreakpointMarker(const Breakpoint &bp)
|
||||
{
|
||||
d->m_disassemblerAgent.updateBreakpointMarker(bp);
|
||||
|
@@ -336,8 +336,6 @@ public:
|
||||
QString expand(const QString &string) const;
|
||||
QString nativeStartupCommands() const;
|
||||
|
||||
bool prepareCommand();
|
||||
|
||||
protected:
|
||||
// The base notify*() function implementation should be sufficient
|
||||
// in most cases, but engines are free to override them to do some
|
||||
|
@@ -693,6 +693,21 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
|
||||
breakOnMainNextTime = false;
|
||||
}
|
||||
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
QtcProcess::SplitError perr;
|
||||
rp.inferior.commandLineArguments =
|
||||
QtcProcess::prepareArgs(rp.inferior.commandLineArguments, &perr,
|
||||
HostOsInfo::hostOs(), nullptr,
|
||||
&rp.inferior.workingDirectory).toWindowsArgs();
|
||||
if (perr != QtcProcess::SplitOk) {
|
||||
// perr == BadQuoting is never returned on Windows
|
||||
// FIXME? QTCREATORBUG-2809
|
||||
m_errors.append(DebuggerPlugin::tr("Debugging complex command lines "
|
||||
"is currently not supported on Windows."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -112,9 +112,6 @@ void GdbPlainEngine::setupEngine()
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
showMessage("TRYING TO START ADAPTER");
|
||||
|
||||
if (!prepareCommand())
|
||||
return;
|
||||
|
||||
QStringList gdbArgs;
|
||||
|
||||
if (!m_outputCollector.listen()) {
|
||||
|
@@ -77,9 +77,6 @@ void GdbTermEngine::setupEngine()
|
||||
// m_stubProc.stop();
|
||||
// m_stubProc.blockSignals(false);
|
||||
|
||||
if (!prepareCommand())
|
||||
return;
|
||||
|
||||
m_stubProc.setWorkingDirectory(runParameters().inferior.workingDirectory);
|
||||
// Set environment + dumper preload.
|
||||
m_stubProc.setEnvironment(runParameters().stubEnvironment);
|
||||
|
@@ -205,9 +205,6 @@ void LldbEngine::setupEngine()
|
||||
// m_stubProc.stop();
|
||||
// m_stubProc.blockSignals(false);
|
||||
|
||||
if (!prepareCommand())
|
||||
return;
|
||||
|
||||
m_stubProc.setWorkingDirectory(runParameters().inferior.workingDirectory);
|
||||
// Set environment + dumper preload.
|
||||
m_stubProc.setEnvironment(runParameters().stubEnvironment);
|
||||
|
Reference in New Issue
Block a user