From 313419b58b1cdd3aada8ac71c3aad5931cf083ec Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Jun 2012 14:36:21 +0200 Subject: [PATCH] Fix debugger path Always use the full path to avoid spurious warnings about the debugger being missing. Change-Id: I8ffe768f71fa89327f711752d6339ab969a8d34e Reviewed-by: Daniel Teske --- .../debugger/debuggerprofileinformation.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/debugger/debuggerprofileinformation.cpp b/src/plugins/debugger/debuggerprofileinformation.cpp index e644978fa93..4e584ea56de 100644 --- a/src/plugins/debugger/debuggerprofileinformation.cpp +++ b/src/plugins/debugger/debuggerprofileinformation.cpp @@ -148,16 +148,21 @@ QVariant DebuggerProfileInformation::defaultValue(ProjectExplorer::Profile *p) c return (abi.wordWidth() == 32) ? cdbs.first : cdbs.second; } - // Check suggestions from the SDK: + // fall back to system GDB: + QString debugger = QLatin1String("gdb"); if (tc) { + // Check suggestions from the SDK: const QString path = tc->suggestedDebugger().toString(); - if (!path.isEmpty()) - return path; + if (!path.isEmpty()) { + QFileInfo fi(path); + if (fi.isAbsolute()) + return path; + debugger = path; + } } - // fall back to system GDB: Utils::Environment env = Utils::Environment::systemEnvironment(); - return env.searchInPath(QLatin1String("gdb")); + return env.searchInPath(debugger); } QList DebuggerProfileInformation::validate(ProjectExplorer::Profile *p) const