From 7ced9fff95473c1794b51a3cfd099b4fea3d1a58 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 13 Jul 2022 20:11:37 -0700 Subject: [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 --- lldb/source/Commands/CommandObjectLog.cpp | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'lldb/source/Commands/CommandObjectLog.cpp') diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index 684cb35..89bc3e0 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -9,6 +9,7 @@ #include "CommandObjectLog.h" #include "lldb/Core/Debugger.h" #include "lldb/Host/OptionParser.h" +#include "lldb/Interpreter/CommandOptionArgumentTable.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionValueEnumeration.h" @@ -23,36 +24,6 @@ using namespace lldb; using namespace lldb_private; -static constexpr OptionEnumValueElement g_log_handler_type[] = { - { - eLogHandlerDefault, - "default", - "Use the default (stream) log handler", - }, - { - eLogHandlerStream, - "stream", - "Write log messages to the debugger output stream or to a file if one " - "is specified. A buffer size (in bytes) can be specified with -b. If " - "no buffer size is specified the output is unbuffered.", - }, - { - eLogHandlerCircular, - "circular", - "Write log messages to a fixed size circular buffer. A buffer size " - "(number of messages) must be specified with -b.", - }, - { - eLogHandlerSystem, - "os", - "Write log messages to the operating system log.", - }, -}; - -static constexpr OptionEnumValues LogHandlerType() { - return OptionEnumValues(g_log_handler_type); -} - #define LLDB_OPTIONS_log_enable #include "CommandOptions.inc" -- cgit v1.1