diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index 9656e80f0..45ddf2036 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -48,9 +48,6 @@ using namespace Common; #include "DebuggerParser.hxx" -// Call the pointed-to method on the this object. Whew. -#define CALL_METHOD(method) ( (this->*method)() ) - // TODO - use C++ streams instead of nasty C-strings and pointers @@ -114,7 +111,7 @@ string DebuggerParser::run(const string& command) if(BSPF_equalsIgnoreCase(verb, commands[i].cmdString)) { if(validateArgs(i)) - CALL_METHOD(commands[i].executor); + commands[i].executor(this); if(commands[i].refreshRequired) debugger.myBaseDialog->loadConfig(); diff --git a/src/debugger/DebuggerParser.hxx b/src/debugger/DebuggerParser.hxx index e11c76338..cee514c5d 100644 --- a/src/debugger/DebuggerParser.hxx +++ b/src/debugger/DebuggerParser.hxx @@ -20,6 +20,7 @@ #ifndef DEBUGGER_PARSER_HXX #define DEBUGGER_PARSER_HXX +#include #include class Debugger; @@ -71,7 +72,6 @@ class DebuggerParser private: enum { kNumCommands = 70, - kMAX_ARG_TYPES = 10 }; // Constants for argument processing @@ -94,16 +94,13 @@ class DebuggerParser kARG_END_ARGS // sentinel, occurs at end of list }; - // Pointer to DebuggerParser instance method, no args, returns void. - typedef void (DebuggerParser::*METHOD)(); - struct Command { string cmdString; string description; bool parmsRequired; bool refreshRequired; - parameters parms[kMAX_ARG_TYPES]; - METHOD executor; + parameters parms[10]; + std::function executor; }; // Reference to our debugger object