Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb, opcodes: Add non-enum disassembler options #42

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gdb/disasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,8 @@ set_disassembler_options (const char *prospective_options)
if (memcmp (opt, valid_options->name[i], len) != 0)
continue;
arg = opt + len;
if (valid_options->arg[i]->values == NULL)
break;
for (j = 0; valid_options->arg[i]->values[j] != NULL; j++)
if (disassembler_options_cmp
(arg, valid_options->arg[i]->values[j]) == 0)
Expand Down Expand Up @@ -1391,6 +1393,8 @@ The following disassembler options are supported for use with the\n\

for (i = 0; valid_args[i].name != NULL; i++)
{
if (valid_args[i].values == NULL)
continue;
gdb_printf (file, _("\n\
For the options above, the following values are supported for \"%s\":\n "),
valid_args[i].name);
Expand Down
3 changes: 2 additions & 1 deletion include/dis-asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ typedef struct
/* Option argument name to use in descriptions. */
const char *name;

/* Vector of acceptable option argument values, NULL-terminated. */
/* Vector of acceptable option argument values, NULL-terminated.
NULL if any values are accepted. */
const char **values;
} disasm_option_arg_t;

Expand Down
2 changes: 2 additions & 0 deletions opcodes/arc-dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,8 @@ print_arc_disassembler_options (FILE *stream)
for (i = 0; args[i].name != NULL; ++i)
{
size_t len = 3;
if (args[i].values == NULL)
continue;
fprintf (stream, _("\n\
For the options above, the following values are supported for \"%s\":\n "),
args[i].name);
Expand Down
2 changes: 2 additions & 0 deletions opcodes/mips-dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -2809,6 +2809,8 @@ with the -M switch (multiple options should be separated by commas):\n\n"));

for (i = 0; args[i].name != NULL; i++)
{
if (args[i].values == NULL)
continue;
fprintf (stream, _("\n\
For the options above, the following values are supported for \"%s\":\n "),
args[i].name);
Expand Down
2 changes: 2 additions & 0 deletions opcodes/riscv-dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,8 @@ with the -M switch (multiple options should be separated by commas):\n"));

for (i = 0; args[i].name != NULL; i++)
{
if (args[i].values == NULL)
continue;
fprintf (stream, _("\n\
For the options above, the following values are supported for \"%s\":\n "),
args[i].name);
Expand Down