<div dir="ltr">:-)<div><br></div><div>That would be great. I think it would be useful to invest in that area. I'll add that to my list.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 11, 2016 at 5:11 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Have you considered writing some unit test for all the option stuff now?</div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 11, 2016 at 5:10 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This sounds very helpful. It also means it should become easier to start unit testing the options framework</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 11, 2016 at 4:59 PM Todd Fiala via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: tfiala<br>
Date: Thu Aug 11 18:51:28 2016<br>
New Revision: 278440<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=278440&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=278440&view=rev</a><br>
Log:<br>
Decoupled Options from CommandInterpreter.<br>
<br>
Options used to store a reference to the CommandInterpreter instance<br>
in the base Options class. This made it impossible to parse options<br>
independent of a CommandInterpreter.<br>
<br>
This change removes the reference from the base class. Instead, it<br>
modifies the options-parsing-related methods to take an<br>
ExecutionContext pointer, which the options may inspect if they need<br>
to do so.<br>
<br>
Closes <a href="https://reviews.llvm.org/D23416" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23416</a><br>
Reviewers: clayborg, jingham<br>
<br>
Modified:<br>
lldb/trunk/include/lldb/<wbr>Interpreter/Args.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupArchitecture.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupBoolean.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFile.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFormat.<wbr>h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupOutputFile.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupPlatform.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupString.<wbr>h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUInt64.<wbr>h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUUID.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupValueObjectDisplay.<wbr>h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupVariable.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupWatchpoint.h<br>
lldb/trunk/include/lldb/<wbr>Interpreter/Options.h<br>
lldb/trunk/include/lldb/<wbr>Target/Platform.h<br>
lldb/trunk/include/lldb/<wbr>Target/Process.h<br>
lldb/trunk/source/Commands/<wbr>CommandObjectArgs.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectArgs.h<br>
lldb/trunk/source/Commands/<wbr>CommandObjectBreakpoint.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectBreakpointCommand<wbr>.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectBugreport.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectCommands.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectDisassemble.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectDisassemble.h<br>
lldb/trunk/source/Commands/<wbr>CommandObjectExpression.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectExpression.h<br>
lldb/trunk/source/Commands/<wbr>CommandObjectFrame.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectHelp.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectHelp.h<br>
lldb/trunk/source/Commands/<wbr>CommandObjectLog.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectMemory.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectPlatform.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectPlugin.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectProcess.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectRegister.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectSettings.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectSource.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectTarget.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectThread.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectType.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectWatchpoint.cpp<br>
lldb/trunk/source/Commands/<wbr>CommandObjectWatchpointCommand<wbr>.cpp<br>
lldb/trunk/source/Expression/<wbr>REPL.cpp<br>
lldb/trunk/source/Interpreter/<wbr>Args.cpp<br>
lldb/trunk/source/Interpreter/<wbr>CommandAlias.cpp<br>
lldb/trunk/source/Interpreter/<wbr>CommandObject.cpp<br>
lldb/trunk/source/Interpreter/<wbr>CommandObjectRegexCommand.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupArchitecture.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupBoolean.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupFile.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupFormat.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupOutputFile.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupPlatform.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupString.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupUInt64.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupUUID.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupValueObjectDisplay.<wbr>cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupVariable.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionGroupWatchpoint.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionValueArch.cpp<br>
lldb/trunk/source/Interpreter/<wbr>OptionValueFileSpec.cpp<br>
lldb/trunk/source/Interpreter/<wbr>Options.cpp<br>
lldb/trunk/source/Plugins/<wbr>LanguageRuntime/ObjC/<wbr>AppleObjCRuntime/<wbr>AppleObjCRuntimeV2.cpp<br>
lldb/trunk/source/Plugins/<wbr>LanguageRuntime/RenderScript/<wbr>RenderScriptRuntime/<wbr>RenderScriptRuntime.cpp<br>
lldb/trunk/source/Plugins/<wbr>Platform/POSIX/PlatformPOSIX.<wbr>cpp<br>
lldb/trunk/source/Plugins/<wbr>Process/MacOSX-Kernel/<wbr>ProcessKDP.cpp<br>
lldb/trunk/source/Plugins/<wbr>Process/gdb-remote/<wbr>ProcessGDBRemote.cpp<br>
lldb/trunk/source/Target/<wbr>Platform.cpp<br>
lldb/trunk/source/Target/<wbr>Process.cpp<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/Args.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/Args.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/Args.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/Args.h Thu Aug 11 18:51:28 2016<br>
@@ -314,10 +314,22 @@ public:<br>
/// get processed start at the second argument. The first argument<br>
/// is assumed to be the command and will not be touched.<br>
///<br>
+ /// param[in] platform_sp<br>
+ /// The platform used for option validation. This is necessary<br>
+ /// because an empty execution_context is not enough to get us<br>
+ /// to a reasonable platform. If the platform isn't given,<br>
+ /// we'll try to get it from the execution context. If we can't<br>
+ /// get it from the execution context, we'll skip validation.<br>
+ ///<br>
+ /// param[in] require_validation<br>
+ /// When true, it will fail option parsing if validation could<br>
+ /// not occur due to not having a platform.<br>
+ ///<br>
/// @see class Options<br>
//---------------------------<wbr>------------------------------<wbr>---------<br>
Error<br>
- ParseOptions (Options &options);<br>
+ ParseOptions (Options &options, ExecutionContext *execution_context,<br>
+ lldb::PlatformSP platform_sp, bool require_validation);<br>
<br>
size_t<br>
FindArgumentIndexForOption (Option *long_options, int long_options_index);<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupArchitecture.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupArchitecture.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupArchitecture.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupArchitecture.h Thu Aug 11 18:51:28 2016<br>
@@ -37,12 +37,12 @@ public:<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
bool<br>
GetArchitecture (Platform *platform, ArchSpec &arch);<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupBoolean.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupBoolean.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupBoolean.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupBoolean.h Thu Aug 11 18:51:28 2016<br>
@@ -51,12 +51,12 @@ namespace lldb_private {<br>
}<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
OptionValueBoolean &<br>
GetOptionValue ()<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFile.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupFile.h?rev=278440&<wbr>r1=278439&r2=278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFile.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFile.h Thu Aug 11 18:51:28 2016<br>
@@ -50,12 +50,12 @@ public:<br>
}<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
OptionValueFileSpec &<br>
GetOptionValue ()<br>
@@ -105,12 +105,12 @@ public:<br>
}<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
OptionValueFileSpecList &<br>
GetOptionValue ()<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFormat.<wbr>h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupFormat.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFormat.<wbr>h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupFormat.<wbr>h Thu Aug 11 18:51:28 2016<br>
@@ -46,12 +46,12 @@ public:<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
lldb::Format<br>
GetFormat () const<br>
@@ -111,7 +111,7 @@ public:<br>
<br>
protected:<br>
bool<br>
- ParserGDBFormatLetter (CommandInterpreter &interpreter,<br>
+ ParserGDBFormatLetter (ExecutionContext *execution_context,<br>
char format_letter,<br>
lldb::Format &format,<br>
uint32_t &byte_size);<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupOutputFile.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupOutputFile.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupOutputFile.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupOutputFile.h Thu Aug 11 18:51:28 2016<br>
@@ -37,12 +37,12 @@ public:<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
const OptionValueFileSpec &<br>
GetFile ()<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupPlatform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupPlatform.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupPlatform.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupPlatform.h Thu Aug 11 18:51:28 2016<br>
@@ -47,12 +47,12 @@ public:<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
lldb::PlatformSP<br>
CreatePlatformWithOptions (CommandInterpreter &interpreter,<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupString.<wbr>h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupString.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupString.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupString.<wbr>h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupString.<wbr>h Thu Aug 11 18:51:28 2016<br>
@@ -49,12 +49,12 @@ namespace lldb_private {<br>
}<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
OptionValueString &<br>
GetOptionValue ()<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUInt64.<wbr>h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupUInt64.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUInt64.<wbr>h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUInt64.<wbr>h Thu Aug 11 18:51:28 2016<br>
@@ -50,12 +50,12 @@ namespace lldb_private {<br>
}<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
OptionValueUInt64 &<br>
GetOptionValue ()<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUUID.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupUUID.h?rev=278440&<wbr>r1=278439&r2=278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUUID.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/OptionGroupUUID.h Thu Aug 11 18:51:28 2016<br>
@@ -37,12 +37,12 @@ public:<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
const OptionValueUUID &<br>
GetOptionValue () const<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupValueObjectDisplay.<wbr>h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupValueObjectDisplay.<wbr>h?rev=278440&r1=278439&r2=<wbr>278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupValueObjectDisplay.<wbr>h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupValueObjectDisplay.<wbr>h Thu Aug 11 18:51:28 2016<br>
@@ -37,12 +37,12 @@ public:<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
bool<br>
AnyOptionWasSet () const<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupVariable.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupVariable.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupVariable.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupVariable.h Thu Aug 11 18:51:28 2016<br>
@@ -37,12 +37,12 @@ namespace lldb_private {<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_arg) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_arg,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
bool include_frame_options:1,<br>
show_args:1, // Frame option only (include_frame_options == true)<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupWatchpoint.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupWatchpoint.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/<wbr>OptionGroupWatchpoint.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupWatchpoint.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/<wbr>OptionGroupWatchpoint.h Thu Aug 11 18:51:28 2016<br>
@@ -39,12 +39,12 @@ namespace lldb_private {<br>
GetDefinitions() override;<br>
<br>
Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_arg) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_arg,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
// Note:<br>
// eWatchRead == LLDB_WATCH_TYPE_READ; and<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/Options.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Options.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/Options.h?<wbr>rev=278440&r1=278439&r2=<wbr>278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/Options.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/Options.h Thu Aug 11 18:51:28 2016<br>
@@ -117,7 +117,7 @@ namespace lldb_private {<br>
class Options<br>
{<br>
public:<br>
- Options (CommandInterpreter &interpreter);<br>
+ Options ();<br>
<br>
virtual<br>
~Options ();<br>
@@ -160,7 +160,8 @@ public:<br>
<br>
void<br>
GenerateOptionUsage (Stream &strm,<br>
- CommandObject *cmd);<br>
+ CommandObject *cmd,<br>
+ uint32_t screen_width);<br>
<br>
bool<br>
SupportsLongOption (const char *long_option);<br>
@@ -180,10 +181,10 @@ public:<br>
// Option::OptionParsingStarting(<wbr>) like they did before. This was error<br>
// prone and subclasses shouldn't have to do it.<br>
void<br>
- NotifyOptionParsingStarting ();<br>
+ NotifyOptionParsingStarting (ExecutionContext *execution_context);<br>
<br>
Error<br>
- NotifyOptionParsingFinished ();<br>
+ NotifyOptionParsingFinished (ExecutionContext *execution_context);<br>
<br>
//---------------------------<wbr>------------------------------<wbr>---------<br>
/// Set the value of an option.<br>
@@ -196,12 +197,17 @@ public:<br>
/// The argument value for the option that the user entered, or<br>
/// nullptr if there is no argument for the current option.<br>
///<br>
+ /// @param[in] execution_context<br>
+ /// The execution context to use for evaluating the option.<br>
+ /// May be nullptr if the option is to be evaluated outside any<br>
+ /// particular context.<br>
///<br>
/// @see Args::ParseOptions (Options&)<br>
/// @see man getopt_long_only<br>
//---------------------------<wbr>------------------------------<wbr>---------<br>
virtual Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) = 0;<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) = 0;<br>
<br>
//---------------------------<wbr>------------------------------<wbr>---------<br>
/// Handles the generic bits of figuring out whether we are in an<br>
@@ -245,6 +251,7 @@ public:<br>
int char_pos,<br>
int match_start_point,<br>
int max_return_elements,<br>
+ CommandInterpreter &interpreter,<br>
bool &word_complete,<br>
lldb_private::StringList &matches);<br>
<br>
@@ -276,6 +283,9 @@ public:<br>
/// See CommandObject::<wbr>HandleCompletions for a description of<br>
/// how these work.<br>
///<br>
+ /// @param[in] interpreter<br>
+ /// The command interpreter in which we're doing completion.<br>
+ ///<br>
/// @param[out] word_complete<br>
/// \btrue if this is a complete option value (a space will<br>
/// be inserted after the completion.) \bfalse otherwise.<br>
@@ -298,21 +308,15 @@ public:<br>
int opt_element_index,<br>
int match_start_point,<br>
int max_return_elements,<br>
+ CommandInterpreter &interpreter,<br>
bool &word_complete,<br>
StringList &matches);<br>
<br>
- CommandInterpreter&<br>
- GetInterpreter()<br>
- {<br>
- return m_interpreter;<br>
- }<br>
-<br>
protected:<br>
// This is a set of options expressed as indexes into the options table for this Option.<br>
typedef std::set<int> OptionSet;<br>
typedef std::vector<OptionSet> OptionSetVector;<br>
<br>
- CommandInterpreter &m_interpreter;<br>
std::vector<Option> m_getopt_table;<br>
OptionSet m_seen_options;<br>
OptionSetVector m_required_options;<br>
@@ -343,10 +347,10 @@ protected:<br>
// option parse. Each subclass must override this function and revert<br>
// all option settings to default values.<br>
virtual void<br>
- OptionParsingStarting () = 0;<br>
+ OptionParsingStarting (ExecutionContext *execution_context) = 0;<br>
<br>
virtual Error<br>
- OptionParsingFinished ()<br>
+ OptionParsingFinished (ExecutionContext *execution_context)<br>
{<br>
// If subclasses need to know when the options are done being parsed<br>
// they can implement this function to do extra checking<br>
@@ -370,15 +374,15 @@ protected:<br>
GetDefinitions () = 0;<br>
<br>
virtual Error<br>
- SetOptionValue (CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) = 0;<br>
+ SetOptionValue (uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) = 0;<br>
<br>
virtual void<br>
- OptionParsingStarting (CommandInterpreter &interpreter) = 0;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) = 0;<br>
<br>
virtual Error<br>
- OptionParsingFinished (CommandInterpreter &interpreter)<br>
+ OptionParsingFinished(<wbr>ExecutionContext *execution_context)<br>
{<br>
// If subclasses need to know when the options are done being parsed<br>
// they can implement this function to do extra checking<br>
@@ -390,8 +394,8 @@ protected:<br>
class OptionGroupOptions : public Options<br>
{<br>
public:<br>
- OptionGroupOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ OptionGroupOptions () :<br>
+ Options (),<br>
m_option_defs (),<br>
m_option_infos (),<br>
m_did_finalize (false)<br>
@@ -451,13 +455,14 @@ protected:<br>
<br>
Error<br>
SetOptionValue(uint32_t option_idx,<br>
- const char *option_arg) override;<br>
+ const char *option_arg,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting() override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
Error<br>
- OptionParsingFinished() override;<br>
+ OptionParsingFinished(<wbr>ExecutionContext *execution_context) override;<br>
<br>
const OptionDefinition*<br>
GetDefinitions() override<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Target/Platform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Target/Platform.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Target/Platform.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Target/Platform.h Thu Aug 11 18:51:28 2016<br>
@@ -1326,12 +1326,12 @@ class ModuleCache;<br>
~OptionGroupPlatformRSync() override = default;<br>
<br>
lldb_private::Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
const lldb_private::<wbr>OptionDefinition*<br>
GetDefinitions() override;<br>
@@ -1362,12 +1362,12 @@ class ModuleCache;<br>
~OptionGroupPlatformSSH() override = default;<br>
<br>
lldb_private::Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
uint32_t<br>
GetNumDefinitions() override;<br>
@@ -1396,12 +1396,12 @@ class ModuleCache;<br>
~OptionGroupPlatformCaching() override = default;<br>
<br>
lldb_private::Error<br>
- SetOptionValue(<wbr>CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override;<br>
+ SetOptionValue(uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting(<wbr>CommandInterpreter &interpreter) override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
uint32_t<br>
GetNumDefinitions() override;<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Target/Process.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Target/Process.h?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Target/Process.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Target/Process.h Thu Aug 11 18:51:28 2016<br>
@@ -421,20 +421,21 @@ protected:<br>
class ProcessLaunchCommandOptions : public Options<br>
{<br>
public:<br>
- ProcessLaunchCommandOptions (CommandInterpreter &interpreter) :<br>
- Options(interpreter)<br>
+ ProcessLaunchCommandOptions () :<br>
+ Options()<br>
{<br>
// Keep default values of all options in one place: OptionParsingStarting ()<br>
- OptionParsingStarting ();<br>
+ OptionParsingStarting (nullptr);<br>
}<br>
<br>
~ProcessLaunchCommandOptions(<wbr>) override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override;<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting() override<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override<br>
{<br>
launch_info.Clear();<br>
disable_aslr = eLazyBoolCalculate;<br>
<br>
Modified: lldb/trunk/source/Commands/<wbr>CommandObjectArgs.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Commands/CommandObjectArgs.<wbr>cpp?rev=278440&r1=278439&r2=<wbr>278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Commands/<wbr>CommandObjectArgs.cpp (original)<br>
+++ lldb/trunk/source/Commands/<wbr>CommandObjectArgs.cpp Thu Aug 11 18:51:28 2016<br>
@@ -37,16 +37,18 @@ using namespace lldb_private;<br>
//<br>
<br>
CommandObjectArgs::<wbr>CommandOptions::CommandOptions (CommandInterpreter &interpreter) :<br>
- Options(interpreter)<br>
+ Options()<br>
{<br>
// Keep only one place to reset the values to their defaults<br>
- OptionParsingStarting();<br>
+ OptionParsingStarting(nullptr)<wbr>;<br>
}<br>
<br>
CommandObjectArgs::<wbr>CommandOptions::~<wbr>CommandOptions() = default;<br>
<br>
Error<br>
-CommandObjectArgs::<wbr>CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)<br>
+CommandObjectArgs::<wbr>CommandOptions::<wbr>SetOptionValue(uint32_t option_idx,<br>
+ const char *option_arg,<br>
+ ExecutionContext *execution_context)<br>
{<br>
Error error;<br>
<br>
@@ -57,7 +59,8 @@ CommandObjectArgs::<wbr>CommandOptions::SetOp<br>
}<br>
<br>
void<br>
-CommandObjectArgs::<wbr>CommandOptions::<wbr>OptionParsingStarting ()<br>
+CommandObjectArgs::<wbr>CommandOptions::<wbr>OptionParsingStarting(<br>
+ ExecutionContext *execution_context)<br>
{<br>
}<br>
<br>
<br>
Modified: lldb/trunk/source/Commands/<wbr>CommandObjectArgs.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.h?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Commands/CommandObjectArgs.h?<wbr>rev=278440&r1=278439&r2=<wbr>278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Commands/<wbr>CommandObjectArgs.h (original)<br>
+++ lldb/trunk/source/Commands/<wbr>CommandObjectArgs.h Thu Aug 11 18:51:28 2016<br>
@@ -32,10 +32,11 @@ namespace lldb_private {<br>
~CommandOptions() override;<br>
<br>
Error<br>
- SetOptionValue(uint32_t option_idx, const char *option_arg) override;<br>
+ SetOptionValue(uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override;<br>
<br>
void<br>
- OptionParsingStarting() override;<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override;<br>
<br>
const OptionDefinition*<br>
GetDefinitions() override;<br>
<br>
Modified: lldb/trunk/source/Commands/<wbr>CommandObjectBreakpoint.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Commands/<wbr>CommandObjectBreakpoint.cpp?<wbr>rev=278440&r1=278439&r2=<wbr>278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Commands/<wbr>CommandObjectBreakpoint.cpp (original)<br>
+++ lldb/trunk/source/Commands/<wbr>CommandObjectBreakpoint.cpp Thu Aug 11 18:51:28 2016<br>
@@ -69,7 +69,7 @@ public:<br>
"breakpoint set",<br>
"Sets a breakpoint or set of breakpoints in the executable.",<br>
"breakpoint set <cmd-options>"),<br>
- m_options (interpreter)<br>
+ m_options ()<br>
{<br>
}<br>
<br>
@@ -84,8 +84,8 @@ public:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions () :<br>
+ Options (),<br>
m_condition (),<br>
m_filenames (),<br>
m_line_num (0),<br>
@@ -116,7 +116,8 @@ public:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -125,8 +126,9 @@ public:<br>
{<br>
case 'a':<br>
{<br>
- ExecutionContext exe_ctx (m_interpreter.<wbr>GetExecutionContext());<br>
- m_load_addr = Args::StringToAddress(&exe_<wbr>ctx, option_arg, LLDB_INVALID_ADDRESS, &error);<br>
+ m_load_addr =<br>
+ Args::StringToAddress(<wbr>execution_context, option_arg,<br>
+ LLDB_INVALID_ADDRESS, &error);<br>
}<br>
break;<br>
<br>
@@ -279,9 +281,10 @@ public:<br>
<br>
case 'R':<br>
{<br>
- ExecutionContext exe_ctx (m_interpreter.<wbr>GetExecutionContext());<br>
lldb::addr_t tmp_offset_addr;<br>
- tmp_offset_addr = Args::StringToAddress(&exe_<wbr>ctx, option_arg, 0, &error);<br>
+ tmp_offset_addr =<br>
+ Args::StringToAddress(<wbr>execution_context, option_arg,<br>
+ 0, &error);<br>
if (error.Success())<br>
m_offset_addr = tmp_offset_addr;<br>
}<br>
@@ -355,7 +358,7 @@ public:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_condition.clear();<br>
m_filenames.Clear();<br>
@@ -892,7 +895,7 @@ public:<br>
"If no breakpoint is specified, acts on the last created breakpoint. "<br>
"With the exception of -e, -d and -i, passing an empty argument clears the modification.",<br>
nullptr),<br>
- m_options (interpreter)<br>
+ m_options ()<br>
{<br>
CommandArgumentEntry arg;<br>
CommandObject::<wbr>AddIDsArgumentData(arg, eArgTypeBreakpointID, eArgTypeBreakpointIDRange);<br>
@@ -911,8 +914,8 @@ public:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions () :<br>
+ Options (),<br>
m_ignore_count (0),<br>
m_thread_id(LLDB_INVALID_<wbr>THREAD_ID),<br>
m_thread_id_passed(false),<br>
@@ -935,7 +938,8 @@ public:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -1031,7 +1035,7 @@ public:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_ignore_count = 0;<br>
m_thread_id = LLDB_INVALID_THREAD_ID;<br>
@@ -1418,7 +1422,7 @@ public:<br>
"breakpoint list",<br>
"List some or all breakpoints at configurable levels of detail.",<br>
nullptr),<br>
- m_options (interpreter)<br>
+ m_options ()<br>
{<br>
CommandArgumentEntry arg;<br>
CommandArgumentData bp_id_arg;<br>
@@ -1445,8 +1449,8 @@ public:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions () :<br>
+ Options (),<br>
m_level (lldb::eDescriptionLevelBrief)<wbr>,<br>
m_use_dummy(false)<br>
{<br>
@@ -1455,7 +1459,8 @@ public:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -1486,7 +1491,7 @@ public:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_level = lldb::eDescriptionLevelFull;<br>
m_internal = false;<br>
@@ -1622,7 +1627,7 @@ public:<br>
: CommandObjectParsed(<wbr>interpreter, "breakpoint clear",<br>
"Delete or disable breakpoints matching the specified source file and line.",<br>
"breakpoint clear <cmd-options>"),<br>
- m_options(interpreter)<br>
+ m_options()<br>
{<br>
}<br>
<br>
@@ -1637,8 +1642,8 @@ public:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions () :<br>
+ Options (),<br>
m_filename (),<br>
m_line_num (0)<br>
{<br>
@@ -1647,7 +1652,8 @@ public:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -1671,7 +1677,7 @@ public:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_filename.clear();<br>
m_line_num = 0;<br>
@@ -1815,7 +1821,7 @@ public:<br>
"breakpoint delete",<br>
"Delete the specified breakpoint(s). If no breakpoints are specified, delete them all.",<br>
nullptr),<br>
- m_options (interpreter)<br>
+ m_options()<br>
{<br>
CommandArgumentEntry arg;<br>
CommandObject::<wbr>AddIDsArgumentData(arg, eArgTypeBreakpointID, eArgTypeBreakpointIDRange);<br>
@@ -1834,8 +1840,8 @@ public:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions () :<br>
+ Options (),<br>
m_use_dummy (false),<br>
m_force (false)<br>
{<br>
@@ -1844,7 +1850,8 @@ public:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -1868,7 +1875,7 @@ public:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_use_dummy = false;<br>
m_force = false;<br>
@@ -2025,9 +2032,9 @@ public:<br>
}<br>
<br>
Error<br>
- SetOptionValue (CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override<br>
+ SetOptionValue (uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = g_breakpoint_name_options[<wbr>option_idx].short_option;<br>
@@ -2056,7 +2063,7 @@ public:<br>
}<br>
<br>
void<br>
- OptionParsingStarting (CommandInterpreter &interpreter) override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_name.Clear();<br>
m_breakpoint.Clear();<br>
@@ -2078,7 +2085,7 @@ public:<br>
"Add a name to the breakpoints provided.",<br>
"breakpoint name add <command-options> <breakpoint-id-list>"),<br>
m_name_options(),<br>
- m_option_group(interpreter)<br>
+ m_option_group()<br>
{<br>
// Create the first variant for the first (and only) argument for this command.<br>
CommandArgumentEntry arg1;<br>
@@ -2171,7 +2178,7 @@ public:<br>
"Delete a name from the breakpoints provided.",<br>
"breakpoint name delete <command-options> <breakpoint-id-list>"),<br>
m_name_options(),<br>
- m_option_group(interpreter)<br>
+ m_option_group()<br>
{<br>
// Create the first variant for the first (and only) argument for this command.<br>
CommandArgumentEntry arg1;<br>
@@ -2263,7 +2270,7 @@ public:<br>
"List either the names for a breakpoint or the breakpoints for a given name.",<br>
"breakpoint name list <command-options>"),<br>
m_name_options(),<br>
- m_option_group(interpreter)<br>
+ m_option_group()<br>
{<br>
m_option_group.Append (&m_name_options);<br>
m_option_group.Finalize();<br>
<br>
Modified: lldb/trunk/source/Commands/<wbr>CommandObjectBreakpointCommand<wbr>.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Commands/<wbr>CommandObjectBreakpointCommand<wbr>.cpp?rev=278440&r1=278439&r2=<wbr>278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Commands/<wbr>CommandObjectBreakpointCommand<wbr>.cpp (original)<br>
+++ lldb/trunk/source/Commands/<wbr>CommandObjectBreakpointCommand<wbr>.cpp Thu Aug 11 18:51:28 2016<br>
@@ -42,7 +42,7 @@ public:<br>
" If no breakpoint is specified, adds the commands to the last created breakpoint.",<br>
nullptr),<br>
IOHandlerDelegateMultiline("<wbr>DONE", IOHandlerDelegate::Completion:<wbr>:LLDBCommand),<br>
- m_options(interpreter)<br>
+ m_options()<br>
{<br>
SetHelpLong (<br>
R"(<br>
@@ -295,8 +295,8 @@ are no syntax errors may indicate that a<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions () :<br>
+ Options (),<br>
m_use_commands (false),<br>
m_use_script_language (false),<br>
m_script_language (eScriptLanguageNone),<br>
@@ -309,7 +309,8 @@ are no syntax errors may indicate that a<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -363,7 +364,7 @@ are no syntax errors may indicate that a<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_use_commands = true;<br>
m_use_script_language = false;<br>
@@ -566,7 +567,7 @@ public:<br>
"delete",<br>
"Delete the set of commands from a breakpoint.",<br>
nullptr),<br>
- m_options (interpreter)<br>
+ m_options()<br>
{<br>
CommandArgumentEntry arg;<br>
CommandArgumentData bp_id_arg;<br>
@@ -593,16 +594,17 @@ public:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
- m_use_dummy (false)<br>
+ CommandOptions() :<br>
+ Options(),<br>
+ m_use_dummy(false)<br>
{<br>
}<br>
<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -622,7 +624,7 @@ public:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_use_dummy = false;<br>
}<br>
<br>
Modified: lldb/trunk/source/Commands/<wbr>CommandObjectBugreport.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBugreport.cpp?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Commands/<wbr>CommandObjectBugreport.cpp?<wbr>rev=278440&r1=278439&r2=<wbr>278440&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Commands/<wbr>CommandObjectBugreport.cpp (original)<br>
+++ lldb/trunk/source/Commands/<wbr>CommandObjectBugreport.cpp Thu Aug 11 18:51:28 2016<br>
@@ -36,7 +36,7 @@ public:<br>
"bugreport unwind",<br>
"Create a bugreport for a bug in the stack unwinding code.",<br>
nullptr),<br>
- m_option_group(interpreter),<br>
+ m_option_group(),<br>
m_outfile_options()<br>
{<br>
m_option_group.Append (&m_outfile_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1 | LLDB_OPT_SET_2 | LLDB_OPT_SET_3);<br>
<br>
Modified: lldb/trunk/source/Commands/<wbr>CommandObjectCommands.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=278440&r1=278439&r2=278440&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Commands/<wbr>CommandObjectCommands.cpp?rev=<wbr>278440&r1=278439&r2=278440&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Commands/<wbr>CommandObjectCommands.cpp (original)<br>
+++ lldb/trunk/source/Commands/<wbr>CommandObjectCommands.cpp Thu Aug 11 18:51:28 2016<br>
@@ -44,7 +44,7 @@ public:<br>
"command history",<br>
"Dump the history of commands in this session.",<br>
nullptr),<br>
- m_options (interpreter)<br>
+ m_options()<br>
{<br>
}<br>
<br>
@@ -60,8 +60,8 @@ protected:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions() :<br>
+ Options(),<br>
m_start_idx(0),<br>
m_stop_idx(0),<br>
m_count(0),<br>
@@ -72,7 +72,8 @@ protected:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -107,7 +108,7 @@ protected:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_start_idx.Clear();<br>
m_stop_idx.Clear();<br>
@@ -238,7 +239,7 @@ public:<br>
CommandObjectCommandsSource(<wbr>CommandInterpreter &interpreter)<br>
: CommandObjectParsed(<wbr>interpreter, "command source", "Read and execute LLDB commands from the file <filename>.",<br>
nullptr),<br>
- m_options(interpreter)<br>
+ m_options()<br>
{<br>
CommandArgumentEntry arg;<br>
CommandArgumentData file_arg;<br>
@@ -274,8 +275,8 @@ public:<br>
{<br>
std::string completion_str (input.GetArgumentAtIndex(<wbr>cursor_index));<br>
completion_str.erase (cursor_char_position);<br>
-<br>
- CommandCompletions::<wbr>InvokeCommonCompletionCallback<wbr>s(m_interpreter,<br>
+<br>
+ CommandCompletions::<wbr>InvokeCommonCompletionCallback<wbr>s(GetCommandInterpreter(),<br>
CommandCompletions::<wbr>eDiskFileCompletion,<br>
completion_str.c_str(),<br>
match_start_point,<br>
@@ -296,8 +297,8 @@ protected:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions() :<br>
+ Options(),<br>
m_stop_on_error (true),<br>
m_silent_run (false),<br>
m_stop_on_continue (true)<br>
@@ -307,7 +308,8 @@ protected:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -335,7 +337,7 @@ protected:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_stop_on_error.Clear();<br>
m_silent_run.Clear();<br>
@@ -454,9 +456,9 @@ protected:<br>
}<br>
<br>
Error<br>
- SetOptionValue (CommandInterpreter &interpreter,<br>
- uint32_t option_idx,<br>
- const char *option_value) override<br>
+ SetOptionValue (uint32_t option_idx,<br>
+ const char *option_value,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
<br>
@@ -483,7 +485,7 @@ protected:<br>
}<br>
<br>
void<br>
- OptionParsingStarting (CommandInterpreter &interpreter) override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_help.Clear();<br>
m_long_help.Clear();<br>
@@ -509,7 +511,7 @@ public:<br>
CommandObjectCommandsAlias(<wbr>CommandInterpreter &interpreter)<br>
: CommandObjectRaw(interpreter, "command alias", "Define a custom command in terms of an existing command.",<br>
nullptr),<br>
- m_option_group(interpreter),<br>
+ m_option_group(),<br>
m_command_options()<br>
{<br>
m_option_group.Append(&m_<wbr>command_options);<br>
@@ -630,8 +632,9 @@ protected:<br>
result.AppendError ("'command alias' requires at least two arguments");<br>
return false;<br>
}<br>
-<br>
- m_option_group.<wbr>NotifyOptionParsingStarting();<br>
+<br>
+ ExecutionContext exe_ctx = GetCommandInterpreter().<wbr>GetExecutionContext();<br>
+ m_option_group.<wbr>NotifyOptionParsingStarting(&<wbr>exe_ctx);<br>
<br>
const char * remainder = nullptr;<br>
<br>
@@ -663,7 +666,7 @@ protected:<br>
if (!ParseOptions (args, result))<br>
return false;<br>
<br>
- Error error (m_option_group.<wbr>NotifyOptionParsingFinished())<wbr>;<br>
+ Error error (m_option_group.<wbr>NotifyOptionParsingFinished(&<wbr>exe_ctx));<br>
if (error.Fail())<br>
{<br>
result.AppendError (error.AsCString());<br>
@@ -1092,7 +1095,7 @@ public:<br>
"Define a custom command in terms of existing commands by matching regular expressions.",<br>
"command regex <cmd-name> [s/<regex>/<subst>/ ...]"),<br>
IOHandlerDelegateMultiline(""<wbr>, IOHandlerDelegate::Completion:<wbr>:LLDBCommand),<br>
- m_options(interpreter)<br>
+ m_options()<br>
{<br>
SetHelpLong(R"(<br>
)" "This command allows the user to create powerful regular expression commands \<br>
@@ -1359,15 +1362,16 @@ private:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter)<br>
+ CommandOptions() :<br>
+ Options()<br>
{<br>
}<br>
<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -1389,7 +1393,7 @@ private:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting (ExecutionContext *execution_context) override<br>
{<br>
m_help.clear();<br>
m_syntax.clear();<br>
@@ -1676,7 +1680,7 @@ public:<br>
"command script import",<br>
"Import a scripting module in LLDB.",<br>
nullptr),<br>
- m_options(interpreter)<br>
+ m_options()<br>
{<br>
CommandArgumentEntry arg1;<br>
CommandArgumentData cmd_arg;<br>
@@ -1706,8 +1710,8 @@ public:<br>
{<br>
std::string completion_str (input.GetArgumentAtIndex(<wbr>cursor_index));<br>
completion_str.erase (cursor_char_position);<br>
-<br>
- CommandCompletions::<wbr>InvokeCommonCompletionCallback<wbr>s(m_interpreter,<br>
+<br>
+ CommandCompletions::<wbr>InvokeCommonCompletionCallback<wbr>s(GetCommandInterpreter(),<br>
CommandCompletions::<wbr>eDiskFileCompletion,<br>
completion_str.c_str(),<br>
match_start_point,<br>
@@ -1728,15 +1732,16 @@ protected:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter)<br>
+ CommandOptions() :<br>
+ Options()<br>
{<br>
}<br>
<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- SetOptionValue (uint32_t option_idx, const char *option_arg) override<br>
+ SetOptionValue (uint32_t option_idx, const char *option_arg,<br>
+ ExecutionContext *execution_context) override<br>
{<br>
Error error;<br>
const int short_option = m_getopt_table[option_idx].<wbr>val;<br>
@@ -1755,7 +1760,7 @@ protected:<br>
}<br>
<br>
void<br>
- OptionParsingStarting () override<br>
+ OptionParsingStarting(<wbr>ExecutionContext *execution_context) override<br>
{<br>
m_allow_reload = true;<br>
}<br>
@@ -1850,7 +1855,7 @@ public:<br>
"Add a scripted function as an LLDB command.",<br>
nullptr),<br>
IOHandlerDelegateMultiline ("DONE"),<br>
- m_options (interpreter)<br>
+ m_options()<br>
{<br>
CommandArgumentEntry arg1;<br>
CommandArgumentData cmd_arg;<br>
@@ -1878,8 +1883,8 @@ protected:<br>
class CommandOptions : public Options<br>
{<br>
public:<br>
- CommandOptions (CommandInterpreter &interpreter) :<br>
- Options (interpreter),<br>
+ CommandOptions() :<br>
+ Options(),<br>
m_class_name(),<br>
m_funct_name(),<br>
m_short_help(),<br>
@@ -1890,7 +1895,8 @@ protected:<br>
~CommandOptions() override = default;<br>
<br>
Error<br>
- </blockquote></div></blockquote></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-Todd</div></div>
</div>