diff options
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 8b4dc81561b..8c3d2d37d75 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1511,12 +1511,33 @@ CommandInterpreter::HandleCommand (const char *command_line, log->Printf ("HandleCommand, command line after removing command name(s): '%s'", remainder.c_str()); + CommandOverrideCallback command_callback = cmd_obj->GetOverrideCallback(); + bool handled = false; if (wants_raw_input) - cmd_obj->ExecuteRawCommandString (remainder.c_str(), result); + { + if (command_callback) + { + std::string full_command (cmd_obj->GetCommandName ()); + full_command += ' '; + full_command += remainder; + const char *argv[2] = { NULL, NULL }; + argv[0] = full_command.c_str(); + handled = command_callback (cmd_obj->GetOverrideCallbackBaton(), argv); + } + if (!handled) + cmd_obj->ExecuteRawCommandString (remainder.c_str(), result); + } else { Args cmd_args (remainder.c_str()); - cmd_obj->ExecuteWithOptions (cmd_args, result); + if (command_callback) + { + Args full_args (cmd_obj->GetCommandName ()); + full_args.AppendArguments(cmd_args); + handled = command_callback (cmd_obj->GetOverrideCallbackBaton(), full_args.GetConstArgumentVector()); + } + if (!handled) + cmd_obj->ExecuteWithOptions (cmd_args, result); } } else |