llvm-project/lldb/source/Commands
Raphael Isemann 6f4fb4e7ad [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 15:30:55 +00:00
..
CMakeLists.txt [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00
CommandCompletions.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectApropos.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectApropos.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectBreakpoint.cpp [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00
CommandObjectBreakpoint.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectBreakpointCommand.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectBreakpointCommand.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectBugreport.cpp Propagate command interpreter errors from lldlbinit 2019-05-08 01:23:47 +00:00
CommandObjectBugreport.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectCommands.cpp Propagate command interpreter errors from lldlbinit 2019-05-08 01:23:47 +00:00
CommandObjectCommands.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectDisassemble.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectDisassemble.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectExpression.cpp [Commands] Remove unused header 2019-06-02 21:11:21 +00:00
CommandObjectExpression.h [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
CommandObjectFrame.cpp [ScriptInterpreter] Move ownership into debugger (NFC) 2019-04-26 22:43:16 +00:00
CommandObjectFrame.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectGUI.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectGUI.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectHelp.cpp [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00
CommandObjectHelp.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectLanguage.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectLanguage.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectLog.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectLog.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectMemory.cpp [Expression] Add PersistentExpressionState::GetCompilerTypeFromPersistentDecl 2019-06-12 17:47:06 +00:00
CommandObjectMemory.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectMultiword.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectPlatform.cpp Fix integer literals which are cast to bool 2019-05-24 00:44:33 +00:00
CommandObjectPlatform.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectPlugin.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectPlugin.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectProcess.cpp Merge target and launch info environments 2019-05-13 19:17:48 +00:00
CommandObjectProcess.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectQuit.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectQuit.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectRegister.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectRegister.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectReproducer.cpp [Reproducers] Improve reproducer help 2019-05-03 00:10:31 +00:00
CommandObjectReproducer.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectSettings.cpp [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00
CommandObjectSettings.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectSource.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectSource.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectStats.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectStats.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectTarget.cpp [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00
CommandObjectTarget.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectThread.cpp Fix integer literals which are cast to bool 2019-05-24 00:44:33 +00:00
CommandObjectThread.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectType.cpp [Commands] Stop hardcoding languages in CommandObjectType 2019-05-31 22:15:29 +00:00
CommandObjectType.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommandObjectVersion.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectVersion.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectWatchpoint.cpp [CommandObject] Use GetDebugger() helper method (NFC) 2019-04-27 06:19:42 +00:00
CommandObjectWatchpoint.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
CommandObjectWatchpointCommand.cpp Propagate command interpreter errors from lldlbinit 2019-05-08 01:23:47 +00:00
CommandObjectWatchpointCommand.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
Options.td [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00
OptionsBase.td [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00