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 <axel.spoerl@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Cristian Adam
2024-04-25 17:59:50 +02:00
parent 041727fb29
commit 3f46037b37

View File

@@ -30,6 +30,7 @@
#include <projectexplorer/runcontrol.h>
#include <utils/algorithm.h>
#include <utils/environment.h>
#include <utils/process.h>
#include <utils/processinterface.h>
@@ -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();
}