diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 933e923d625..9797a354bba 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -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()) {