From a17919fbd05c9ed5094d640d57ca7747f790dc96 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 20 Jan 2017 10:05:31 +0100 Subject: [PATCH] Debugger: Allow explicitly marking of non-Python commands again This conceptually reverts part of a61b6dfc. Task-number: QTCREATORBUG-17594 Change-Id: I9ff72a027838a20039f217ed0d669b6c45bc2acf Reviewed-by: Eike Ziller Reviewed-by: David Schulz --- src/plugins/debugger/debuggerengine.h | 1 + src/plugins/debugger/debuggerprotocol.h | 2 ++ src/plugins/debugger/gdb/gdbengine.cpp | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index dabb52a9ec..c9c9d53262 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -208,6 +208,7 @@ public: LosesChild = DebuggerCommand::LosesChild, RebuildBreakpointModel = DebuggerCommand::RebuildBreakpointModel, InUpdateLocals = DebuggerCommand::InUpdateLocals, + NativeCommand = DebuggerCommand::NativeCommand, Silent = DebuggerCommand::Silent }; diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h index d17beecafa..c23c5060b7 100644 --- a/src/plugins/debugger/debuggerprotocol.h +++ b/src/plugins/debugger/debuggerprotocol.h @@ -84,6 +84,8 @@ public: LosesChild = 64, // Trigger breakpoint model rebuild when no such commands are pending anymore. RebuildBreakpointModel = 128, + // This is a native (non-Python) command that's handled directly by the backend. + NativeCommand = 256, // This is a command that needs to be wrapped into -interpreter-exec console ConsoleCommand = 512, // This is the UpdateLocals commannd during which we ignore notifications diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index f78b96c341..1117d76f13 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -939,7 +939,7 @@ void GdbEngine::runCommand(const DebuggerCommand &command) ++m_nonDiscardableCount; bool isPythonCommand = true; - if (cmd.function.contains('-') || cmd.function.contains(' ')) + if ((cmd.flags & NativeCommand) || cmd.function.contains('-') || cmd.function.contains(' ')) isPythonCommand = false; if (isPythonCommand) { cmd.arg("token", token); @@ -4157,7 +4157,7 @@ void GdbEngine::resetInferior() foreach (QString command, commands.split('\n')) { command = command.trimmed(); if (!command.isEmpty()) - runCommand({command, ConsoleCommand | NeedsTemporaryStop}); + runCommand({command, ConsoleCommand | NeedsTemporaryStop | NativeCommand}); } } m_rerunPending = true; @@ -4205,7 +4205,7 @@ void GdbEngine::handleInferiorPrepared() if (!rp.commandsAfterConnect.isEmpty()) { const QString commands = expand(rp.commandsAfterConnect); for (const QString &command : commands.split('\n')) - runCommand({command}); + runCommand({command, NativeCommand}); } //runCommand("set follow-exec-mode new"); -- GitLab