diff options
-rw-r--r-- | lldb/include/lldb/Interpreter/CommandInterpreter.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/Interpreter/CommandObject.h | 6 | ||||
-rw-r--r-- | lldb/include/lldb/Interpreter/CommandObjectCrossref.h | 60 | ||||
-rw-r--r-- | lldb/include/lldb/Interpreter/CommandObjectMultiword.h | 6 | ||||
-rw-r--r-- | lldb/lldb.xcodeproj/project.pbxproj | 6 | ||||
-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 |
8 files changed, 0 insertions, 221 deletions
diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index dd3dfc32a08..14f6cddad32 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -335,10 +335,6 @@ public: Initialize (); void - CrossRegisterCommand (const char *dest_cmd, - const char *object_type); - - void SetScriptLanguage (lldb::ScriptLanguage lang); diff --git a/lldb/include/lldb/Interpreter/CommandObject.h b/lldb/include/lldb/Interpreter/CommandObject.h index 4e2aba70ed9..917061e3e14 100644 --- a/lldb/include/lldb/Interpreter/CommandObject.h +++ b/lldb/include/lldb/Interpreter/CommandObject.h @@ -124,12 +124,6 @@ public: void SetSyntax (const char *str); - - virtual void - AddObject (const char *obj_name) {} - - virtual bool - IsCrossRefObject () { return false; } // override this to return true if you want to enable the user to delete // the Command object from the Command dictionary (aliases have their own diff --git a/lldb/include/lldb/Interpreter/CommandObjectCrossref.h b/lldb/include/lldb/Interpreter/CommandObjectCrossref.h deleted file mode 100644 index 0115cffaad2..00000000000 --- a/lldb/include/lldb/Interpreter/CommandObjectCrossref.h +++ /dev/null @@ -1,60 +0,0 @@ -//===-- CommandObjectCrossref.h ---------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef liblldb_CommandObjectCrossref_h_ -#define liblldb_CommandObjectCrossref_h_ - -// C Includes -// C++ Includes -// Other libraries and framework includes -// Project includes -#include "lldb/Interpreter/CommandObject.h" -#include "lldb/Interpreter/Args.h" - -namespace lldb_private { - -//------------------------------------------------------------------------- -// CommandObjectCrossref -//------------------------------------------------------------------------- - -class CommandObjectCrossref : public CommandObjectParsed -{ -public: - CommandObjectCrossref (CommandInterpreter &interpreter, - const char *name, - const char *help = NULL, - const char *syntax = NULL); - - virtual - ~CommandObjectCrossref (); - - virtual void - GenerateHelpText (CommandReturnObject &result); - - virtual bool - IsCrossRefObject (); - - virtual void - AddObject (const char *obj_name); - - const char ** - GetObjectTypes () const; - -protected: - virtual bool - DoExecute (Args& command, - CommandReturnObject &result); - -private: - Args m_crossref_object_types; -}; - -} // namespace lldb_private - -#endif // liblldb_CommandObjectCrossref_h_ diff --git a/lldb/include/lldb/Interpreter/CommandObjectMultiword.h b/lldb/include/lldb/Interpreter/CommandObjectMultiword.h index c1390445630..d417f23eea8 100644 --- a/lldb/include/lldb/Interpreter/CommandObjectMultiword.h +++ b/lldb/include/lldb/Interpreter/CommandObjectMultiword.h @@ -115,12 +115,6 @@ public: virtual const char * GetHelpLong (); - virtual void - AddObject (const char *obj_name); - - virtual bool - IsCrossRefObject (); - virtual bool IsRemovable() const; diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 5049857c188..8977fc6bf50 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -275,7 +275,6 @@ 2689007F13353E2200698AC0 /* CommandCompletions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C09CB74116BD98B00C7A725 /* CommandCompletions.cpp */; }; 2689008013353E2200698AC0 /* CommandInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */; }; 2689008113353E2200698AC0 /* CommandObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */; }; - 2689008213353E2200698AC0 /* CommandObjectCrossref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC57113B48F300DD817F /* CommandObjectCrossref.cpp */; }; 2689008313353E2200698AC0 /* CommandObjectMultiword.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */; }; 2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */; }; 2689008513353E2200698AC0 /* CommandReturnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */; }; @@ -1375,10 +1374,8 @@ 26DE20601161902600A093E2 /* SBBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBlock.cpp; path = source/API/SBBlock.cpp; sourceTree = "<group>"; }; 26DE20621161904200A093E2 /* SBLineEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLineEntry.cpp; path = source/API/SBLineEntry.cpp; sourceTree = "<group>"; }; 26DE20641161904E00A093E2 /* SBSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbol.cpp; path = source/API/SBSymbol.cpp; sourceTree = "<group>"; }; - 26DFBC50113B48D600DD817F /* CommandObjectCrossref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectCrossref.h; path = include/lldb/Interpreter/CommandObjectCrossref.h; sourceTree = "<group>"; }; 26DFBC51113B48D600DD817F /* CommandObjectMultiword.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectMultiword.h; path = include/lldb/Interpreter/CommandObjectMultiword.h; sourceTree = "<group>"; }; 26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectRegexCommand.h; path = include/lldb/Interpreter/CommandObjectRegexCommand.h; sourceTree = "<group>"; }; - 26DFBC57113B48F300DD817F /* CommandObjectCrossref.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectCrossref.cpp; path = source/Commands/CommandObjectCrossref.cpp; sourceTree = "<group>"; }; 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectMultiword.cpp; path = source/Commands/CommandObjectMultiword.cpp; sourceTree = "<group>"; }; 26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectRegexCommand.cpp; path = source/Interpreter/CommandObjectRegexCommand.cpp; sourceTree = "<group>"; }; 26E152231419CACA007967D0 /* ObjectFilePECOFF.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFilePECOFF.cpp; sourceTree = "<group>"; }; @@ -2920,8 +2917,6 @@ 26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */, 26BC7DE310F1B7F900F91463 /* CommandObject.h */, 26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */, - 26DFBC50113B48D600DD817F /* CommandObjectCrossref.h */, - 26DFBC57113B48F300DD817F /* CommandObjectCrossref.cpp */, 26DFBC51113B48D600DD817F /* CommandObjectMultiword.h */, 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */, 26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */, @@ -4005,7 +4000,6 @@ 2689007F13353E2200698AC0 /* CommandCompletions.cpp in Sources */, 2689008013353E2200698AC0 /* CommandInterpreter.cpp in Sources */, 2689008113353E2200698AC0 /* CommandObject.cpp in Sources */, - 2689008213353E2200698AC0 /* CommandObjectCrossref.cpp in Sources */, 2689008313353E2200698AC0 /* CommandObjectMultiword.cpp in Sources */, 2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in Sources */, 2689008513353E2200698AC0 /* CommandReturnObject.cpp in Sources */, 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) { |