diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2021-09-22 20:21:39 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2021-09-24 07:05:16 +0000 |
commit | 76760d8d80b45905e719cf4220bd8ef0798d0c41 (patch) | |
tree | 712d44c271f0f906ddc3fad4d3777e7a3fd87620 | |
parent | e84bc5f81f05f306e63f86ea139a3b897d5877b1 (diff) |
Debugger: Fix debugging of terminal apps with GDB < 10
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>
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 5c7c837a65..9ded4cb0b1 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -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(); |