[Lldb-commits] [PATCH] Close terminal after LaunchInTerminalTestCase test

jingham at apple.com jingham at apple.com
Fri Feb 6 11:57:05 PST 2015

It's actually a bit of work.  

Right now, all the default values are set in the OptionParsingStarting method of the Options subclass in the CommandObject subclass that implements the command.  So the only entity that knows the default value of an option is the state of the associated ivar in the Option object right after OptionParsingStarting.  And the relation between option flag and the variable that stores the flag value in the Options (and thus has the default value) is some arbitrary choice made by the Option class. There isn't even a general way to ask: "what ivar stores the option value for command option 'a'?" since it's up to Options::SetOptionValue to stuff values in ivars, and only the parse function knows which ivar went with which option flag.

You'd have to come up with some way to encode default values in the options tables, and then change over OptionParsingStarting to read the default values from the tables.  You'd also have to deal with the OptionGroups which do things differently.  I think once you started into a task like this, you'd end up rewriting a substantial portion of the option parsing machinery.  That in itself would not be a bad thing, there are some crusty aspects of the command parser in general that we should revise at some point.  But it ain't a Friday afternoon hack.


> On Feb 6, 2015, at 11:42 AM, Zachary Turner <zturner at google.com> wrote:
> This sounds like an easy patch.  Is it subtly more complicated than it
> sounds?  If it's actually easy as it sounds, I'll just do it.
> http://reviews.llvm.org/D7468
>  http://reviews.llvm.org/settings/panel/emailpreferences/

More information about the lldb-commits mailing list