aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2022-07-13 20:11:37 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2022-07-14 21:18:07 -0700
commit7ced9fff95473c1794b51a3cfd099b4fea3d1a58 (patch)
tree327c5419e195d917e3a127edc8f5d0c725455fd3 /lldb/source/Commands/CommandObjectTarget.cpp
parent888673b6e3bf0182fb5f154eb3231c9ae022acca (diff)
downloadllvm-7ced9fff95473c1794b51a3cfd099b4fea3d1a58.zip
llvm-7ced9fff95473c1794b51a3cfd099b4fea3d1a58.tar.gz
llvm-7ced9fff95473c1794b51a3cfd099b4fea3d1a58.tar.bz2
[lldb] Refactor command option enum values (NFC)
Refactor the command option enum values and the command argument table to connect the two. This has two benefits: - We guarantee that two options that use the same argument type have the same accepted values. - We can print the enum values and their description in the help output. (D129707) Differential revision: https://reviews.llvm.org/D129703
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp41
1 files changed, 1 insertions, 40 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 5197887..fdb5762 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -17,6 +17,7 @@
#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandOptionArgumentTable.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupArchitecture.h"
@@ -142,26 +143,6 @@ static uint32_t DumpTargetList(TargetList &target_list,
return num_targets;
}
-// Note that the negation in the argument name causes a slightly confusing
-// mapping of the enum values.
-static constexpr OptionEnumValueElement g_dependents_enumeration[] = {
- {
- eLoadDependentsDefault,
- "default",
- "Only load dependents when the target is an executable.",
- },
- {
- eLoadDependentsNo,
- "true",
- "Don't load dependents, even if the target is an executable.",
- },
- {
- eLoadDependentsYes,
- "false",
- "Load dependents, even if the target is not an executable.",
- },
-};
-
#define LLDB_OPTIONS_target_dependents
#include "CommandOptions.inc"
@@ -1923,26 +1904,6 @@ protected:
}
};
-#pragma mark CommandObjectTargetModulesDumpSymtab
-
-static constexpr OptionEnumValueElement g_sort_option_enumeration[] = {
- {
- eSortOrderNone,
- "none",
- "No sorting, use the original symbol table order.",
- },
- {
- eSortOrderByAddress,
- "address",
- "Sort output by symbol address.",
- },
- {
- eSortOrderByName,
- "name",
- "Sort output by symbol name.",
- },
-};
-
#define LLDB_OPTIONS_target_modules_dump_symtab
#include "CommandOptions.inc"