From 3f46037b373f5b507389f36154fc8ea857645048 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 25 Apr 2024 17:59:50 +0200 Subject: [PATCH] Debugger: Execute additional attach commands for LLDB This allows setting _Preferences > Debugger > GDB > Additional Attach Commands_ with the content: process handle SIGSEGV --pass true --stop false --notify true which results in the debugger not stopping in assembler for Java runtime exceptions. Task-number: QTCREATORBUG-29928 Change-Id: I8edf0d79dcccfe7ddb27502edb122fb5fb2c646c Reviewed-by: Axel Spoerl Reviewed-by: hjk --- src/plugins/debugger/lldb/lldbengine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 2934f1db440..c6daabd863c 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -30,6 +30,7 @@ #include +#include #include #include #include @@ -328,6 +329,16 @@ void LldbEngine::handleLldbStarted() runEngine(); }; runCommand(cmd3); + + // Execute post attach commands + QStringList commands = settings().gdbPostAttachCommands().split('\n'); + commands = Utils::filtered(commands, [](const QString line) { + const QString trimmed = line.trimmed(); + return !trimmed.isEmpty() && !trimmed.startsWith('#'); + }); + for (const QString &cmd : commands) { + executeDebuggerCommand(cmd); + } } else { notifyEngineSetupFailed(); }