From 789dc0fc832115da658b57fa2c9758ffbb79aed8 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 29 Jan 2017 16:13:56 +0100 Subject: [PATCH] Remove unused clearLow parameter from the debugger driver interface. There are no callers anymore that do not use the default value for the argument. By removing the parameter, the executeCmd() functions can now be implemented as a template function. --- kdbg/dbgdriver.h | 18 ++++++------------ kdbg/gdbdriver.cpp | 29 ++++++++++++----------------- kdbg/gdbdriver.h | 18 ++++++------------ kdbg/xsldbgdriver.cpp | 27 ++++++++++++--------------- kdbg/xsldbgdriver.h | 18 ++++++------------ 5 files changed, 42 insertions(+), 68 deletions(-) diff --git a/kdbg/dbgdriver.h b/kdbg/dbgdriver.h index 29fa107..3c58003 100644 --- a/kdbg/dbgdriver.h +++ b/kdbg/dbgdriver.h @@ -326,18 +326,12 @@ public: * executed before any low-priority commands. No user interaction is * possible as long as there is a high-priority command in the queue. */ - virtual CmdQueueItem* executeCmd(DbgCommand, - bool clearLow = false) = 0; - virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg, - bool clearLow = false) = 0; - virtual CmdQueueItem* executeCmd(DbgCommand, int intArg, - bool clearLow = false) = 0; - virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg, int intArg, - bool clearLow = false) = 0; - virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg1, QString strArg2, - bool clearLow = false) = 0; - virtual CmdQueueItem* executeCmd(DbgCommand, int intArg1, int intArg2, - bool clearLow = false) = 0; + virtual CmdQueueItem* executeCmd(DbgCommand) = 0; + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg) = 0; + virtual CmdQueueItem* executeCmd(DbgCommand, int intArg) = 0; + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg, int intArg) = 0; + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg1, QString strArg2) = 0; + virtual CmdQueueItem* executeCmd(DbgCommand, int intArg1, int intArg2) = 0; virtual CmdQueueItem* executeCmdOnce(DbgCommand) = 0; virtual CmdQueueItem* executeCmdOnce(DbgCommand, QString strArg, int intArg) = 0; diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp index 7e71e20..d4ec0f3 100644 --- a/kdbg/gdbdriver.cpp +++ b/kdbg/gdbdriver.cpp @@ -586,43 +586,38 @@ QString GdbDriver::makeCmdString(DbgCommand cmd, int intArg1, int intArg2) return cmdString; } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, bool clearLow) +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd) { assert(cmd >= 0 && cmd < NUM_CMDS); assert(cmds[cmd].argsNeeded == GdbCmdInfo::argNone); - return executeCmdString(cmd, cmds[cmd].fmt, clearLow); + return executeCmdString(cmd, cmds[cmd].fmt, false); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg, - bool clearLow) +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg) { - return executeCmdString(cmd, makeCmdString(cmd, strArg), clearLow); + return executeCmdString(cmd, makeCmdString(cmd, strArg), false); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, int intArg, - bool clearLow) +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, int intArg) { - return executeCmdString(cmd, makeCmdString(cmd, intArg), clearLow); + return executeCmdString(cmd, makeCmdString(cmd, intArg), false); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg, int intArg, - bool clearLow) +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg, int intArg) { - return executeCmdString(cmd, makeCmdString(cmd, strArg, intArg), clearLow); + return executeCmdString(cmd, makeCmdString(cmd, strArg, intArg), false); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg1, QString strArg2, - bool clearLow) +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg1, QString strArg2) { - return executeCmdString(cmd, makeCmdString(cmd, strArg1, strArg2), clearLow); + return executeCmdString(cmd, makeCmdString(cmd, strArg1, strArg2), false); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, int intArg1, int intArg2, - bool clearLow) +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, int intArg1, int intArg2) { - return executeCmdString(cmd, makeCmdString(cmd, intArg1, intArg2), clearLow); + return executeCmdString(cmd, makeCmdString(cmd, intArg1, intArg2), false); } CmdQueueItem* GdbDriver::executeCmdOnce(DbgCommand cmd) diff --git a/kdbg/gdbdriver.h b/kdbg/gdbdriver.h index f81fabd..2fdbb6d 100644 --- a/kdbg/gdbdriver.h +++ b/kdbg/gdbdriver.h @@ -24,18 +24,12 @@ public: static QString defaultGdb(); virtual bool startup(QString cmdStr); virtual void commandFinished(CmdQueueItem* cmd); - virtual CmdQueueItem* executeCmd(DbgCommand, - bool clearLow = false); - virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg, - bool clearLow = false); - virtual CmdQueueItem* executeCmd(DbgCommand, int intArg, - bool clearLow = false); - virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg, int intArg, - bool clearLow = false); - virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg1, QString strArg2, - bool clearLow = false); - virtual CmdQueueItem* executeCmd(DbgCommand, int intArg1, int intArg2, - bool clearLow = false); + virtual CmdQueueItem* executeCmd(DbgCommand); + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg); + virtual CmdQueueItem* executeCmd(DbgCommand, int intArg); + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg, int intArg); + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg1, QString strArg2); + virtual CmdQueueItem* executeCmd(DbgCommand, int intArg1, int intArg2); virtual CmdQueueItem* executeCmdOnce(DbgCommand); virtual CmdQueueItem* executeCmdOnce(DbgCommand, QString strArg, int intArg); virtual CmdQueueItem* queueCmd(DbgCommand, diff --git a/kdbg/xsldbgdriver.cpp b/kdbg/xsldbgdriver.cpp index ad61962..eef0d7c 100644 --- a/kdbg/xsldbgdriver.cpp +++ b/kdbg/xsldbgdriver.cpp @@ -507,49 +507,46 @@ XsldbgDriver::makeCmdString(DbgCommand cmd, int intArg1, int intArg2) } CmdQueueItem * -XsldbgDriver::executeCmd(DbgCommand cmd, bool clearLow) +XsldbgDriver::executeCmd(DbgCommand cmd) { assert(cmd >= 0 && cmd < NUM_CMDS); assert(cmds[cmd].argsNeeded == XsldbgCmdInfo::argNone); - return executeCmdString(cmd, cmds[cmd].fmt, clearLow); + return executeCmdString(cmd, cmds[cmd].fmt, false); } CmdQueueItem * -XsldbgDriver::executeCmd(DbgCommand cmd, QString strArg, bool clearLow) +XsldbgDriver::executeCmd(DbgCommand cmd, QString strArg) { - return executeCmdString(cmd, makeCmdString(cmd, strArg), clearLow); + return executeCmdString(cmd, makeCmdString(cmd, strArg), false); } CmdQueueItem * -XsldbgDriver::executeCmd(DbgCommand cmd, int intArg, bool clearLow) +XsldbgDriver::executeCmd(DbgCommand cmd, int intArg) { - return executeCmdString(cmd, makeCmdString(cmd, intArg), clearLow); + return executeCmdString(cmd, makeCmdString(cmd, intArg), false); } CmdQueueItem * -XsldbgDriver::executeCmd(DbgCommand cmd, QString strArg, int intArg, - bool clearLow) +XsldbgDriver::executeCmd(DbgCommand cmd, QString strArg, int intArg) { return executeCmdString(cmd, makeCmdString(cmd, strArg, intArg), - clearLow); + false); } CmdQueueItem * -XsldbgDriver::executeCmd(DbgCommand cmd, QString strArg1, QString strArg2, - bool clearLow) +XsldbgDriver::executeCmd(DbgCommand cmd, QString strArg1, QString strArg2) { return executeCmdString(cmd, makeCmdString(cmd, strArg1, strArg2), - clearLow); + false); } CmdQueueItem * -XsldbgDriver::executeCmd(DbgCommand cmd, int intArg1, int intArg2, - bool clearLow) +XsldbgDriver::executeCmd(DbgCommand cmd, int intArg1, int intArg2) { return executeCmdString(cmd, makeCmdString(cmd, intArg1, intArg2), - clearLow); + false); } CmdQueueItem * diff --git a/kdbg/xsldbgdriver.h b/kdbg/xsldbgdriver.h index 70faf84..fcec520 100644 --- a/kdbg/xsldbgdriver.h +++ b/kdbg/xsldbgdriver.h @@ -22,18 +22,12 @@ class XsldbgDriver:public DebuggerDriver { virtual bool startup(QString cmdStr); virtual void commandFinished(CmdQueueItem * cmd); - virtual CmdQueueItem *executeCmd(DbgCommand, bool clearLow = false); - virtual CmdQueueItem *executeCmd(DbgCommand, QString strArg, - bool clearLow = false); - virtual CmdQueueItem *executeCmd(DbgCommand, int intArg, - bool clearLow = false); - virtual CmdQueueItem *executeCmd(DbgCommand, QString strArg, - int intArg, bool clearLow = false); - virtual CmdQueueItem *executeCmd(DbgCommand, QString strArg1, - QString strArg2, bool clearLow = - false); - virtual CmdQueueItem *executeCmd(DbgCommand, int intArg1, int intArg2, - bool clearLow = false); + virtual CmdQueueItem* executeCmd(DbgCommand); + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg); + virtual CmdQueueItem* executeCmd(DbgCommand, int intArg); + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg, int intArg); + virtual CmdQueueItem* executeCmd(DbgCommand, QString strArg1, QString strArg2); + virtual CmdQueueItem* executeCmd(DbgCommand, int intArg1, int intArg2); virtual CmdQueueItem* executeCmdOnce(DbgCommand); virtual CmdQueueItem* executeCmdOnce(DbgCommand, QString strArg, int intArg); virtual CmdQueueItem *queueCmd(DbgCommand, QueueMode mode); -- 2.11.4.GIT