From f9d0c1a067ef6d8c2ae07ca08746f8f22d31ba3b Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 28 Feb 2023 12:17:52 +0200 Subject: [PATCH] GDB: Adapt to message change on 13.1 Sample message: >&"Error while mapping shared library sections:\n" >&"`C:\\WINDOWS\\System32\\wow64cpu.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.\n" >=library-loaded,id="C:\\WINDOWS\\System32\\wow64cpu.dll",target-name="C:\\WINDOWS\\System32\\wow64cpu.dll",host-name="C:\\WINDOWS\\System32\\wow64cpu.dll",symbols-loaded="0",thread-group="i1",ranges=[{}] Library C:\WINDOWS\System32\wow64cpu.dll loaded. Change-Id: Icb4243b129faac581f37d3fdd1211448656abefe Reviewed-by: hjk Reviewed-by: David Schulz --- src/plugins/debugger/gdb/gdbengine.cpp | 8 +++++++- src/plugins/debugger/gdb/gdbengine.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 1894dd3f4e5..3fd126a4b07 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -114,6 +114,7 @@ struct TracepointCaptureData }; const char tracepointCapturePropertyName[] = "GDB.TracepointCapture"; +const char notCompatibleMessage[] = "is not compatible with target architecture"; /////////////////////////////////////////////////////////////////////// // @@ -346,8 +347,13 @@ void GdbEngine::handleResponse(const QString &buff) // version and/or OS version used. if (data.startsWith("warning:")) { showMessage(data.mid(9), AppStuff); // Cut "warning: " - if (data.contains("is not compatible with target architecture")) + if (data.contains(notCompatibleMessage)) m_ignoreNextTrap = true; + } else if (data.startsWith("Error while mapping")) { + m_detectTargetIncompat = true; + } else if (m_detectTargetIncompat && data.contains(notCompatibleMessage)) { + m_detectTargetIncompat = false; + m_ignoreNextTrap = true; } m_pendingLogStreamOutput += data; diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index b0e60b934ac..cd3a21ffbde 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -130,6 +130,7 @@ private: ////////// General Interface ////////// bool m_rerunPending = false; bool m_ignoreNextTrap = false; + bool m_detectTargetIncompat = false; ////////// Gdb Output, State & Capability Handling //////////