Skip to content

Commit aaa6827

Browse files
committed
[lldb][NFC] Tablegenify source
llvm-svn: 366795
1 parent 1957d68 commit aaa6827

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

lldb/source/Commands/CommandObjectSource.cpp

+4-19
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,8 @@ using namespace lldb_private;
3535
// CommandObjectSourceInfo - debug line entries dumping command
3636

3737
static constexpr OptionDefinition g_source_info_options[] = {
38-
// clang-format off
39-
{ LLDB_OPT_SET_ALL, false, "count", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeCount, "The number of line entries to display." },
40-
{ LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "shlib", 's', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eModuleCompletion, eArgTypeShlibName, "Look up the source in the given module or shared library (can be specified more than once)." },
41-
{ LLDB_OPT_SET_1, false, "file", 'f', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eSourceFileCompletion, eArgTypeFilename, "The file from which to display source." },
42-
{ LLDB_OPT_SET_1, false, "line", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLineNum, "The line number at which to start the displaying lines." },
43-
{ LLDB_OPT_SET_1, false, "end-line", 'e', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLineNum, "The line number at which to stop displaying lines." },
44-
{ LLDB_OPT_SET_2, false, "name", 'n', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eSymbolCompletion, eArgTypeSymbol, "The name of a function whose source to display." },
45-
{ LLDB_OPT_SET_3, false, "address", 'a', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeAddressOrExpression, "Lookup the address and display the source information for the corresponding file and line." },
46-
// clang-format on
38+
#define LLDB_OPTIONS_source_info
39+
#include "CommandOptions.inc"
4740
};
4841

4942
class CommandObjectSourceInfo : public CommandObjectParsed {
@@ -645,16 +638,8 @@ class CommandObjectSourceInfo : public CommandObjectParsed {
645638
// CommandObjectSourceList
646639

647640
static constexpr OptionDefinition g_source_list_options[] = {
648-
// clang-format off
649-
{ LLDB_OPT_SET_ALL, false, "count", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeCount, "The number of source lines to display." },
650-
{ LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "shlib", 's', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eModuleCompletion, eArgTypeShlibName, "Look up the source file in the given shared library." },
651-
{ LLDB_OPT_SET_ALL, false, "show-breakpoints", 'b', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Show the line table locations from the debug information that indicate valid places to set source level breakpoints." },
652-
{ LLDB_OPT_SET_1, false, "file", 'f', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eSourceFileCompletion, eArgTypeFilename, "The file from which to display source." },
653-
{ LLDB_OPT_SET_1, false, "line", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLineNum, "The line number at which to start the display source." },
654-
{ LLDB_OPT_SET_2, false, "name", 'n', OptionParser::eRequiredArgument, nullptr, {}, CommandCompletions::eSymbolCompletion, eArgTypeSymbol, "The name of a function whose source to display." },
655-
{ LLDB_OPT_SET_3, false, "address", 'a', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeAddressOrExpression, "Lookup the address and display the source information for the corresponding file and line." },
656-
{ LLDB_OPT_SET_4, false, "reverse", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Reverse the listing to look backwards from the last displayed block of source." },
657-
// clang-format on
641+
#define LLDB_OPTIONS_source_list
642+
#include "CommandOptions.inc"
658643
};
659644

660645
class CommandObjectSourceList : public CommandObjectParsed {

lldb/source/Commands/Options.td

+42
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,48 @@ let Command = "script add" in {
390390
Desc<"Set the synchronicity of this command's executions with regard to "
391391
"LLDB event system.">;
392392
}
393+
let Command = "source info" in {
394+
def source_info_count : Option<"count", "c">, Arg<"Count">,
395+
Desc<"The number of line entries to display.">;
396+
def source_info_shlib : Option<"shlib", "s">, Groups<[1,2]>, Arg<"ShlibName">,
397+
Completion<"Module">, Desc<"Look up the source in the given module or "
398+
"shared library (can be specified more than once).">;
399+
def source_info_file : Option<"file", "f">, Group<1>, Arg<"Filename">,
400+
Completion<"SourceFile">, Desc<"The file from which to display source.">;
401+
def source_info_line : Option<"line", "l">, Group<1>, Arg<"LineNum">,
402+
Desc<"The line number at which to start the displaying lines.">;
403+
def source_info_end_line : Option<"end-line", "e">, Group<1>, Arg<"LineNum">,
404+
Desc<"The line number at which to stop displaying lines.">;
405+
def source_info_name : Option<"name", "n">, Group<2>, Arg<"Symbol">,
406+
Completion<"Symbol">,
407+
Desc<"The name of a function whose source to display.">;
408+
def source_info_address : Option<"address", "a">, Group<3>,
409+
Arg<"AddressOrExpression">, Desc<"Lookup the address and display the source"
410+
" information for the corresponding file and line.">;
411+
}
412+
413+
let Command = "source list" in {
414+
def source_list_count : Option<"count", "c">, Arg<"Count">,
415+
Desc<"The number of source lines to display.">;
416+
def source_list_shlib : Option<"shlib", "s">, Groups<[1,2]>, Arg<"ShlibName">,
417+
Completion<"Module">,
418+
Desc<"Look up the source file in the given shared library.">;
419+
def source_list_show_breakpoints : Option<"show-breakpoints", "b">,
420+
Desc<"Show the line table locations from the debug information that "
421+
"indicate valid places to set source level breakpoints.">;
422+
def source_list_file : Option<"file", "f">, Group<1>, Arg<"Filename">,
423+
Completion<"SourceFile">, Desc<"The file from which to display source.">;
424+
def source_list_line : Option<"line", "l">, Group<1>, Arg<"LineNum">,
425+
Desc<"The line number at which to start the display source.">;
426+
def source_list_name : Option<"name", "n">, Group<2>, Arg<"Symbol">,
427+
Completion<"Symbol">,
428+
Desc<"The name of a function whose source to display.">;
429+
def source_list_address : Option<"address", "a">, Group<3>,
430+
Arg<"AddressOrExpression">, Desc<"Lookup the address and display the source"
431+
" information for the corresponding file and line.">;
432+
def source_list_reverse : Option<"reverse", "r">, Group<4>, Desc<"Reverse the"
433+
" listing to look backwards from the last displayed block of source.">;
434+
}
393435

394436
let Command = "target dependents" in {
395437
def dependents_no_dependents : Option<"no-dependents", "d">, Group<1>,

0 commit comments

Comments
 (0)