summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectArgs.cpp7
-rw-r--r--lldb/source/Commands/CommandObjectArgs.h2
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp28
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.h8
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp7
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.h2
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.cpp14
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.h2
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp5
-rw-r--r--lldb/source/Commands/CommandObjectExpression.h2
-rw-r--r--lldb/source/Commands/CommandObjectFile.cpp10
-rw-r--r--lldb/source/Commands/CommandObjectFile.h2
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp16
-rw-r--r--lldb/source/Commands/CommandObjectHelp.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectImage.cpp23
-rw-r--r--lldb/source/Commands/CommandObjectLog.cpp7
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp14
-rw-r--r--lldb/source/Commands/CommandObjectPlatform.cpp24
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp41
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectSettings.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectSettings.h2
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp14
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp7
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp18
26 files changed, 156 insertions, 123 deletions
diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp
index f75ac0b17ab..26ffa19c7a4 100644
--- a/lldb/source/Commands/CommandObjectArgs.cpp
+++ b/lldb/source/Commands/CommandObjectArgs.cpp
@@ -36,8 +36,8 @@ using namespace lldb_private;
// calling functions.
//
-CommandObjectArgs::CommandOptions::CommandOptions () :
- Options()
+CommandObjectArgs::CommandOptions::CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter)
{
// Keep only one place to reset the values to their defaults
ResetOptionValues();
@@ -80,7 +80,8 @@ CommandObjectArgs::CommandObjectArgs (CommandInterpreter &interpreter) :
CommandObject (interpreter,
"args",
"When stopped at the start of a function, reads function arguments of type (u?)int(8|16|32|64)_t, (void|char)*",
- "args")
+ "args"),
+ m_options (interpreter)
{
}
diff --git a/lldb/source/Commands/CommandObjectArgs.h b/lldb/source/Commands/CommandObjectArgs.h
index 544d343df22..b6a7f3200c0 100644
--- a/lldb/source/Commands/CommandObjectArgs.h
+++ b/lldb/source/Commands/CommandObjectArgs.h
@@ -28,7 +28,7 @@ namespace lldb_private {
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 8208ea8123c..c8287015643 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -47,8 +47,8 @@ AddBreakpointDescription (Stream *s, Breakpoint *bp, lldb::DescriptionLevel leve
//-------------------------------------------------------------------------
#pragma mark Set::CommandOptions
-CommandObjectBreakpointSet::CommandOptions::CommandOptions() :
- Options (),
+CommandObjectBreakpointSet::CommandOptions::CommandOptions(CommandInterpreter &interpreter) :
+ Options (interpreter),
m_filename (),
m_line_num (0),
m_column (0),
@@ -259,7 +259,8 @@ CommandObjectBreakpointSet::CommandObjectBreakpointSet (CommandInterpreter &inte
CommandObject (interpreter,
"breakpoint set",
"Sets a breakpoint or set of breakpoints in the executable.",
- "breakpoint set <cmd-options>")
+ "breakpoint set <cmd-options>"),
+ m_options (interpreter)
{
}
@@ -637,8 +638,8 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe
//-------------------------------------------------------------------------
#pragma mark List::CommandOptions
-CommandObjectBreakpointList::CommandOptions::CommandOptions() :
- Options (),
+CommandObjectBreakpointList::CommandOptions::CommandOptions(CommandInterpreter &interpreter) :
+ Options (interpreter),
m_level (lldb::eDescriptionLevelBrief) // Breakpoint List defaults to brief descriptions
{
}
@@ -717,7 +718,8 @@ CommandObjectBreakpointList::CommandObjectBreakpointList (CommandInterpreter &in
CommandObject (interpreter,
"breakpoint list",
"List some or all breakpoints at configurable levels of detail.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData bp_id_arg;
@@ -1045,8 +1047,8 @@ CommandObjectBreakpointDisable::Execute
//-------------------------------------------------------------------------
#pragma mark Clear::CommandOptions
-CommandObjectBreakpointClear::CommandOptions::CommandOptions() :
- Options (),
+CommandObjectBreakpointClear::CommandOptions::CommandOptions(CommandInterpreter &interpreter) :
+ Options (interpreter),
m_filename (),
m_line_num (0)
{
@@ -1114,7 +1116,8 @@ CommandObjectBreakpointClear::CommandObjectBreakpointClear (CommandInterpreter &
CommandObject (interpreter,
"breakpoint clear",
"Clears a breakpoint or set of breakpoints in the executable.",
- "breakpoint clear <cmd-options>")
+ "breakpoint clear <cmd-options>"),
+ m_options (interpreter)
{
}
@@ -1348,8 +1351,8 @@ CommandObjectBreakpointDelete::Execute
//-------------------------------------------------------------------------
#pragma mark Modify::CommandOptions
-CommandObjectBreakpointModify::CommandOptions::CommandOptions() :
- Options (),
+CommandObjectBreakpointModify::CommandOptions::CommandOptions(CommandInterpreter &interpreter) :
+ Options (interpreter),
m_ignore_count (0),
m_thread_id(LLDB_INVALID_THREAD_ID),
m_thread_id_passed(false),
@@ -1504,7 +1507,8 @@ CommandObjectBreakpointModify::CommandObjectBreakpointModify (CommandInterpreter
"Modify the options on a breakpoint or set of breakpoints in the executable. "
"If no breakpoint is specified, acts on the last created breakpoint. "
"With the exception of -e, -d and -i, passing an empty argument clears the modification.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData bp_id_arg;
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h
index fdfd1d90bf6..c624dc554e2 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.h
+++ b/lldb/source/Commands/CommandObjectBreakpoint.h
@@ -76,7 +76,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
@@ -142,7 +142,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
@@ -243,7 +243,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
@@ -303,7 +303,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index c3d50ea0209..f4815159389 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -31,8 +31,8 @@ using namespace lldb_private;
// CommandObjectBreakpointCommandAdd::CommandOptions
//-------------------------------------------------------------------------
-CommandObjectBreakpointCommandAdd::CommandOptions::CommandOptions () :
- Options (),
+CommandObjectBreakpointCommandAdd::CommandOptions::CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter),
m_use_commands (false),
m_use_script_language (false),
m_script_language (eScriptLanguageNone),
@@ -153,7 +153,8 @@ CommandObjectBreakpointCommandAdd::CommandObjectBreakpointCommandAdd (CommandInt
CommandObject (interpreter,
"add",
"Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
SetHelpLong (
"\nGeneral information about entering breakpoint commands \n\
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.h b/lldb/source/Commands/CommandObjectBreakpointCommand.h
index 5e3e1a1abff..5cfa848e4c2 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.h
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.h
@@ -95,7 +95,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index b3a974b538e..8f8dd965293 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -34,7 +34,10 @@ private:
{
public:
- CommandOptions (){}
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter)
+ {
+ }
virtual
~CommandOptions (){}
@@ -106,7 +109,8 @@ public:
CommandObject (interpreter,
"commands source",
"Read in debugger commands from the file <filename> and execute them.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp
index 6567a0896a9..84630ff9955 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.cpp
+++ b/lldb/source/Commands/CommandObjectDisassemble.cpp
@@ -32,8 +32,8 @@
using namespace lldb;
using namespace lldb_private;
-CommandObjectDisassemble::CommandOptions::CommandOptions () :
- Options(),
+CommandObjectDisassemble::CommandOptions::CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter),
num_lines_context(0),
num_instructions (0),
func_name(),
@@ -128,7 +128,7 @@ CommandObjectDisassemble::CommandOptions::SetOptionValue (int option_idx, const
break;
case 'a':
- arch.SetTriple (option_arg);
+ arch.SetTriple (option_arg, m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform().get());
break;
default:
@@ -195,7 +195,8 @@ CommandObjectDisassemble::CommandObjectDisassemble (CommandInterpreter &interpre
CommandObject (interpreter,
"disassemble",
"Disassemble bytes in the current function, or elsewhere in the executable program as specified by the user.",
- "disassemble [<cmd-options>]")
+ "disassemble [<cmd-options>]"),
+ m_options (interpreter)
{
}
@@ -248,10 +249,7 @@ CommandObjectDisassemble::Execute
if (command.GetArgumentCount() != 0)
{
result.AppendErrorWithFormat ("\"disassemble\" arguments are specified as options.\n");
- GetOptions()->GenerateOptionUsage (m_interpreter,
- result.GetErrorStream(),
- this);
-
+ GetOptions()->GenerateOptionUsage (result.GetErrorStream(), this);
result.SetStatus (eReturnStatusFailed);
return false;
}
diff --git a/lldb/source/Commands/CommandObjectDisassemble.h b/lldb/source/Commands/CommandObjectDisassemble.h
index 46b4bacfccd..ac354a8f2c7 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.h
+++ b/lldb/source/Commands/CommandObjectDisassemble.h
@@ -30,7 +30,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 220801f132c..5e5f96898b4 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -37,8 +37,8 @@
using namespace lldb;
using namespace lldb_private;
-CommandObjectExpression::CommandOptions::CommandOptions () :
- Options()
+CommandObjectExpression::CommandOptions::CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter)
{
// Keep only one place to reset the values to their defaults
ResetOptionValues();
@@ -115,6 +115,7 @@ CommandObjectExpression::CommandObjectExpression (CommandInterpreter &interprete
"expression",
"Evaluate a C/ObjC/C++ expression in the current program context, using variables currently in scope.",
NULL),
+ m_options (interpreter),
m_expr_line_count (0),
m_expr_lines ()
{
diff --git a/lldb/source/Commands/CommandObjectExpression.h b/lldb/source/Commands/CommandObjectExpression.h
index 5ddb0db6ddc..fcf308aa3c5 100644
--- a/lldb/source/Commands/CommandObjectExpression.h
+++ b/lldb/source/Commands/CommandObjectExpression.h
@@ -29,7 +29,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
diff --git a/lldb/source/Commands/CommandObjectFile.cpp b/lldb/source/Commands/CommandObjectFile.cpp
index 6f1267ebf1d..e0c81bbf983 100644
--- a/lldb/source/Commands/CommandObjectFile.cpp
+++ b/lldb/source/Commands/CommandObjectFile.cpp
@@ -25,8 +25,8 @@
using namespace lldb;
using namespace lldb_private;
-CommandObjectFile::CommandOptions::CommandOptions() :
- Options (),
+CommandObjectFile::CommandOptions::CommandOptions(CommandInterpreter &interpreter) :
+ Options (interpreter),
m_arch () // Breakpoint info defaults to brief descriptions
{
}
@@ -58,7 +58,8 @@ CommandObjectFile::CommandOptions::SetOptionValue (int option_idx, const char *o
{
case 'a':
{
- ArchSpec option_arch (option_arg);
+ PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
+ ArchSpec option_arch (option_arg, platform_sp.get());
if (option_arch.IsValid())
m_arch = option_arch;
else
@@ -88,7 +89,8 @@ CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
CommandObject (interpreter,
"file",
"Set the file to be used as the main executable by the debugger.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
diff --git a/lldb/source/Commands/CommandObjectFile.h b/lldb/source/Commands/CommandObjectFile.h
index bccb4bc2e47..bbbacdb4640 100644
--- a/lldb/source/Commands/CommandObjectFile.h
+++ b/lldb/source/Commands/CommandObjectFile.h
@@ -44,7 +44,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 8c83b674fc3..3b697fd52cb 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -99,8 +99,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter)
{
ResetOptionValues ();
}
@@ -155,7 +155,8 @@ public:
"frame select",
"Select a frame by index from within the current thread and make it the current frame.",
NULL,
- eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
+ eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData index_arg;
@@ -224,7 +225,7 @@ public:
else
{
result.AppendError ("invalid arguments.\n");
- m_options.GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this);
+ m_options.GenerateOptionUsage (result.GetErrorStream(), this);
}
}
@@ -289,8 +290,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter)
{
ResetOptionValues ();
}
@@ -407,7 +408,8 @@ public:
"Children of aggregate variables can be specified such as "
"'var->child.x'.",
NULL,
- eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
+ eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData var_name_arg;
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index 98fe2ad58c2..bbf1552e7e3 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -140,7 +140,7 @@ CommandObjectHelp::Execute (Args& command, CommandReturnObject &result)
else
m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1);
output_strm.Printf ("\nSyntax: %s\n", sub_cmd_obj->GetSyntax());
- sub_cmd_obj->GetOptions()->GenerateOptionUsage (m_interpreter, output_strm, sub_cmd_obj);
+ sub_cmd_obj->GetOptions()->GenerateOptionUsage (output_strm, sub_cmd_obj);
const char *long_help = sub_cmd_obj->GetHelpLong();
if ((long_help != NULL)
&& (strlen (long_help) > 0))
diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp
index d684bb2df98..a59aff00d9c 100644
--- a/lldb/source/Commands/CommandObjectImage.cpp
+++ b/lldb/source/Commands/CommandObjectImage.cpp
@@ -603,7 +603,8 @@ public:
CommandObjectImageDumpModuleList (interpreter,
"image dump symtab",
"Dump the symbol table from one or more executable images.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
}
@@ -719,8 +720,8 @@ public:
{
public:
- CommandOptions () :
- Options(),
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter),
m_sort_order (eSortOrderNone)
{
}
@@ -1140,8 +1141,8 @@ public:
{
public:
- CommandOptions () :
- Options(),
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter),
m_format_array()
{
}
@@ -1188,7 +1189,8 @@ public:
CommandObject (interpreter,
"image list",
"List current executable and dependent shared library images.",
- "image list [<cmd-options>]")
+ "image list [<cmd-options>]"),
+ m_options (interpreter)
{
}
@@ -1346,8 +1348,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(m_interpreter)
{
ResetOptionValues();
}
@@ -1463,7 +1465,8 @@ public:
CommandObject (interpreter,
"image lookup",
"Look up information within executable and dependent shared library images.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
@@ -1572,7 +1575,7 @@ public:
break;
default:
- m_options.GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this);
+ m_options.GenerateOptionUsage (result.GetErrorStream(), this);
syntax_error = true;
break;
}
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index 383e29974f8..b10e8eca477 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -62,7 +62,8 @@ public:
CommandObject (interpreter,
"log enable",
"Enable logging for a single log channel.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg1;
@@ -168,8 +169,8 @@ public:
{
public:
- CommandOptions () :
- Options (),
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter),
log_file (),
log_options (0)
{
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index f63848c0a65..c731c61836c 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -36,8 +36,8 @@ public:
class CommandOptions : public Options
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
ResetOptionValues();
}
@@ -198,7 +198,8 @@ public:
"memory read",
"Read from the memory of the process being debugged.",
NULL,
- eFlagProcessMustBeLaunched)
+ eFlagProcessMustBeLaunched),
+ m_options (interpreter)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -434,8 +435,8 @@ public:
class CommandOptions : public Options
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
ResetOptionValues();
}
@@ -521,7 +522,8 @@ public:
"Write to the memory of the process being debugged.",
//"memory write [<cmd-options>] <addr> [value1 value2 ...]",
NULL,
- eFlagProcessMustBeLaunched)
+ eFlagProcessMustBeLaunched),
+ m_options (interpreter)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index 12515ce3ec6..a72b0db4d14 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -19,8 +19,10 @@
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/Options.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Platform.h"
+#include "lldb/Target/Process.h"
using namespace lldb;
using namespace lldb_private;
@@ -36,7 +38,8 @@ public:
"platform create",
"Create a platform instance by name and select it as the current platform.",
"platform create <platform-name>",
- 0)
+ 0),
+ m_options (interpreter)
{
}
@@ -86,7 +89,8 @@ protected:
{
public:
- CommandOptions () :
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter),
os_version_major (UINT32_MAX),
os_version_minor (UINT32_MAX),
os_version_update (UINT32_MAX)
@@ -418,11 +422,12 @@ class CommandObjectPlatformProcessList : public CommandObject
{
public:
CommandObjectPlatformProcessList (CommandInterpreter &interpreter) :
- CommandObject (interpreter,
- "platform process list",
- "List processes on a remote platform by name, pid, or many other matching attributes.",
- "platform process list",
- 0)
+ CommandObject (interpreter,
+ "platform process list",
+ "List processes on a remote platform by name, pid, or many other matching attributes.",
+ "platform process list",
+ 0),
+ m_options (interpreter)
{
}
@@ -529,7 +534,8 @@ protected:
{
public:
- CommandOptions () :
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter),
match_info ()
{
}
@@ -585,7 +591,7 @@ protected:
break;
case 'a':
- match_info.GetProcessInfo().GetArchitecture().SetTriple (option_arg);
+ match_info.GetProcessInfo().GetArchitecture().SetTriple (option_arg, m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform().get());
break;
case 'n':
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 8287481eec2..116309d94d5 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -40,8 +40,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
// Keep default values of all options in one place: ResetOptionValues ()
ResetOptionValues ();
@@ -121,7 +121,8 @@ public:
CommandObject (interpreter,
"process launch",
"Launch the executable in the debugger.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData run_args_arg;
@@ -433,8 +434,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
// Keep default values of all options in one place: ResetOptionValues ()
ResetOptionValues ();
@@ -494,8 +495,7 @@ public:
}
virtual bool
- HandleOptionArgumentCompletion (CommandInterpreter &interpeter,
- Args &input,
+ HandleOptionArgumentCompletion (Args &input,
int cursor_index,
int char_pos,
OptionElementVector &opt_element_vector,
@@ -521,7 +521,7 @@ public:
const char *partial_name = NULL;
partial_name = input.GetArgumentAtIndex(opt_arg_pos);
- PlatformSP platform_sp (interpeter.GetDebugger().GetPlatformList().GetSelectedPlatform ());
+ PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform ());
if (platform_sp)
{
ProcessInfoList process_infos;
@@ -563,7 +563,8 @@ public:
CommandObject (interpreter,
"process attach",
"Attach to a process.",
- "process attach <cmd-options>")
+ "process attach <cmd-options>"),
+ m_options (interpreter)
{
}
@@ -983,8 +984,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
// Keep default values of all options in one place: ResetOptionValues ()
ResetOptionValues ();
@@ -1035,11 +1036,12 @@ public:
};
CommandObjectProcessConnect (CommandInterpreter &interpreter) :
- CommandObject (interpreter,
- "process connect",
- "Connect to a remote debug service.",
- "process connect <remote-url>",
- 0)
+ CommandObject (interpreter,
+ "process connect",
+ "Connect to a remote debug service.",
+ "process connect <remote-url>",
+ 0),
+ m_options (interpreter)
{
}
@@ -1568,8 +1570,8 @@ public:
{
public:
- CommandOptions () :
- Options ()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter)
{
ResetOptionValues ();
}
@@ -1632,7 +1634,8 @@ public:
CommandObject (interpreter,
"process handle",
"Show or update what the process and debugger should do with various signals received from the OS.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
SetHelpLong ("If no signals are specified, update them all. If no update option is specified, list the current values.\n");
CommandArgumentEntry arg;
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index 55a4782c822..d50d7d71ecf 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -19,6 +19,7 @@
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/Options.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/RegisterContext.h"
@@ -37,7 +38,8 @@ public:
"Dump the contents of one or more register values from the current frame. If no register is specified, dumps them all.",
//"register read [<reg-name1> [<reg-name2> [...]]]",
NULL,
- eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
+ eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData register_arg;
@@ -154,8 +156,8 @@ protected:
class CommandOptions : public Options
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
ResetOptionValues();
}
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp
index 82a49299cbe..b5cf3260b54 100644
--- a/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/lldb/source/Commands/CommandObjectSettings.cpp
@@ -66,7 +66,7 @@ CommandObjectSettingsSet::CommandObjectSettingsSet (CommandInterpreter &interpre
"settings set",
"Set or change the value of a single debugger setting variable.",
NULL),
- m_options ()
+ m_options (interpreter)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -237,8 +237,8 @@ CommandObjectSettingsSet::HandleArgumentCompletion (Args &input,
// CommandObjectSettingsSet::CommandOptions
//-------------------------------------------------------------------------
-CommandObjectSettingsSet::CommandOptions::CommandOptions () :
- Options (),
+CommandObjectSettingsSet::CommandOptions::CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter),
m_override (true),
m_reset (false)
{
diff --git a/lldb/source/Commands/CommandObjectSettings.h b/lldb/source/Commands/CommandObjectSettings.h
index 7d78c08f65d..170b7f2fbd6 100644
--- a/lldb/source/Commands/CommandObjectSettings.h
+++ b/lldb/source/Commands/CommandObjectSettings.h
@@ -59,7 +59,7 @@ public:
{
public:
- CommandOptions ();
+ CommandOptions (CommandInterpreter &interpreter);
virtual
~CommandOptions ();
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index 7435b855a93..9fbf6024a39 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -37,8 +37,8 @@ class CommandObjectSourceInfo : public CommandObject
class CommandOptions : public Options
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
}
@@ -98,7 +98,8 @@ public:
CommandObject (interpreter,
"source info",
"Display information about the source lines from the current executable's debug info.",
- "source info [<cmd-options>]")
+ "source info [<cmd-options>]"),
+ m_options (interpreter)
{
}
@@ -148,8 +149,8 @@ class CommandObjectSourceList : public CommandObject
class CommandOptions : public Options
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
}
@@ -227,7 +228,8 @@ public:
CommandObject (interpreter,
"source list",
"Display source code (as specified) based on the current executable's debug info.",
- NULL)
+ NULL),
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 1780f2b4a5c..76866207829 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -489,8 +489,8 @@ public:
class CommandOptions : public Options
{
public:
- CommandOptions () :
- Options(),
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter),
m_line_start(0),
m_line_end (UINT_MAX),
m_func_name_type_mask (eFunctionNameTypeAuto),
@@ -634,7 +634,8 @@ public:
CommandObject (interpreter,
"target stop-hook add ",
"Add a hook to be executed when the target stops.",
- "target stop-hook add")
+ "target stop-hook add"),
+ m_options (interpreter)
{
}
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index d5da8807ae6..abb6f5f1cef 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -249,8 +249,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options(interpreter)
{
// Keep default values of all options in one place: ResetOptionValues ()
ResetOptionValues ();
@@ -325,7 +325,7 @@ public:
"Show the stack for one or more threads. If no threads are specified, show the currently selected thread. Use the thread-index \"all\" to see all threads.",
NULL,
eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
- m_options()
+ m_options(interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData thread_idx_arg;
@@ -487,8 +487,8 @@ public:
{
public:
- CommandOptions () :
- Options()
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter)
{
// Keep default values of all options in one place: ResetOptionValues ()
ResetOptionValues ();
@@ -575,7 +575,7 @@ public:
CommandObject (interpreter, name, help, syntax, flags),
m_step_type (step_type),
m_step_scope (step_scope),
- m_options ()
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData thread_id_arg;
@@ -976,8 +976,8 @@ public:
uint32_t m_thread_idx;
uint32_t m_frame_idx;
- CommandOptions () :
- Options(),
+ CommandOptions (CommandInterpreter &interpreter) :
+ Options (interpreter),
m_thread_idx(LLDB_INVALID_THREAD_ID),
m_frame_idx(LLDB_INVALID_FRAME_ID)
{
@@ -1069,7 +1069,7 @@ public:
"Run the current or specified thread until it reaches a given line number or leaves the current function.",
NULL,
eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
- m_options ()
+ m_options (interpreter)
{
CommandArgumentEntry arg;
CommandArgumentData line_num_arg;
OpenPOWER on IntegriCloud