2019-07-16 17:27:02 +08:00
|
|
|
lldb_tablegen(CommandOptions.inc -gen-lldb-option-defs
|
[lldb] Let table gen create command option initializers.
Summary:
We currently have man large arrays containing initializers for our command options.
These tables are tricky maintain as we don't have any good place to check them for consistency and
it's also hard to read (`nullptr, {}, 0` is not very descriptive).
This patch fixes this by letting table gen generate those tables. This way we can have a more readable
syntax for this (especially for all the default arguments) and we can let TableCheck check them
for consistency (e.g. an option with an optional argument can't have `eArgTypeNone`, naming of flags', etc.).
Also refactoring the related data structures can now be done without changing the hundred of option initializers.
For example, this line:
```
{LLDB_OPT_SET_ALL, false, "hide-aliases", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the command list."},
```
becomes this:
```
def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the command list.">;
```
For now I just moved a few initializers to the new format to demonstrate the change. I'll slowly migrate the other
option initializers tables in separate patches.
Reviewers: JDevlieghere, davide, sgraenitz
Reviewed By: JDevlieghere
Subscribers: jingham, xiaobai, labath, mgorny, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64365
llvm-svn: 365908
2019-07-12 23:30:55 +08:00
|
|
|
SOURCE Options.td
|
|
|
|
TARGET LLDBOptionsGen)
|
|
|
|
|
2013-09-25 18:37:32 +08:00
|
|
|
add_lldb_library(lldbCommands
|
|
|
|
CommandCompletions.cpp
|
|
|
|
CommandObjectApropos.cpp
|
|
|
|
CommandObjectBreakpoint.cpp
|
|
|
|
CommandObjectBreakpointCommand.cpp
|
|
|
|
CommandObjectCommands.cpp
|
|
|
|
CommandObjectDisassemble.cpp
|
|
|
|
CommandObjectExpression.cpp
|
|
|
|
CommandObjectFrame.cpp
|
2014-01-28 07:43:24 +08:00
|
|
|
CommandObjectGUI.cpp
|
2013-09-25 18:37:32 +08:00
|
|
|
CommandObjectHelp.cpp
|
2020-07-21 22:29:16 +08:00
|
|
|
CommandObjectLanguage.cpp
|
2013-09-25 18:37:32 +08:00
|
|
|
CommandObjectLog.cpp
|
|
|
|
CommandObjectMemory.cpp
|
2021-02-20 00:31:46 +08:00
|
|
|
CommandObjectMemoryTag.cpp
|
2013-09-25 18:37:32 +08:00
|
|
|
CommandObjectMultiword.cpp
|
|
|
|
CommandObjectPlatform.cpp
|
|
|
|
CommandObjectPlugin.cpp
|
|
|
|
CommandObjectProcess.cpp
|
|
|
|
CommandObjectQuit.cpp
|
2020-09-02 08:28:29 +08:00
|
|
|
CommandObjectRegexCommand.cpp
|
2013-09-25 18:37:32 +08:00
|
|
|
CommandObjectRegister.cpp
|
2018-11-14 03:18:16 +08:00
|
|
|
CommandObjectReproducer.cpp
|
2020-09-02 08:28:29 +08:00
|
|
|
CommandObjectScript.cpp
|
2020-07-21 22:29:16 +08:00
|
|
|
CommandObjectSession.cpp
|
2013-09-25 18:37:32 +08:00
|
|
|
CommandObjectSettings.cpp
|
|
|
|
CommandObjectSource.cpp
|
2018-03-24 05:55:48 +08:00
|
|
|
CommandObjectStats.cpp
|
2013-09-25 18:37:32 +08:00
|
|
|
CommandObjectTarget.cpp
|
|
|
|
CommandObjectThread.cpp
|
2020-10-27 12:22:06 +08:00
|
|
|
CommandObjectThreadUtil.cpp
|
2020-08-18 08:21:52 +08:00
|
|
|
CommandObjectTrace.cpp
|
2013-09-25 18:37:32 +08:00
|
|
|
CommandObjectType.cpp
|
|
|
|
CommandObjectVersion.cpp
|
|
|
|
CommandObjectWatchpoint.cpp
|
|
|
|
CommandObjectWatchpointCommand.cpp
|
2021-01-21 01:33:00 +08:00
|
|
|
CommandOptionsProcessLaunch.cpp
|
2017-02-01 04:43:05 +08:00
|
|
|
|
|
|
|
LINK_LIBS
|
|
|
|
lldbBreakpoint
|
|
|
|
lldbCore
|
|
|
|
lldbDataFormatters
|
|
|
|
lldbExpression
|
|
|
|
lldbHost
|
|
|
|
lldbInterpreter
|
|
|
|
lldbSymbol
|
|
|
|
lldbTarget
|
|
|
|
lldbUtility
|
2021-12-09 04:23:57 +08:00
|
|
|
lldbVersion
|
2017-02-01 04:43:05 +08:00
|
|
|
|
|
|
|
LINK_COMPONENTS
|
|
|
|
Support
|
2013-09-25 18:37:32 +08:00
|
|
|
)
|
[lldb] Let table gen create command option initializers.
Summary:
We currently have man large arrays containing initializers for our command options.
These tables are tricky maintain as we don't have any good place to check them for consistency and
it's also hard to read (`nullptr, {}, 0` is not very descriptive).
This patch fixes this by letting table gen generate those tables. This way we can have a more readable
syntax for this (especially for all the default arguments) and we can let TableCheck check them
for consistency (e.g. an option with an optional argument can't have `eArgTypeNone`, naming of flags', etc.).
Also refactoring the related data structures can now be done without changing the hundred of option initializers.
For example, this line:
```
{LLDB_OPT_SET_ALL, false, "hide-aliases", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the command list."},
```
becomes this:
```
def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the command list.">;
```
For now I just moved a few initializers to the new format to demonstrate the change. I'll slowly migrate the other
option initializers tables in separate patches.
Reviewers: JDevlieghere, davide, sgraenitz
Reviewed By: JDevlieghere
Subscribers: jingham, xiaobai, labath, mgorny, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64365
llvm-svn: 365908
2019-07-12 23:30:55 +08:00
|
|
|
|
|
|
|
add_dependencies(lldbCommands LLDBOptionsGen)
|