Debugger: Use symbolFile for binary validation

In remote setups this is typically a local copy of the executable.

Change-Id: I2c4e38559245e7b2cb4a609b93d80fde2b999cec
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
hjk
2016-04-21 15:21:38 +02:00
parent e3155cd049
commit 1827688dd0

View File

@@ -1828,8 +1828,11 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
return;
if (sp->languages == QmlLanguage)
return;
QString binary = sp->inferior.executable;
if (binary.isEmpty())
QString symbolFile = sp->symbolFile;
if (symbolFile.isEmpty())
symbolFile = sp->inferior.executable;
if (symbolFile.isEmpty())
return;
const bool warnOnRelease = boolSetting(WarnOnReleaseBuilds);
@@ -1845,11 +1848,11 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
"experience for this binary format.");
return;
} else if (warnOnRelease) {
if (!binary.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive))
binary.append(QLatin1String(".exe"));
if (!symbolFile.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive))
symbolFile.append(QLatin1String(".exe"));
QString errorMessage;
QStringList rc;
if (getPDBFiles(binary, &rc, &errorMessage) && !rc.isEmpty())
if (getPDBFiles(symbolFile, &rc, &errorMessage) && !rc.isEmpty())
return;
if (!errorMessage.isEmpty()) {
detailedWarning.append(QLatin1Char('\n'));
@@ -1870,11 +1873,11 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
return;
}
Utils::ElfReader reader(binary);
Utils::ElfReader reader(symbolFile);
Utils::ElfData elfData = reader.readHeaders();
QString error = reader.errorString();
Internal::showMessage(_("EXAMINING ") + binary, LogDebug);
Internal::showMessage(_("EXAMINING ") + symbolFile, LogDebug);
QByteArray msg = "ELF SECTIONS: ";
static QList<QByteArray> interesting;