[Lldb-commits] [PATCH] D129703: [lldb] Refactor command option enum values (NFC)
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 14 14:04:50 PDT 2022
clayborg added inline comments.
================
Comment at: lldb/source/Commands/CommandObjectBreakpointCommand.cpp:25-54
-// FIXME: "script-type" needs to have its contents determined dynamically, so
-// somebody can add a new scripting language to lldb and have it pickable here
-// without having to change this enumeration by hand and rebuild lldb proper.
-static constexpr OptionEnumValueElement g_script_option_enumeration[] = {
- {
- eScriptLanguageNone,
- "command",
----------------
instead of moving all of these global enum declarations into CommandOptionArgumentTable.h, can we register the enum type in a static Initalize method? Maybe leave this code here and then add a function that would register a given enum type with the command interpreter so they can be displayed?
```
static void CommandObjectBreakpointCommandAdd::Initialize() {
CommandInterpreter::RegisterEnumerationOption(g_script_option_enumeration, "<script-language>");
}
```
Then we can leave these definitions where they live, but register then so they can be seen in the help?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129703/new/
https://reviews.llvm.org/D129703
More information about the lldb-commits
mailing list