debugger: require absolute paths to debugger binary on windows

Change-Id: I3be21bbe80ac669c12f42756a38f5013375b1b21
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-08-16 12:12:45 +02:00
parent b7e57da761
commit 2ded6900ce

View File

@@ -167,21 +167,36 @@ QVariant DebuggerProfileInformation::defaultValue(Profile *p) const
QList<Task> DebuggerProfileInformation::validate(Profile *p) const QList<Task> DebuggerProfileInformation::validate(Profile *p) const
{ {
const Core::Id id(Constants::TASK_CATEGORY_BUILDSYSTEM);
QList<Task> result; QList<Task> result;
FileName dbg = debuggerCommand(p); FileName dbg = debuggerCommand(p);
if (dbg.isEmpty()) { if (dbg.isEmpty()) {
result << Task(Task::Warning, tr("No debugger set up."), FileName(), -1, result << Task(Task::Warning, tr("No debugger set up."), FileName(), -1, id);
Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
return result; return result;
} }
QFileInfo fi = dbg.toFileInfo(); QFileInfo fi = dbg.toFileInfo();
if (!fi.exists() || fi.isDir()) if (!fi.exists() || fi.isDir())
result << Task(Task::Error, tr("Debugger not found."), FileName(), -1, result << Task(Task::Error, tr("Debugger not found."), FileName(), -1, id);
Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
else if (!fi.isExecutable()) else if (!fi.isExecutable())
result << Task(Task::Error, tr("Debugger not exectutable."), FileName(), -1, result << Task(Task::Error, tr("Debugger not exectutable."), FileName(), -1, id);
Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
if (ToolChain *tc = ToolChainProfileInformation::toolChain(p)) {
// We need an absolute path to be able to locate Python on Windows.
const Abi abi = tc->targetAbi();
if (abi.os() == Abi::WindowsOS && !fi.isAbsolute()) {
result << Task(Task::Error, tr("The debugger location must be given as an "
"absolute path (%1).").arg(dbg.toString()), FileName(), -1, id);
}
// FIXME: Make sure debugger matches toolchain.
// if (isCdb()) {
// if (abi.binaryFormat() != Abi::PEFormat || abi.os() != Abi::WindowsOS) {
// result << Task(Tas->errorDetails.push_back(CdbEngine::tr("The CDB debug engine does not support the %1 ABI.").
// arg(abi.toString()));
// return false;
// }
// }
}
return result; return result;
} }