Debugger: Run extra post-attach commands as "native" gdb commands

Change-Id: I5c3fac1e03b400f837a090b136ff8aa0ce8e21de
Task-number: QTCREATORBUG-17659
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-01-31 12:59:52 +01:00
parent a9a1f80f3a
commit b8c0801e0a
2 changed files with 9 additions and 3 deletions

View File

@@ -277,7 +277,7 @@ void GdbRemoteServerEngine::handleTargetRemote(const DebuggerResponse &response)
showMessage(msgAttachedToStoppedInferior(), StatusBar);
QString commands = expand(stringSetting(GdbPostAttachCommands));
if (!commands.isEmpty())
runCommand({commands});
runCommand({commands, NativeCommand});
handleInferiorPrepared();
} else {
// 16^error,msg="hd:5555: Connection timed out."
@@ -293,7 +293,7 @@ void GdbRemoteServerEngine::handleTargetExtendedRemote(const DebuggerResponse &r
showMessage(msgAttachedToStoppedInferior(), StatusBar);
QString commands = expand(stringSetting(GdbPostAttachCommands));
if (!commands.isEmpty())
runCommand({commands});
runCommand({commands, NativeCommand});
if (runParameters().attachPID > 0) { // attach to pid if valid
// gdb server will stop the remote application itself.
runCommand({"attach " + QString::number(runParameters().attachPID),