Debugger: Only append ".exe" for symbol file if necessary

Only append the ".exe" suffix if the the symbol file cannot be
found. Otherwise, this shows an unnecessary warning if an existing
and valid executable file like *.bat or *.cmd is passed.

Change-Id: I129c89deee9d63aefecc84d489ee08e81eaa11ab
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Michael Weghorn
2019-07-17 08:03:39 +01:00
committed by David Schulz
parent 1f81f63b56
commit b8d4a9bef8

View File

@@ -2626,8 +2626,8 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
&& rp.cppEngineType == CdbEngineType && rp.cppEngineType == CdbEngineType
&& rp.startMode != AttachToRemoteServer) { && rp.startMode != AttachToRemoteServer) {
QTC_ASSERT(!rp.symbolFile.isEmpty(), return); QTC_ASSERT(!rp.symbolFile.isEmpty(), return);
if (!rp.symbolFile.toString().endsWith(".exe", Qt::CaseInsensitive)) if (!rp.symbolFile.exists() && !rp.symbolFile.endsWith(".exe"))
rp.symbolFile = FileName::fromString(rp.symbolFile.toString() + ".exe"); rp.symbolFile = rp.symbolFile.stringAppended(".exe");
QString errorMessage; QString errorMessage;
QStringList rc; QStringList rc;
if (getPDBFiles(rp.symbolFile.toString(), &rc, &errorMessage) && !rc.isEmpty()) if (getPDBFiles(rp.symbolFile.toString(), &rc, &errorMessage) && !rc.isEmpty())