diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 1117d76f13c..504474e3a20 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -896,6 +896,12 @@ void GdbEngine::runCommand(const DebuggerCommand &command) DebuggerCommand cmd = command; + if (cmd.function.isEmpty()) { + showMessage(QString("EMPTY FUNCTION RUN, TOKEN: %1 ARGS: %2") + .arg(token).arg(cmd.args.toString())); + QTC_ASSERT(false, return); + } + if (!stateAcceptsGdbCommands(state())) { showMessage(QString("NO GDB PROCESS RUNNING, CMD IGNORED: %1 %2") .arg(cmd.function).arg(state())); @@ -2201,7 +2207,7 @@ void GdbEngine::executeRunToLine(const ContextData &data) loc = '"' + breakLocation(data.fileName) + '"' + ':' + QString::number(data.lineNumber); runCommand({"tbreak " + loc}); - runCommand({"continue", RunRequest, CB(handleExecuteRunToLine)}); + runCommand({"continue", NativeCommand|RunRequest, CB(handleExecuteRunToLine)}); #else // Seems to jump to unpredicatable places. Observed in the manual // tests in the Foo::Foo() constructor with both gdb 6.8 and 7.1. diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index 6896a921184..10c7e4c280b 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -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),