Gdb: Use path() of executable

Change-Id: I872da3995344b6337b5d72925768034b58f9b339
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-02-02 14:25:48 +01:00
parent 447f8b80c3
commit 144dff8d74

View File

@@ -4439,12 +4439,11 @@ void GdbEngine::setupInferior()
}
// Do that first, otherwise no symbols are loaded.
QFileInfo fi = executable.toFileInfo();
QString path = fi.absoluteFilePath();
const QString localExecutablePath = executable.absoluteFilePath().path();
// This is *not* equivalent to -file-exec-and-symbols. If the file is not executable
// (contains only debugging symbols), this should still work.
runCommand({"-file-exec-file \"" + path + '"'});
runCommand({"-file-symbol-file \"" + path + '"',
runCommand({"-file-exec-file \"" + localExecutablePath + '"'});
runCommand({"-file-symbol-file \"" + localExecutablePath + '"',
CB(handleFileExecAndSymbols)});
} else if (isTermEngine()) {