From a701509229f658eac7c10bd6aa54cf6ed5b5011d Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 18 Sep 2010 01:14:36 +0000 Subject: Fixed the way set/show variables were being accessed to being natively accessed by the objects that own the settings. The previous approach wasn't very usable and made for a lot of unnecessary code just to access variables that were already owned by the objects. While I fixed those things, I saw that CommandObject objects should really have a reference to their command interpreter so they can access the terminal with if they want to output usaage. Fixed up all CommandObjects to take an interpreter and cleaned up the API to not need the interpreter to be passed in. Fixed the disassemble command to output the usage if no options are passed down and arguments are passed (all disassebmle variants take options, there are no "args only"). llvm-svn: 114252 --- lldb/source/Interpreter/CommandObjectRegexCommand.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lldb/source/Interpreter/CommandObjectRegexCommand.cpp') diff --git a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp index 30f3eef50ef..534038aeaff 100644 --- a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp +++ b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp @@ -24,12 +24,13 @@ using namespace lldb_private; //---------------------------------------------------------------------- CommandObjectRegexCommand::CommandObjectRegexCommand ( + CommandInterpreter &interpreter, const char *name, const char *help, const char *syntax, uint32_t max_matches ) : - CommandObject (name, help, syntax), + CommandObject (interpreter, name, help, syntax), m_max_matches (max_matches), m_entries () { @@ -46,7 +47,6 @@ CommandObjectRegexCommand::~CommandObjectRegexCommand() bool CommandObjectRegexCommand::Execute ( - CommandInterpreter &interpreter, Args& command, CommandReturnObject &result ) @@ -58,7 +58,6 @@ CommandObjectRegexCommand::Execute bool CommandObjectRegexCommand::ExecuteRawCommandString ( - CommandInterpreter &interpreter, const char *command, CommandReturnObject &result ) @@ -90,7 +89,7 @@ CommandObjectRegexCommand::ExecuteRawCommandString // Interpret the new command and return this as the result! // if (m_options.verbose) // result.GetOutputStream().Printf("%s\n", new_command.c_str()); - return interpreter.HandleCommand(new_command.c_str(), true, result); + return m_interpreter.HandleCommand(new_command.c_str(), true, result); } } result.SetStatus(eReturnStatusFailed); -- cgit v1.2.3