diff options
Diffstat (limited to 'gdb/disasm.c')
-rw-r--r-- | gdb/disasm.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gdb/disasm.c b/gdb/disasm.c index 2a7a80c..73b094b 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -28,7 +28,6 @@ #include "cli/cli-cmds.h" #include "dis-asm.h" #include "source.h" -#include "gdbsupport/gdb-safe-ctype.h" #include <algorithm> #include <optional> #include "valprint.h" @@ -1270,7 +1269,6 @@ set_disassembler_options (const char *prospective_options) = make_unique_xstrdup (prospective_options); char *options = remove_whitespace_and_extra_commas (prospective_options_local.get ()); - const char *opt; /* Allow all architectures, even ones that do not support 'set disassembler', to reset their disassembler options to NULL. */ @@ -1292,9 +1290,13 @@ set_disassembler_options (const char *prospective_options) valid_options = &valid_options_and_args->options; /* Verify we have valid disassembler options. */ - FOR_EACH_DISASSEMBLER_OPTION (opt, options) + char *opt = options; + while (1) { size_t i; + char *opt_end = strchr (opt, ','); + if (opt_end) + *opt_end = 0; for (i = 0; valid_options->name[i] != NULL; i++) if (valid_options->arg != NULL && valid_options->arg[i] != NULL) { @@ -1309,8 +1311,7 @@ set_disassembler_options (const char *prospective_options) 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) + if (strcmp (arg, valid_options->arg[i]->values[j]) == 0) { found = true; break; @@ -1318,7 +1319,7 @@ set_disassembler_options (const char *prospective_options) if (found) break; } - else if (disassembler_options_cmp (opt, valid_options->name[i]) == 0) + else if (strcmp (opt, valid_options->name[i]) == 0) break; if (valid_options->name[i] == NULL) { @@ -1327,6 +1328,10 @@ set_disassembler_options (const char *prospective_options) opt); return; } + if (!opt_end) + break; + *opt_end = ','; + opt = opt_end + 1; } *disassembler_options = options; @@ -1470,9 +1475,7 @@ disassembler_options_completer (struct cmd_list_element *ignore, /* Initialization code. */ -void _initialize_disasm (); -void -_initialize_disasm () +INIT_GDB_FILE (disasm) { /* Add the command that controls the disassembler options. */ set_show_commands set_show_disas_opts |