diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Commands/CommandObjectCrossref.cpp | 88 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 18 | ||||
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 33 |
3 files changed, 0 insertions, 139 deletions
diff --git a/lldb/source/Commands/CommandObjectCrossref.cpp b/lldb/source/Commands/CommandObjectCrossref.cpp deleted file mode 100644 index 3088bba7f42..00000000000 --- a/lldb/source/Commands/CommandObjectCrossref.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//===-- CommandObjectCrossref.cpp -------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Interpreter/CommandObjectCrossref.h" - -// C Includes -// C++ Includes -// Other libraries and framework includes -// Project includes -#include "lldb/Interpreter/CommandReturnObject.h" - -using namespace lldb; -using namespace lldb_private; - -//------------------------------------------------------------------------- -// CommandObjectCrossref -//------------------------------------------------------------------------- - -CommandObjectCrossref::CommandObjectCrossref -( - CommandInterpreter &interpreter, - const char *name, - const char *help, - const char *syntax -) : - CommandObjectParsed (interpreter, name, help, syntax), - m_crossref_object_types() -{ -} - -CommandObjectCrossref::~CommandObjectCrossref () -{ -} - -bool -CommandObjectCrossref::DoExecute (Args& command, CommandReturnObject &result) -{ - if (m_crossref_object_types.GetArgumentCount() == 0) - { - result.AppendErrorWithFormat ("There are no objects for which you can call '%s'.\n", GetCommandName()); - result.SetStatus (eReturnStatusFailed); - } - else - { - GenerateHelpText (result); - } - return result.Succeeded(); -} - -void -CommandObjectCrossref::AddObject (const char *obj_name) -{ - m_crossref_object_types.AppendArgument (obj_name); -} - -const char ** -CommandObjectCrossref::GetObjectTypes () const -{ - return m_crossref_object_types.GetConstArgumentVector(); -} - -void -CommandObjectCrossref::GenerateHelpText (CommandReturnObject &result) -{ - result.AppendMessage ("This command can be called on the following types of objects:"); - - const size_t count = m_crossref_object_types.GetArgumentCount(); - for (size_t i = 0; i < count; ++i) - { - const char *obj_name = m_crossref_object_types.GetArgumentAtIndex(i); - result.AppendMessageWithFormat (" %s (e.g. '%s %s')\n", obj_name, - obj_name, GetCommandName()); - } - - result.SetStatus (eReturnStatusSuccessFinishNoResult); -} - -bool -CommandObjectCrossref::IsCrossRefObject () -{ - return true; -} diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index c87a9d7cd58..bfb5132a644 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -101,7 +101,6 @@ CommandObjectMultiword::LoadSubCommand if (pos == m_subcommand_dict.end()) { m_subcommand_dict[name] = cmd_obj; - m_interpreter.CrossRegisterCommand (name, GetCommandName()); } else success = false; @@ -365,23 +364,6 @@ CommandObjectProxy::GetHelpLong () return NULL; } -void -CommandObjectProxy::AddObject (const char *obj_name) -{ - CommandObject *proxy_command = GetProxyCommandObject(); - if (proxy_command) - return proxy_command->AddObject (obj_name); -} - -bool -CommandObjectProxy::IsCrossRefObject () -{ - CommandObject *proxy_command = GetProxyCommandObject(); - if (proxy_command) - return proxy_command->IsCrossRefObject(); - return false; -} - bool CommandObjectProxy::IsRemovable() const { diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 89ed5641acf..b28ed64b252 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -355,34 +355,15 @@ CommandInterpreter::LoadCommandDictionary () { Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); - // **** IMPORTANT **** IMPORTANT *** IMPORTANT *** **** IMPORTANT **** IMPORTANT *** IMPORTANT *** - // - // Command objects that are used as cross reference objects (i.e. they inherit from CommandObjectCrossref) - // *MUST* be created and put into the command dictionary *BEFORE* any multi-word commands (which may use - // the cross-referencing stuff) are created!!! - // - // **** IMPORTANT **** IMPORTANT *** IMPORTANT *** **** IMPORTANT **** IMPORTANT *** IMPORTANT *** - - - // Command objects that inherit from CommandObjectCrossref must be created before other command objects - // are created. This is so that when another command is created that needs to go into a crossref object, - // the crossref object exists and is ready to take the cross reference. Put the cross referencing command - // objects into the CommandDictionary now, so they are ready for use when the other commands get created. - - // Non-CommandObjectCrossref commands can now be created. - lldb::ScriptLanguage script_language = m_debugger.GetScriptLanguage(); m_command_dict["apropos"] = CommandObjectSP (new CommandObjectApropos (*this)); m_command_dict["breakpoint"]= CommandObjectSP (new CommandObjectMultiwordBreakpoint (*this)); - //m_command_dict["call"] = CommandObjectSP (new CommandObjectCall (*this)); m_command_dict["command"] = CommandObjectSP (new CommandObjectMultiwordCommands (*this)); m_command_dict["disassemble"] = CommandObjectSP (new CommandObjectDisassemble (*this)); m_command_dict["expression"]= CommandObjectSP (new CommandObjectExpression (*this)); -// m_command_dict["file"] = CommandObjectSP (new CommandObjectFile (*this)); m_command_dict["frame"] = CommandObjectSP (new CommandObjectMultiwordFrame (*this)); m_command_dict["help"] = CommandObjectSP (new CommandObjectHelp (*this)); - /// m_command_dict["image"] = CommandObjectSP (new CommandObjectImage (*this)); m_command_dict["log"] = CommandObjectSP (new CommandObjectLog (*this)); m_command_dict["memory"] = CommandObjectSP (new CommandObjectMemory (*this)); m_command_dict["platform"] = CommandObjectSP (new CommandObjectPlatform (*this)); @@ -2139,20 +2120,6 @@ CommandInterpreter::Confirm (const char *message, bool default_answer) return response; } - -void -CommandInterpreter::CrossRegisterCommand (const char * dest_cmd, const char * object_type) -{ - CommandObjectSP cmd_obj_sp = GetCommandSPExact (dest_cmd, true); - - if (cmd_obj_sp) - { - CommandObject *cmd_obj = cmd_obj_sp.get(); - if (cmd_obj->IsCrossRefObject ()) - cmd_obj->AddObject (object_type); - } -} - OptionArgVectorSP CommandInterpreter::GetAliasOptions (const char *alias_name) { |