summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectArgs.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectArgs.h4
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp16
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.h16
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.h4
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.h4
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp16
-rw-r--r--lldb/source/Commands/CommandObjectExpression.h4
-rw-r--r--lldb/source/Commands/CommandObjectFile.cpp71
-rw-r--r--lldb/source/Commands/CommandObjectFile.h65
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp12
-rw-r--r--lldb/source/Commands/CommandObjectImage.cpp14
-rw-r--r--lldb/source/Commands/CommandObjectLog.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp12
-rw-r--r--lldb/source/Commands/CommandObjectPlatform.cpp261
-rw-r--r--lldb/source/Commands/CommandObjectPlatform.h68
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp30
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectSettings.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectSettings.h4
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp24
26 files changed, 389 insertions, 286 deletions
diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp
index 0ed4a06e564..09363d72dda 100644
--- a/lldb/source/Commands/CommandObjectArgs.cpp
+++ b/lldb/source/Commands/CommandObjectArgs.cpp
@@ -40,7 +40,7 @@ CommandObjectArgs::CommandOptions::CommandOptions (CommandInterpreter &interpret
Options(interpreter)
{
// Keep only one place to reset the values to their defaults
- ResetOptionValues();
+ OptionParsingStarting();
}
@@ -49,7 +49,7 @@ CommandObjectArgs::CommandOptions::~CommandOptions ()
}
Error
-CommandObjectArgs::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectArgs::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
@@ -66,7 +66,7 @@ CommandObjectArgs::CommandOptions::SetOptionValue (int option_idx, const char *o
}
void
-CommandObjectArgs::CommandOptions::ResetOptionValues ()
+CommandObjectArgs::CommandOptions::OptionParsingStarting ()
{
}
diff --git a/lldb/source/Commands/CommandObjectArgs.h b/lldb/source/Commands/CommandObjectArgs.h
index b6a7f3200c0..a3c365db84c 100644
--- a/lldb/source/Commands/CommandObjectArgs.h
+++ b/lldb/source/Commands/CommandObjectArgs.h
@@ -34,10 +34,10 @@ namespace lldb_private {
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index d5a4345ba2e..f3a90fefe6d 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -134,7 +134,7 @@ CommandObjectBreakpointSet::CommandOptions::GetDefinitions ()
}
Error
-CommandObjectBreakpointSet::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectBreakpointSet::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -233,7 +233,7 @@ CommandObjectBreakpointSet::CommandOptions::SetOptionValue (int option_idx, cons
}
void
-CommandObjectBreakpointSet::CommandOptions::ResetOptionValues ()
+CommandObjectBreakpointSet::CommandOptions::OptionParsingStarting ()
{
m_filename.clear();
m_line_num = 0;
@@ -675,7 +675,7 @@ CommandObjectBreakpointList::CommandOptions::GetDefinitions ()
}
Error
-CommandObjectBreakpointList::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectBreakpointList::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -703,7 +703,7 @@ CommandObjectBreakpointList::CommandOptions::SetOptionValue (int option_idx, con
}
void
-CommandObjectBreakpointList::CommandOptions::ResetOptionValues ()
+CommandObjectBreakpointList::CommandOptions::OptionParsingStarting ()
{
m_level = lldb::eDescriptionLevelBrief;
m_internal = false;
@@ -1077,7 +1077,7 @@ CommandObjectBreakpointClear::CommandOptions::GetDefinitions ()
}
Error
-CommandObjectBreakpointClear::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectBreakpointClear::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -1101,7 +1101,7 @@ CommandObjectBreakpointClear::CommandOptions::SetOptionValue (int option_idx, co
}
void
-CommandObjectBreakpointClear::CommandOptions::ResetOptionValues ()
+CommandObjectBreakpointClear::CommandOptions::OptionParsingStarting ()
{
m_filename.clear();
m_line_num = 0;
@@ -1394,7 +1394,7 @@ CommandObjectBreakpointModify::CommandOptions::GetDefinitions ()
}
Error
-CommandObjectBreakpointModify::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectBreakpointModify::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -1480,7 +1480,7 @@ CommandObjectBreakpointModify::CommandOptions::SetOptionValue (int option_idx, c
}
void
-CommandObjectBreakpointModify::CommandOptions::ResetOptionValues ()
+CommandObjectBreakpointModify::CommandOptions::OptionParsingStarting ()
{
m_ignore_count = 0;
m_thread_id = LLDB_INVALID_THREAD_ID;
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h
index c624dc554e2..d8382a75c0b 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.h
+++ b/lldb/source/Commands/CommandObjectBreakpoint.h
@@ -82,10 +82,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
@@ -148,10 +148,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
@@ -249,10 +249,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition *
GetDefinitions ();
@@ -309,10 +309,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index f4815159389..a188baebdeb 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -82,7 +82,7 @@ CommandObjectBreakpointCommandAdd::CommandOptions::GetDefinitions ()
Error
CommandObjectBreakpointCommandAdd::CommandOptions::SetOptionValue
(
- int option_idx,
+ uint32_t option_idx,
const char *option_arg
)
{
@@ -133,7 +133,7 @@ CommandObjectBreakpointCommandAdd::CommandOptions::SetOptionValue
}
void
-CommandObjectBreakpointCommandAdd::CommandOptions::ResetOptionValues ()
+CommandObjectBreakpointCommandAdd::CommandOptions::OptionParsingStarting ()
{
m_use_commands = true;
m_use_script_language = false;
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.h b/lldb/source/Commands/CommandObjectBreakpointCommand.h
index 5cfa848e4c2..38f958b6ceb 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.h
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.h
@@ -101,10 +101,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 8f8dd965293..e0871e0ba36 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -43,7 +43,7 @@ private:
~CommandOptions (){}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -70,7 +70,7 @@ private:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_stop_on_error = true;
m_stop_on_continue = true;
@@ -360,7 +360,7 @@ public:
if (options)
{
// See if any options were specified as part of the alias; if so, handle them appropriately
- options->Reset ();
+ options->NotifyOptionParsingStarting ();
Args tmp_args (raw_command_string.c_str());
args.Unshift ("dummy_arg");
args.ParseAliasOptions (*options, result, option_arg_vector, raw_command_string);
@@ -491,7 +491,7 @@ public:
options = sub_cmd_obj->GetOptions();
else
options = cmd_obj->GetOptions();
- options->Reset ();
+ options->NotifyOptionParsingStarting ();
std::string empty_string;
args.Unshift ("dummy_arg");
args.ParseAliasOptions (*options, result, option_arg_vector, empty_string);
diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp
index dea764074e1..f54bc9e8a6c 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.cpp
+++ b/lldb/source/Commands/CommandObjectDisassemble.cpp
@@ -44,7 +44,7 @@ CommandObjectDisassemble::CommandOptions::CommandOptions (CommandInterpreter &in
plugin_name (),
arch()
{
- ResetOptionValues();
+ OptionParsingStarting();
}
CommandObjectDisassemble::CommandOptions::~CommandOptions ()
@@ -52,7 +52,7 @@ CommandObjectDisassemble::CommandOptions::~CommandOptions ()
}
Error
-CommandObjectDisassemble::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectDisassemble::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
@@ -140,7 +140,7 @@ CommandObjectDisassemble::CommandOptions::SetOptionValue (int option_idx, const
}
void
-CommandObjectDisassemble::CommandOptions::ResetOptionValues ()
+CommandObjectDisassemble::CommandOptions::OptionParsingStarting ()
{
show_mixed = false;
show_bytes = false;
diff --git a/lldb/source/Commands/CommandObjectDisassemble.h b/lldb/source/Commands/CommandObjectDisassemble.h
index ac354a8f2c7..21828100c73 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.h
+++ b/lldb/source/Commands/CommandObjectDisassemble.h
@@ -36,10 +36,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index c96b247ce12..7b9f01cd3c8 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -41,7 +41,7 @@ CommandObjectExpression::CommandOptions::CommandOptions (CommandInterpreter &int
Options(interpreter)
{
// Keep only one place to reset the values to their defaults
- ResetOptionValues();
+ OptionParsingStarting();
}
@@ -50,7 +50,7 @@ CommandObjectExpression::CommandOptions::~CommandOptions ()
}
Error
-CommandObjectExpression::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectExpression::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
@@ -93,7 +93,7 @@ CommandObjectExpression::CommandOptions::SetOptionValue (int option_idx, const c
}
void
-CommandObjectExpression::CommandOptions::ResetOptionValues ()
+CommandObjectExpression::CommandOptions::OptionParsingStarting ()
{
//language.Clear();
debug = false;
@@ -297,7 +297,7 @@ CommandObjectExpression::ExecuteRawCommandString
{
m_exe_ctx = m_interpreter.GetExecutionContext();
- m_options.Reset();
+ m_options.NotifyOptionParsingStarting();
const char * expr = NULL;
@@ -361,6 +361,14 @@ CommandObjectExpression::ExecuteRawCommandString
Args args (command, end_options - command);
if (!ParseOptions (args, result))
return false;
+
+ Error error (m_options.NotifyOptionParsingFinished());
+ if (error.Fail())
+ {
+ result.AppendError (error.AsCString());
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
}
}
diff --git a/lldb/source/Commands/CommandObjectExpression.h b/lldb/source/Commands/CommandObjectExpression.h
index fcf308aa3c5..6eff72c0045 100644
--- a/lldb/source/Commands/CommandObjectExpression.h
+++ b/lldb/source/Commands/CommandObjectExpression.h
@@ -35,10 +35,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
diff --git a/lldb/source/Commands/CommandObjectFile.cpp b/lldb/source/Commands/CommandObjectFile.cpp
index 1177f5aafbc..372baf9e822 100644
--- a/lldb/source/Commands/CommandObjectFile.cpp
+++ b/lldb/source/Commands/CommandObjectFile.cpp
@@ -25,41 +25,51 @@
using namespace lldb;
using namespace lldb_private;
-CommandObjectFile::CommandOptions::CommandOptions(CommandInterpreter &interpreter) :
- Options (interpreter),
- m_arch () // Breakpoint info defaults to brief descriptions
+FileOptionGroup::FileOptionGroup() :
+ m_arch (),
+ m_arch_str ()
{
}
-CommandObjectFile::CommandOptions::~CommandOptions ()
+FileOptionGroup::~FileOptionGroup ()
{
}
-OptionDefinition
-CommandObjectFile::CommandOptions::g_option_table[] =
+OptionDefinition g_file_option_table[] =
{
- { LLDB_OPT_SET_1, false, "arch", 'a', required_argument, NULL, 0, eArgTypeArchitecture, "Specify the architecture to be used when the process is launched."},
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ { LLDB_OPT_SET_1 , false, "arch" , 'a', required_argument, NULL, 0, eArgTypeArchitecture , "Specify the architecture for the target."},
};
+const uint32_t k_num_file_options = sizeof(g_file_option_table)/sizeof(OptionDefinition);
+
+uint32_t
+FileOptionGroup::GetNumDefinitions ()
+{
+ return k_num_file_options;
+}
const OptionDefinition *
-CommandObjectFile::CommandOptions::GetDefinitions ()
+FileOptionGroup::GetDefinitions ()
{
- return g_option_table;
+ return g_file_option_table;
}
Error
-CommandObjectFile::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+FileOptionGroup::SetOptionValue (CommandInterpreter &interpreter,
+ uint32_t option_idx,
+ const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ char short_option = (char) g_file_option_table[option_idx].short_option;
switch (short_option)
{
case 'a':
{
- PlatformSP platform_sp (m_interpreter.GetPlatform (false));
- ArchSpec option_arch (option_arg, platform_sp.get());
+ // Save the arch value in case we specify a platform after specifying the arch
+ m_arch_str.assign (option_arg);
+ // Check to see if we already have a platform?
+ m_arch_platform_sp = interpreter.GetPlatform (false);
+ ArchSpec option_arch (option_arg, m_arch_platform_sp.get());
if (option_arch.IsValid())
m_arch = option_arch;
else
@@ -76,11 +86,30 @@ CommandObjectFile::CommandOptions::SetOptionValue (int option_idx, const char *o
}
void
-CommandObjectFile::CommandOptions::ResetOptionValues ()
+FileOptionGroup::OptionParsingStarting (CommandInterpreter &interpreter)
{
m_arch.Clear();
}
+Error
+FileOptionGroup::OptionParsingFinished (CommandInterpreter &interpreter)
+{
+ Error error;
+ if (m_arch.IsValid())
+ {
+ PlatformSP curr_platform_sp (interpreter.GetPlatform (false));
+ if (curr_platform_sp.get() != m_arch_platform_sp.get())
+ {
+ ArchSpec option_arch (m_arch_str.c_str(), curr_platform_sp.get());
+ if (option_arch.IsValid())
+ m_arch = option_arch;
+ else
+ error.SetErrorStringWithFormat ("invalid arch '%s' for platform '%s'", m_arch_str.c_str(), curr_platform_sp->GetName());
+ }
+ }
+ return error;
+}
+
//-------------------------------------------------------------------------
// CommandObjectFile
//-------------------------------------------------------------------------
@@ -90,7 +119,9 @@ CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
"file",
"Set the file to be used as the main executable by the debugger.",
NULL),
- m_options (interpreter)
+ m_option_group (interpreter),
+ m_file_options (),
+ m_platform_options(true) // Do include the "--platform" option in the platform settings by passing true
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
@@ -104,6 +135,10 @@ CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
+
+ m_option_group.Append (&m_file_options);
+ m_option_group.Append (&m_platform_options);
+ m_option_group.Finalize();
}
CommandObjectFile::~CommandObjectFile ()
@@ -113,7 +148,7 @@ CommandObjectFile::~CommandObjectFile ()
Options *
CommandObjectFile::GetOptions ()
{
- return &m_options;
+ return &m_option_group;
}
bool
@@ -140,7 +175,7 @@ CommandObjectFile::Execute
TargetSP target_sp;
Debugger &debugger = m_interpreter.GetDebugger();
- Error error = debugger.GetTargetList().CreateTarget (debugger, file_spec, m_options.m_arch, true, target_sp);
+ Error error = debugger.GetTargetList().CreateTarget (debugger, file_spec, m_file_options.m_arch, true, target_sp);
if (target_sp)
{
diff --git a/lldb/source/Commands/CommandObjectFile.h b/lldb/source/Commands/CommandObjectFile.h
index bbbacdb4640..1af88964f52 100644
--- a/lldb/source/Commands/CommandObjectFile.h
+++ b/lldb/source/Commands/CommandObjectFile.h
@@ -12,11 +12,13 @@
// C Includes
// C++ Includes
+#include <vector>
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/Options.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Interpreter/CommandObject.h"
+#include "CommandObjectPlatform.h"
namespace lldb_private {
@@ -24,6 +26,38 @@ namespace lldb_private {
// CommandObjectFile
//-------------------------------------------------------------------------
+ class FileOptionGroup : public OptionGroup
+ {
+ public:
+
+ FileOptionGroup ();
+
+ virtual
+ ~FileOptionGroup ();
+
+
+ virtual uint32_t
+ GetNumDefinitions ();
+
+ virtual const OptionDefinition*
+ GetDefinitions ();
+
+ virtual Error
+ SetOptionValue (CommandInterpreter &interpreter,
+ uint32_t option_idx,
+ const char *option_value);
+
+ virtual void
+ OptionParsingStarting (CommandInterpreter &interpreter);
+
+ virtual Error
+ OptionParsingFinished (CommandInterpreter &interpreter);
+
+ ArchSpec m_arch;
+ lldb::PlatformSP m_arch_platform_sp; // The platform that was used to resolve m_arch
+ std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture
+ };
+
class CommandObjectFile : public CommandObject
{
public:
@@ -40,32 +74,6 @@ public:
virtual Options *
GetOptions ();
- class CommandOptions : public Options
- {
- public:
-
- CommandOptions (CommandInterpreter &interpreter);
-
- virtual
- ~CommandOptions ();
-
- virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
-
- void
- ResetOptionValues ();
-
- const OptionDefinition*
- GetDefinitions ();
-
- // Options table: Required for subclasses of Options.
-
- static OptionDefinition g_option_table[];
-
- // Instance variables to hold the values for command options.
-
- ArchSpec m_arch;
- };
virtual int
HandleArgumentCompletion (Args &input,
@@ -79,8 +87,9 @@ public:
private:
- CommandOptions m_options;
-
+ OptionGroupOptions m_option_group;
+ FileOptionGroup m_file_options;
+ PlatformOptionGroup m_platform_options;
};
} // namespace lldb_private
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 57286ac3014..51299c2aaf3 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -102,7 +102,7 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- ResetOptionValues ();
+ OptionParsingStarting ();
}
virtual
@@ -111,7 +111,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
bool success = false;
@@ -133,7 +133,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
relative_frame_offset = INT32_MIN;
}
@@ -293,7 +293,7 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- ResetOptionValues ();
+ OptionParsingStarting ();
}
virtual
@@ -302,7 +302,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
bool success;
@@ -350,7 +350,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
use_objc = false;
use_regex = false;
diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp
index ca109d59576..ae1612e4cf6 100644
--- a/lldb/source/Commands/CommandObjectImage.cpp
+++ b/lldb/source/Commands/CommandObjectImage.cpp
@@ -734,7 +734,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -764,7 +764,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_sort_order = eSortOrderNone;
}
@@ -1155,7 +1155,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
char short_option = (char) m_getopt_table[option_idx].val;
uint32_t width = 0;
@@ -1167,7 +1167,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_format_array.clear();
}
@@ -1365,7 +1365,7 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- ResetOptionValues();
+ OptionParsingStarting();
}
virtual
@@ -1374,7 +1374,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
@@ -1441,7 +1441,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_type = eLookupTypeInvalid;
m_str.clear();
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index b10e8eca477..e38b618bdb3 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -183,7 +183,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -207,7 +207,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
log_file.clear();
log_options = 0;
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 7993f5462eb..bc08d446e44 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -39,7 +39,7 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- ResetOptionValues();
+ OptionParsingStarting();
}
virtual
@@ -48,7 +48,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -162,7 +162,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_format = eFormatBytesWithASCII;
m_byte_size = 0;
@@ -438,7 +438,7 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- ResetOptionValues();
+ OptionParsingStarting();
}
virtual
@@ -447,7 +447,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -491,7 +491,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_format = eFormatBytes;
m_byte_size = 1;
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index 730a1b3dd01..46a53c7139e 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -27,24 +27,134 @@
using namespace lldb;
using namespace lldb_private;
+
+PlatformSP
+PlatformOptionGroup::CreatePlatformWithOptions (CommandInterpreter &interpreter,
+ const char *platform_name,
+ bool select,
+ Error& error)
+{
+ if (platform_name && platform_name[0])
+ {
+ if (platform_sp)
+ {
+ error.SetErrorString ("platform can't be set more than once in a command");
+ return PlatformSP();
+ }
+
+ platform_sp = Platform::Create (platform_name, error);
+
+ if (platform_sp)
+ {
+ interpreter.GetDebugger().GetPlatformList().Append (platform_sp, select);
+ if (os_version_major != UINT32_MAX)
+ {
+ platform_sp->SetOSVersion (os_version_major,
+ os_version_minor,
+ os_version_update);
+ }
+ }
+ }
+ else
+ {
+ error.SetErrorString ("invalid platform name");
+ platform_sp.reset();
+ }
+ return platform_sp;
+}
+
+void
+PlatformOptionGroup::OptionParsingStarting (CommandInterpreter &interpreter)
+{
+ platform_sp.reset();
+ os_version_major = UINT32_MAX;
+ os_version_minor = UINT32_MAX;
+ os_version_update = UINT32_MAX;
+}
+
+static OptionDefinition
+g_option_table[] =
+{
+ { LLDB_OPT_SET_ALL, false, "platform" , 'p', required_argument, NULL, 0, eArgTypeNone, "Specify name of the platform to use for this target, creating the platform if necessary."},
+ { LLDB_OPT_SET_ALL, false, "sdk-version", 'v', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." }
+};
+
+static const uint32_t k_option_table_size = sizeof(g_option_table)/sizeof (OptionDefinition);
+
+const OptionDefinition*
+PlatformOptionGroup::GetDefinitions ()
+{
+ if (m_include_platform_option)
+ return g_option_table;
+ return g_option_table + 1;
+}
+
+uint32_t
+PlatformOptionGroup::GetNumDefinitions ()
+{
+ if (m_include_platform_option)
+ return k_option_table_size;
+ return k_option_table_size - 1;
+}
+
+
+Error
+PlatformOptionGroup::SetOptionValue (CommandInterpreter &interpreter,
+ uint32_t option_idx,
+ const char *option_arg)
+{
+ Error error;
+ if (!m_include_platform_option)
+ --option_idx;
+
+ char short_option = (char) g_option_table[option_idx].short_option;
+
+ switch (short_option)
+ {
+ case 'p':
+ CreatePlatformWithOptions (interpreter, option_arg, true, error);
+ break;
+
+ case 'v':
+ if (Args::StringToVersion (option_arg, os_version_major, os_version_minor, os_version_update) == option_arg)
+ {
+ error.SetErrorStringWithFormat ("invalid version string '%s'", option_arg);
+ }
+ else
+ {
+ if (platform_sp)
+ platform_sp->SetOSVersion (os_version_major, os_version_minor, os_version_update);
+ }
+ break;
+
+ default:
+ error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
+ break;
+ }
+ return error;
+}
+
//----------------------------------------------------------------------
// "platform create <platform-name>"
//----------------------------------------------------------------------
-class CommandObjectPlatformCreate : public CommandObject
+class CommandObjectPlatformSelect : public CommandObject
{
public:
- CommandObjectPlatformCreate (CommandInterpreter &interpreter) :
+ CommandObjectPlatformSelect (CommandInterpreter &interpreter) :
CommandObject (interpreter,
- "platform create",
- "Create a platform instance by name and select it as the current platform.",
- "platform create <platform-name>",
+ "platform select",
+ "Create a platform if needed and select it as the current platform.",
+ "platform select <platform-name>",
0),
- m_options (interpreter)
+ m_option_group (interpreter),
+ m_platform_options (false) // Don't include the "--platform" option by passing false
{
+ m_option_group.Append (&m_platform_options);
+ m_option_group.Finalize();
}
virtual
- ~CommandObjectPlatformCreate ()
+ ~CommandObjectPlatformSelect ()
{
}
@@ -54,20 +164,13 @@ public:
Error error;
if (args.GetArgumentCount() == 1)
{
- PlatformSP platform_sp (Platform::Create (args.GetArgumentAtIndex (0), error));
-
+ const bool select = true;
+ PlatformSP platform_sp (m_platform_options.CreatePlatformWithOptions (m_interpreter,
+ args.GetArgumentAtIndex (0),
+ select,
+ error));
if (platform_sp)
- {
- m_interpreter.GetDebugger().GetPlatformList().Append (platform_sp, true);
- if (m_options.os_version_major != UINT32_MAX)
- {
- platform_sp->SetOSVersion (m_options.os_version_major,
- m_options.os_version_minor,
- m_options.os_version_update);
- }
-
platform_sp->GetStatus (result.GetOutputStream());
- }
}
else
{
@@ -80,86 +183,12 @@ public:
virtual Options *
GetOptions ()
{
- return &m_options;
+ return &m_option_group;
}
protected:
-
- class CommandOptions : public Options
- {
- public:
-
- CommandOptions (CommandInterpreter &interpreter) :
- Options (interpreter),
- os_version_major (UINT32_MAX),
- os_version_minor (UINT32_MAX),
- os_version_update (UINT32_MAX)
- {
- }
-
- virtual
- ~CommandOptions ()
- {
- }
-
- virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
- {
- Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
-
- switch (short_option)
- {
- case 'v':
- if (Args::StringToVersion (option_arg,
- os_version_major,
- os_version_minor,
- os_version_update) == option_arg)
- {
- error.SetErrorStringWithFormat ("invalid version string '%s'", option_arg);
- }
- break;
-
- default:
- error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
- break;
- }
-
- return error;
- }
-
- void
- ResetOptionValues ()
- {
- os_version_major = UINT32_MAX;
- os_version_minor = UINT32_MAX;
- os_version_update = UINT32_MAX;
- }
-
- const OptionDefinition*
- GetDefinitions ()
- {
- return g_option_table;
- }
-
- // Options table: Required for subclasses of Options.
-
- static OptionDefinition g_option_table[];
-
- // Instance variables to hold the values for command options.
-
- uint32_t os_version_major;
- uint32_t os_version_minor;
- uint32_t os_version_update;
- };
- CommandOptions m_options;
-};
-
-OptionDefinition
-CommandObjectPlatformCreate::CommandOptions::g_option_table[] =
-{
- { LLDB_OPT_SET_ALL, false, "sdk-version", 'v', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." },
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ OptionGroupOptions m_option_group;
+ PlatformOptionGroup m_platform_options;
};
//----------------------------------------------------------------------
@@ -256,37 +285,6 @@ public:
}
};
-
-//----------------------------------------------------------------------
-// "platform select <platform-name>"
-//----------------------------------------------------------------------
-class CommandObjectPlatformSelect : public CommandObject
-{
-public:
- CommandObjectPlatformSelect (CommandInterpreter &interpreter) :
- CommandObject (interpreter,
- "platform select",
- "Select a platform by name to be the currently selected platform.",
- "platform select <platform-name>",
- 0)
- {
- }
-
- virtual
- ~CommandObjectPlatformSelect ()
- {
- }
-
- virtual bool
- Execute (Args& args, CommandReturnObject &result)
- {
- result.AppendError ("command not implemented\n");
- result.SetStatus (eReturnStatusFailed);
- return result.Succeeded();
- }
-};
-
-
//----------------------------------------------------------------------
// "platform connect <connect-url>"
//----------------------------------------------------------------------
@@ -683,7 +681,7 @@ protected:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -773,7 +771,7 @@ protected:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
match_info.Clear();
show_args = false;
@@ -956,11 +954,10 @@ CommandObjectPlatform::CommandObjectPlatform(CommandInterpreter &interpreter) :
CommandObjectMultiword (interpreter,
"platform",
"A set of commands to manage and create platforms.",
- "platform [connect|create|disconnect|info|list|status|select] ...")
+ "platform [connect|disconnect|info|list|status|select] ...")
{
- LoadSubCommand ("create", CommandObjectSP (new CommandObjectPlatformCreate (interpreter)));
- LoadSubCommand ("list" , CommandObjectSP (new CommandObjectPlatformList (interpreter)));
LoadSubCommand ("select", CommandObjectSP (new CommandObjectPlatformSelect (interpreter)));
+ LoadSubCommand ("list" , CommandObjectSP (new CommandObjectPlatformList (interpreter)));
LoadSubCommand ("status", CommandObjectSP (new CommandObjectPlatformStatus (interpreter)));
LoadSubCommand ("connect", CommandObjectSP (new CommandObjectPlatformConnect (interpreter)));
LoadSubCommand ("disconnect", CommandObjectSP (new CommandObjectPlatformDisconnect (interpreter)));
diff --git a/lldb/source/Commands/CommandObjectPlatform.h b/lldb/source/Commands/CommandObjectPlatform.h
index 994052e6001..255fc3bb911 100644
--- a/lldb/source/Commands/CommandObjectPlatform.h
+++ b/lldb/source/Commands/CommandObjectPlatform.h
@@ -15,6 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObjectMultiword.h"
+#include "lldb/Interpreter/Options.h"
namespace lldb_private {
@@ -25,21 +26,74 @@ namespace lldb_private {
class CommandObjectPlatform : public CommandObjectMultiword
{
public:
- //------------------------------------------------------------------
- // Constructors and Destructors
- //------------------------------------------------------------------
CommandObjectPlatform(CommandInterpreter &interpreter);
virtual
~CommandObjectPlatform();
-private:
- //------------------------------------------------------------------
- // For CommandObjectPlatform only
- //------------------------------------------------------------------
+ private:
DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatform);
};
+
+//-------------------------------------------------------------------------
+// PlatformOptionGroup
+//
+// Make platform options available to to any other command in case they
+// need them. The "file" command needs them, and by exposing them we can
+// reuse the platform command options for any command, we can keep things
+// consistent.
+//-------------------------------------------------------------------------
+class PlatformOptionGroup : public OptionGroup
+{
+public:
+
+ PlatformOptionGroup (bool include_platform_option) :
+ m_include_platform_option (include_platform_option),
+ platform_sp (),
+ os_version_major (UINT32_MAX),
+ os_version_minor (UINT32_MAX),
+ os_version_update (UINT32_MAX)
+ {
+ }
+
+ virtual
+ ~PlatformOptionGroup ()
+ {
+ }
+
+ virtual uint32_t
+ GetNumDefinitions ();
+
+ virtual const OptionDefinition*
+ GetDefinitions ();
+
+ virtual Error
+ SetOptionValue (CommandInterpreter &interpreter,
+ uint32_t option_idx,
+ const char *option_value);
+
+ lldb::PlatformSP
+ CreatePlatformWithOptions (CommandInterpreter &interpreter,
+ const char *platform_name,
+ bool select,
+ Error& error);
+
+ virtual void
+ OptionParsingStarting (CommandInterpreter &interpreter);
+
+ // Instance variables to hold the values for command options.
+
+ lldb::PlatformSP platform_sp;
+ uint32_t os_version_major;
+ uint32_t os_version_minor;
+ uint32_t os_version_update;
+protected:
+ bool m_include_platform_option;
+};
+
+
+
} // namespace lldb_private
#endif // liblldb_CommandObjectPlatform_h_
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 1fc573b9266..aed04bd6a81 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -43,8 +43,8 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- // Keep default values of all options in one place: ResetOptionValues ()
- ResetOptionValues ();
+ // Keep default values of all options in one place: OptionParsingStarting ()
+ OptionParsingStarting ();
}
~CommandOptions ()
@@ -52,7 +52,7 @@ public:
}
Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -80,7 +80,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
stop_at_entry = false;
in_new_tty = false;
@@ -423,8 +423,8 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- // Keep default values of all options in one place: ResetOptionValues ()
- ResetOptionValues ();
+ // Keep default values of all options in one place: OptionParsingStarting ()
+ OptionParsingStarting ();
}
~CommandOptions ()
@@ -432,7 +432,7 @@ public:
}
Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -467,7 +467,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
pid = LLDB_INVALID_PROCESS_ID;
name.clear();
@@ -973,8 +973,8 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- // Keep default values of all options in one place: ResetOptionValues ()
- ResetOptionValues ();
+ // Keep default values of all options in one place: OptionParsingStarting ()
+ OptionParsingStarting ();
}
~CommandOptions ()
@@ -982,7 +982,7 @@ public:
}
Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -1001,7 +1001,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
plugin_name.clear();
}
@@ -1559,7 +1559,7 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options (interpreter)
{
- ResetOptionValues ();
+ OptionParsingStarting ();
}
~CommandOptions ()
@@ -1567,7 +1567,7 @@ public:
}
Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -1591,7 +1591,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
stop.clear();
notify.clear();
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index 2607854ed2e..d3c8d63be01 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -159,7 +159,7 @@ protected:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- ResetOptionValues();
+ OptionParsingStarting();
}
virtual
@@ -168,7 +168,7 @@ protected:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -186,7 +186,7 @@ protected:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_format = eFormatBytes;
}
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp
index b5cf3260b54..02a3287f4ea 100644
--- a/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/lldb/source/Commands/CommandObjectSettings.cpp
@@ -263,7 +263,7 @@ CommandObjectSettingsSet::CommandOptions::GetDefinitions ()
}
Error
-CommandObjectSettingsSet::CommandOptions::SetOptionValue (int option_idx, const char *option_arg)
+CommandObjectSettingsSet::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -285,7 +285,7 @@ CommandObjectSettingsSet::CommandOptions::SetOptionValue (int option_idx, const
}
void
-CommandObjectSettingsSet::CommandOptions::ResetOptionValues ()
+CommandObjectSettingsSet::CommandOptions::OptionParsingStarting ()
{
m_override = true;
m_reset = false;
diff --git a/lldb/source/Commands/CommandObjectSettings.h b/lldb/source/Commands/CommandObjectSettings.h
index 170b7f2fbd6..13f781f4d07 100644
--- a/lldb/source/Commands/CommandObjectSettings.h
+++ b/lldb/source/Commands/CommandObjectSettings.h
@@ -65,10 +65,10 @@ public:
~CommandOptions ();
virtual Error
- SetOptionValue (int option_idx, const char *option_arg);
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
void
- ResetOptionValues ();
+ OptionParsingStarting ();
const OptionDefinition*
GetDefinitions ();
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index 29b17dc1d42..4cca0752746 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -47,7 +47,7 @@ class CommandObjectSourceInfo : public CommandObject
}
Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
const char short_option = g_option_table[option_idx].short_option;
@@ -72,7 +72,7 @@ class CommandObjectSourceInfo : public CommandObject
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
file_spec.Clear();
file_name.clear();
@@ -159,7 +159,7 @@ class CommandObjectSourceList : public CommandObject
}
Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
const char short_option = g_option_table[option_idx].short_option;
@@ -197,7 +197,7 @@ class CommandObjectSourceList : public CommandObject
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
file_spec.Clear();
file_name.clear();
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 76866207829..5a90bfb1288 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -508,7 +508,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -587,7 +587,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_class_name.clear();
m_function_name.clear();
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index f321000768d..fd90720b1e8 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -252,8 +252,8 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
- // Keep default values of all options in one place: ResetOptionValues ()
- ResetOptionValues ();
+ // Keep default values of all options in one place: OptionParsingStarting ()
+ OptionParsingStarting ();
}
virtual
@@ -262,7 +262,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -298,7 +298,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_count = -1;
m_start = 0;
@@ -490,8 +490,8 @@ public:
CommandOptions (CommandInterpreter &interpreter) :
Options (interpreter)
{
- // Keep default values of all options in one place: ResetOptionValues ()
- ResetOptionValues ();
+ // Keep default values of all options in one place: OptionParsingStarting ()
+ OptionParsingStarting ();
}
virtual
@@ -500,7 +500,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -542,7 +542,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_avoid_no_debug = true;
m_run_mode = eOnlyDuringStepping;
@@ -981,8 +981,8 @@ public:
m_thread_idx(LLDB_INVALID_THREAD_ID),
m_frame_idx(LLDB_INVALID_FRAME_ID)
{
- // Keep default values of all options in one place: ResetOptionValues ()
- ResetOptionValues ();
+ // Keep default values of all options in one place: OptionParsingStarting ()
+ OptionParsingStarting ();
}
virtual
@@ -991,7 +991,7 @@ public:
}
virtual Error
- SetOptionValue (int option_idx, const char *option_arg)
+ SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
char short_option = (char) m_getopt_table[option_idx].val;
@@ -1040,7 +1040,7 @@ public:
}
void
- ResetOptionValues ()
+ OptionParsingStarting ()
{
m_thread_idx = LLDB_INVALID_THREAD_ID;
m_frame_idx = 0;
OpenPOWER on IntegriCloud