[Lldb-commits] [PATCH] Adds the ability for Command options to be validated at runtime.

jingham at apple.com jingham at apple.com
Thu Jul 3 10:45:14 PDT 2014


I wonder a little about the the OptionGroups here.  Those options don't know a-priori what command they are attached to.  It seems not unreasonable to say that if an element of an option group is invalid for one platform for command A, it will also be invalid for all other commands?  But we should think about whether this is really true.  Otherwise, we just need it to be easy for a command to insert its own validator as it adds options from the options group (which shouldn't be hard.)

Jim


> On Jul 3, 2014, at 12:33 AM, Zachary Turner <zturner at google.com> wrote:
> 
> This patch adds the notion of an OptionValidator to the OptionDefinition.  The purpose of the OptionValidator is to determine, based on some arbitrary set of conditions, whether or not a command option is valid for a given debugger state.  An example of this might be to selectively disable or enable certain command options that don't apply to a particular platform.
> 
> This patch contains no functional change, and does not actually make use of an OptionValidator for any purpose yet.  It involves alot of code churn, however, so is submitted independently so as not to muddy up the subsequent change which actually begins making use of the validator.
> 
> http://reviews.llvm.org/D4369
> 
> Files:
>  include/lldb/lldb-private-types.h
>  source/Commands/CommandObjectArgs.cpp
>  source/Commands/CommandObjectBreakpoint.cpp
>  source/Commands/CommandObjectBreakpointCommand.cpp
>  source/Commands/CommandObjectCommands.cpp
>  source/Commands/CommandObjectDisassemble.cpp
>  source/Commands/CommandObjectExpression.cpp
>  source/Commands/CommandObjectFrame.cpp
>  source/Commands/CommandObjectHelp.cpp
>  source/Commands/CommandObjectLog.cpp
>  source/Commands/CommandObjectMemory.cpp
>  source/Commands/CommandObjectPlatform.cpp
>  source/Commands/CommandObjectProcess.cpp
>  source/Commands/CommandObjectRegister.cpp
>  source/Commands/CommandObjectSettings.cpp
>  source/Commands/CommandObjectSource.cpp
>  source/Commands/CommandObjectTarget.cpp
>  source/Commands/CommandObjectThread.cpp
>  source/Commands/CommandObjectType.cpp
>  source/Commands/CommandObjectWatchpoint.cpp
>  source/Commands/CommandObjectWatchpointCommand.cpp
>  source/Interpreter/OptionGroupArchitecture.cpp
>  source/Interpreter/OptionGroupFormat.cpp
>  source/Interpreter/OptionGroupOutputFile.cpp
>  source/Interpreter/OptionGroupPlatform.cpp
>  source/Interpreter/OptionGroupUUID.cpp
>  source/Interpreter/OptionGroupValueObjectDisplay.cpp
>  source/Interpreter/OptionGroupVariable.cpp
>  source/Interpreter/OptionGroupWatchpoint.cpp
>  source/Interpreter/Options.cpp
>  source/Target/Platform.cpp
>  source/Target/Process.cpp
> <D4369.11043.patch>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list