Debugger: Allow for debugging executables from command line.

On Windows or if file is executable.
This commit is contained in:
Friedemann Kleint
2011-04-19 14:30:13 +02:00
parent c834720710
commit 99b6c2e4f9

View File

@@ -1179,11 +1179,20 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
.arg(sp.remoteChannel);
sp.toolChainAbi = abiOfBinary(sp.executable);
} else {
sp.startMode = AttachCore;
sp.coreFile = *it;
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
sp.toolChainAbi = abiOfBinary(sp.coreFile);
// Fixme: Distinguish between core-file and executable by argument syntax?
// (default up to 2.2 was core-file).
if (Abi::hostAbi().os() == Abi::WindowsOS || QFileInfo(*it).isExecutable()) {
sp.startMode = StartExternal;
sp.executable = *it;
sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);
sp.startMessage = tr("Debugging file %1.").arg(sp.executable);
} else {
sp.startMode = AttachCore;
sp.coreFile = *it;
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
}
sp.toolChainAbi = abiOfBinary(*it);
}
m_scheduledStarts.append(sp);
return true;