Skip to content

Commit

Permalink
Debugger: Fix debugging of terminal apps with GDB < 10
Browse files Browse the repository at this point in the history
Fixes: QTCREATORBUG-26299
Change-Id: I96ed413a4722799090307e6682d2ec70f4de9b56
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
  • Loading branch information
orgads committed Sep 24, 2021
1 parent e84bc5f commit 76760d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/plugins/debugger/gdb/gdbengine.cpp
Expand Up @@ -4466,9 +4466,15 @@ void GdbEngine::setupInferior()
? QString("Going to attach to %1 (%2)").arg(attachedPID).arg(attachedMainThreadID)
: QString("Going to attach to %1").arg(attachedPID);
showMessage(msg, LogMisc);
const QString executable = runParameters().inferior.executable.toFileInfo().absoluteFilePath();
runCommand({"-file-exec-and-symbols \"" + executable + '"',
CB(handleFileExecAndSymbols)});
// For some reason, this breaks GDB 9 on Linux. See QTCREATORBUG-26299.
if (HostOsInfo::isWindowsHost() && m_gdbVersion >= 100000) {
// Required for debugging MinGW32 apps with 64-bit GDB. See QTCREATORBUG-26208.
const QString executable = runParameters().inferior.executable.toFileInfo().absoluteFilePath();
runCommand({"-file-exec-and-symbols \"" + executable + '"',
CB(handleFileExecAndSymbols)});
} else {
handleInferiorPrepared();
}
} else if (isPlainEngine()) {

setEnvironmentVariables();
Expand Down

0 comments on commit 76760d8

Please sign in to comment.