and return it. */
static std::string
-mi_argv_to_format (char **argv, int argc)
+mi_argv_to_format (const char *const *argv, int argc)
{
int i;
std::string result;
If not, it will insert other type breakpoint. */
static void
-mi_cmd_break_insert_1 (int dprintf, const char *command, char **argv, int argc)
+mi_cmd_break_insert_1 (int dprintf, const char *command,
+ const char *const *argv, int argc)
{
const char *address = NULL;
int hardware = 0;
int temp_p = 0;
int thread = -1;
int ignore_count = 0;
- char *condition = NULL;
+ const char *condition = NULL;
int pending = 0;
int enabled = 1;
int tracepoint = 0;
/* Parse arguments. It could be -r or -h or -t, <location> or ``--''
to denote the end of the option list. */
int oind = 0;
- char *oarg;
+ const char *oarg;
while (1)
{
See the MI manual for the list of possible options. */
void
-mi_cmd_break_insert (const char *command, char **argv, int argc)
+mi_cmd_break_insert (const char *command, const char *const *argv, int argc)
{
mi_cmd_break_insert_1 (0, command, argv, argc);
}
See the MI manual for the list of possible options. */
void
-mi_cmd_dprintf_insert (const char *command, char **argv, int argc)
+mi_cmd_dprintf_insert (const char *command, const char *const *argv, int argc)
{
mi_cmd_break_insert_1 (1, command, argv, argc);
}
See the MI manual for the list of options. */
void
-mi_cmd_break_condition (const char *command, char **argv, int argc)
+mi_cmd_break_condition (const char *command, const char *const *argv,
+ int argc)
{
enum option
{
/* Parse arguments. */
int oind = 0;
- char *oarg;
+ const char *oarg;
bool force_condition = false;
while (true)
};
void
-mi_cmd_break_passcount (const char *command, char **argv, int argc)
+mi_cmd_break_passcount (const char *command, const char *const *argv,
+ int argc)
{
int n;
int p;
-break-watch -a <expr> --> insert an access wp. */
void
-mi_cmd_break_watch (const char *command, char **argv, int argc)
+mi_cmd_break_watch (const char *command, const char *const *argv, int argc)
{
- char *expr = NULL;
+ const char *expr = NULL;
enum wp_type type = REG_WP;
enum opt
{
/* Parse arguments. */
int oind = 0;
- char *oarg;
+ const char *oarg;
while (1)
{
}
void
-mi_cmd_break_commands (const char *command, char **argv, int argc)
+mi_cmd_break_commands (const char *command, const char *const *argv, int argc)
{
counted_command_line break_command;
char *endptr;
/* Handler for the -catch-assert command. */
void
-mi_cmd_catch_assert (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_assert (const char *cmd, const char *const *argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch();
std::string condition;
int temp = 0;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
/* Handler for the -catch-exception command. */
void
-mi_cmd_catch_exception (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_exception (const char *cmd, const char *const *argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch();
std::string condition;
enum ada_exception_catchpoint_kind ex_kind = ada_catch_exception;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
/* Handler for the -catch-handlers command. */
void
-mi_cmd_catch_handlers (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_handlers (const char *cmd, const char *const *argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
std::string condition;
int temp = 0;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
/* Common path for the -catch-load and -catch-unload. */
static void
-mi_catch_load_unload (int load, char *argv[], int argc)
+mi_catch_load_unload (int load, const char *const *argv, int argc)
{
const char *actual_cmd = load ? "-catch-load" : "-catch-unload";
int temp = 0;
int enabled = 1;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
OPT_TEMP,
/* Handler for the -catch-load. */
void
-mi_cmd_catch_load (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_load (const char *cmd, const char *const *argv, int argc)
{
mi_catch_load_unload (1, argv, argc);
}
/* Handler for the -catch-unload. */
void
-mi_cmd_catch_unload (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_unload (const char *cmd, const char *const *argv, int argc)
{
mi_catch_load_unload (0, argv, argc);
}
static void
mi_cmd_catch_exception_event (enum exception_event_kind kind,
- const char *cmd, char *argv[], int argc)
+ const char *cmd, const char *const *argv,
+ int argc)
{
- char *regex = NULL;
+ const char *regex = NULL;
bool temp = false;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
OPT_TEMP,
/* Handler for -catch-throw. */
void
-mi_cmd_catch_throw (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_throw (const char *cmd, const char *const *argv, int argc)
{
mi_cmd_catch_exception_event (EX_EVENT_THROW, cmd, argv, argc);
}
/* Handler for -catch-rethrow. */
void
-mi_cmd_catch_rethrow (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_rethrow (const char *cmd, const char *const *argv, int argc)
{
mi_cmd_catch_exception_event (EX_EVENT_RETHROW, cmd, argv, argc);
}
/* Handler for -catch-catch. */
void
-mi_cmd_catch_catch (const char *cmd, char *argv[], int argc)
+mi_cmd_catch_catch (const char *cmd, const char *const *argv, int argc)
{
mi_cmd_catch_exception_event (EX_EVENT_CATCH, cmd, argv, argc);
}
5 -- disassembly, source (pc-centric) and opcodes. */
void
-mi_cmd_disassemble (const char *command, char **argv, int argc)
+mi_cmd_disassemble (const char *command, const char *const *argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
struct ui_out *uiout = current_uiout;
bool source_seen = false;
/* ... and their corresponding value. */
- char *file_string = NULL;
+ const char *file_string = NULL;
int line_num = -1;
int how_many = -1;
CORE_ADDR low = 0;
/* Options processing stuff. */
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
FILE_OPT, LINE_OPT, NUM_OPT, START_OPT, END_OPT, ADDR_OPT, OPCODES_OPT,
/* Print working directory. */
void
-mi_cmd_env_pwd (const char *command, char **argv, int argc)
+mi_cmd_env_pwd (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
/* Change working directory. */
void
-mi_cmd_env_cd (const char *command, char **argv, int argc)
+mi_cmd_env_cd (const char *command, const char *const *argv, int argc)
{
if (argc == 0 || argc > 1)
error (_("-environment-cd: Usage DIRECTORY"));
/* Add one or more directories to start of executable search path. */
void
-mi_cmd_env_path (const char *command, char **argv, int argc)
+mi_cmd_env_path (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
const char *env;
int reset = 0;
int oind = 0;
int i;
- char *oarg;
+ const char *oarg;
enum opt
{
RESET_OPT
/* Add zero or more directories to the front of the source path. */
void
-mi_cmd_env_dir (const char *command, char **argv, int argc)
+mi_cmd_env_dir (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
int i;
int oind = 0;
int reset = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
RESET_OPT
/* Set the inferior terminal device name. */
void
-mi_cmd_inferior_tty_set (const char *command, char **argv, int argc)
+mi_cmd_inferior_tty_set (const char *command, const char *const *argv,
+ int argc)
{
if (argc > 0)
current_inferior ()->set_tty (argv[0]);
/* Print the inferior terminal device name. */
void
-mi_cmd_inferior_tty_show (const char *command, char **argv, int argc)
+mi_cmd_inferior_tty_show (const char *command, const char *const *argv,
+ int argc)
{
if ( !mi_valid_noargs ("-inferior-tty-show", argc, argv))
error (_("-inferior-tty-show: Usage: No args"));
current file being executed. */
void
-mi_cmd_file_list_exec_source_file (const char *command, char **argv, int argc)
+mi_cmd_file_list_exec_source_file (const char *command,
+ const char *const *argv, int argc)
{
struct symtab_and_line st;
struct ui_out *uiout = current_uiout;
/* Implement -file-list-exec-source-files command. */
void
-mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
+mi_cmd_file_list_exec_source_files (const char *command,
+ const char *const *argv, int argc)
{
enum opt
{
/* Parse arguments. */
int oind = 0;
- char *oarg;
+ const char *oarg;
bool group_by_objfile = false;
bool match_on_basename = false;
/* See mi-cmds.h. */
void
-mi_cmd_file_list_shared_libraries (const char *command, char **argv, int argc)
+mi_cmd_file_list_shared_libraries (const char *command,
+ const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
const char *pattern;
/* Implement the "-info-ada-exceptions" GDB/MI command. */
void
-mi_cmd_info_ada_exceptions (const char *command, char **argv, int argc)
+mi_cmd_info_ada_exceptions (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
struct gdbarch *gdbarch = get_current_arch ();
- char *regexp;
+ const char *regexp;
switch (argc)
{
/* Implement the "-info-gdb-mi-command" GDB/MI command. */
void
-mi_cmd_info_gdb_mi_command (const char *command, char **argv, int argc)
+mi_cmd_info_gdb_mi_command (const char *command, const char *const *argv,
+ int argc)
{
const char *cmd_name;
mi_command *cmd;
}
void
-mi_cmd_info_os (const char *command, char **argv, int argc)
+mi_cmd_info_os (const char *command, const char *const *argv, int argc)
{
switch (argc)
{
static int frame_filters = 0;
void
-mi_cmd_enable_frame_filters (const char *command, char **argv, int argc)
+mi_cmd_enable_frame_filters (const char *command, const char *const *argv,
+ int argc)
{
if (argc != 0)
error (_("-enable-frame-filters: no arguments allowed"));
displayed. */
void
-mi_cmd_stack_list_frames (const char *command, char **argv, int argc)
+mi_cmd_stack_list_frames (const char *command, const char *const *argv,
+ int argc)
{
int frame_low;
int frame_high;
--no-frame-filters. */
while (1)
{
- char *oarg;
+ const char *oarg;
int opt = mi_getopt ("-stack-list-frames", argc, argv,
opts, &oind, &oarg);
if (opt < 0)
}
void
-mi_cmd_stack_info_depth (const char *command, char **argv, int argc)
+mi_cmd_stack_info_depth (const char *command, const char *const *argv,
+ int argc)
{
int frame_high;
int i;
values. */
void
-mi_cmd_stack_list_locals (const char *command, char **argv, int argc)
+mi_cmd_stack_list_locals (const char *command, const char *const *argv,
+ int argc)
{
frame_info_ptr frame;
int raw_arg = 0;
while (1)
{
- char *oarg;
+ const char *oarg;
/* Don't parse 'print-values' as an option. */
int opt = mi_getopt ("-stack-list-locals", argc - 1, argv,
opts, &oind, &oarg);
values. */
void
-mi_cmd_stack_list_args (const char *command, char **argv, int argc)
+mi_cmd_stack_list_args (const char *command, const char *const *argv, int argc)
{
int frame_low;
int frame_high;
while (1)
{
- char *oarg;
+ const char *oarg;
int opt = mi_getopt_allow_unknown ("-stack-list-args", argc, argv,
opts, &oind, &oarg);
parse_print_value for possible values. */
void
-mi_cmd_stack_list_variables (const char *command, char **argv, int argc)
+mi_cmd_stack_list_variables (const char *command, const char *const *argv,
+ int argc)
{
frame_info_ptr frame;
int raw_arg = 0;
while (1)
{
- char *oarg;
+ const char *oarg;
/* Don't parse 'print-values' as an option. */
int opt = mi_getopt ("-stack-list-variables", argc - 1,
argv, opts, &oind, &oarg);
/* Implement the -stack-select-frame MI command. */
void
-mi_cmd_stack_select_frame (const char *command, char **argv, int argc)
+mi_cmd_stack_select_frame (const char *command, const char *const *argv,
+ int argc)
{
if (argc == 0 || argc > 1)
error (_("-stack-select-frame: Usage: FRAME_SPEC"));
}
void
-mi_cmd_stack_info_frame (const char *command, char **argv, int argc)
+mi_cmd_stack_info_frame (const char *command, const char *const *argv,
+ int argc)
{
if (argc > 0)
error (_("-stack-info-frame: No arguments allowed"));
/* Get a file from the target. */
void
-mi_cmd_target_file_get (const char *command, char **argv, int argc)
+mi_cmd_target_file_get (const char *command, const char *const *argv, int argc)
{
int oind = 0;
- char *oarg;
+ const char *oarg;
const char *remote_file, *local_file;
static const struct mi_opt opts[] =
{
/* Send a file to the target. */
void
-mi_cmd_target_file_put (const char *command, char **argv, int argc)
+mi_cmd_target_file_put (const char *command, const char *const *argv, int argc)
{
int oind = 0;
- char *oarg;
+ const char *oarg;
const char *remote_file, *local_file;
static const struct mi_opt opts[] =
{
/* Delete a file on the target. */
void
-mi_cmd_target_file_delete (const char *command, char **argv, int argc)
+mi_cmd_target_file_delete (const char *command, const char *const *argv,
+ int argc)
{
int oind = 0;
- char *oarg;
+ const char *oarg;
const char *remote_file;
static const struct mi_opt opts[] =
{
/* VAROBJ operations */
void
-mi_cmd_var_create (const char *command, char **argv, int argc)
+mi_cmd_var_create (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
CORE_ADDR frameaddr = 0;
struct varobj *var;
- char *frame;
- char *expr;
+ const char *frame;
+ const char *expr;
enum varobj_type var_type;
if (argc != 3)
}
void
-mi_cmd_var_delete (const char *command, char **argv, int argc)
+mi_cmd_var_delete (const char *command, const char *const *argv, int argc)
{
- char *name;
+ const char *name;
struct varobj *var;
int numdel;
int children_only_p = 0;
}
void
-mi_cmd_var_set_format (const char *command, char **argv, int argc)
+mi_cmd_var_set_format (const char *command, const char *const *argv, int argc)
{
enum varobj_display_formats format;
struct varobj *var;
}
void
-mi_cmd_var_set_visualizer (const char *command, char **argv, int argc)
+mi_cmd_var_set_visualizer (const char *command, const char *const *argv,
+ int argc)
{
struct varobj *var;
}
void
-mi_cmd_var_set_frozen (const char *command, char **argv, int argc)
+mi_cmd_var_set_frozen (const char *command, const char *const *argv, int argc)
{
struct varobj *var;
bool frozen;
}
void
-mi_cmd_var_show_format (const char *command, char **argv, int argc)
+mi_cmd_var_show_format (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
enum varobj_display_formats format;
}
void
-mi_cmd_var_info_num_children (const char *command, char **argv, int argc)
+mi_cmd_var_info_num_children (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
struct varobj *var;
}
void
-mi_cmd_var_list_children (const char *command, char **argv, int argc)
+mi_cmd_var_list_children (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
struct varobj *var;
}
void
-mi_cmd_var_info_type (const char *command, char **argv, int argc)
+mi_cmd_var_info_type (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
struct varobj *var;
}
void
-mi_cmd_var_info_path_expression (const char *command, char **argv, int argc)
+mi_cmd_var_info_path_expression (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
struct varobj *var;
}
void
-mi_cmd_var_info_expression (const char *command, char **argv, int argc)
+mi_cmd_var_info_expression (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
const struct language_defn *lang;
}
void
-mi_cmd_var_show_attributes (const char *command, char **argv, int argc)
+mi_cmd_var_show_attributes (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
int attr;
}
void
-mi_cmd_var_evaluate_expression (const char *command, char **argv, int argc)
+mi_cmd_var_evaluate_expression (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
struct varobj *var;
enum varobj_display_formats format;
int formatFound;
int oind;
- char *oarg;
+ const char *oarg;
enum opt
{
}
void
-mi_cmd_var_assign (const char *command, char **argv, int argc)
+mi_cmd_var_assign (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
struct varobj *var;
}
void
-mi_cmd_var_update (const char *command, char **argv, int argc)
+mi_cmd_var_update (const char *command, const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
- char *name;
+ const char *name;
enum print_values print_values;
if (argc != 1 && argc != 2)
}
void
-mi_cmd_enable_pretty_printing (const char *command, char **argv, int argc)
+mi_cmd_enable_pretty_printing (const char *command, const char *const *argv,
+ int argc)
{
if (argc != 0)
error (_("-enable-pretty-printing: no arguments allowed"));
}
void
-mi_cmd_var_set_update_range (const char *command, char **argv, int argc)
+mi_cmd_var_set_update_range (const char *command, const char *const *argv,
+ int argc)
{
struct varobj *var;
int from, to;
PRINT_SIMPLE_VALUES
};
-typedef void (mi_cmd_argv_ftype) (const char *command, char **argv, int argc);
+typedef void (mi_cmd_argv_ftype) (const char *command, const char *const *argv,
+ int argc);
/* Declarations of the functions implementing each command. */
throw an error, otherwise return -1. */
static int
-mi_getopt_1 (const char *prefix, int argc, char **argv,
- const struct mi_opt *opts, int *oind, char **oarg,
+mi_getopt_1 (const char *prefix, int argc, const char *const *argv,
+ const struct mi_opt *opts, int *oind, const char **oarg,
int error_on_unknown)
{
- char *arg;
+ const char *arg;
const struct mi_opt *opt;
/* We assume that argv/argc are ok. */
int
mi_getopt (const char *prefix,
- int argc, char **argv,
+ int argc, const char *const *argv,
const struct mi_opt *opts,
- int *oind, char **oarg)
+ int *oind, const char **oarg)
{
return mi_getopt_1 (prefix, argc, argv, opts, oind, oarg, 1);
}
int
-mi_getopt_allow_unknown (const char *prefix, int argc, char **argv,
- const struct mi_opt *opts, int *oind, char **oarg)
+mi_getopt_allow_unknown (const char *prefix, int argc,
+ const char *const *argv,
+ const struct mi_opt *opts, int *oind,
+ const char **oarg)
{
return mi_getopt_1 (prefix, argc, argv, opts, oind, oarg, 0);
}
int
-mi_valid_noargs (const char *prefix, int argc, char **argv)
+mi_valid_noargs (const char *prefix, int argc, const char *const *argv)
{
int oind = 0;
- char *oarg;
+ const char *oarg;
static const struct mi_opt opts[] =
{
{ 0, 0, 0 }
``error("%s: Unknown option %c", prefix, option)'' while
mi_getopt_allow_unknown returns -1. */
-extern int mi_getopt (const char *prefix, int argc, char **argv,
- const struct mi_opt *opt, int *optind, char **optarg);
+extern int mi_getopt (const char *prefix, int argc, const char *const *argv,
+ const struct mi_opt *opt, int *optind,
+ const char **optarg);
extern int mi_getopt_allow_unknown (const char *prefix, int argc,
- char **argv, const struct mi_opt *opts,
- int *oind, char **oarg);
+ const char *const *argv,
+ const struct mi_opt *opts,
+ int *oind, const char **oarg);
/* mi_valid_noargs determines if ARGC/ARGV are a valid set of
parameters to satisfy an MI function that is not supposed to
for an MI function that takes no arguments. Otherwise, it returns 0
and the appropriate error message is displayed by mi_getopt. */
-extern int mi_valid_noargs (const char *prefix, int argc, char **argv);
+extern int mi_valid_noargs (const char *prefix, int argc,
+ const char *const *argv);
#endif /* MI_MI_GETOPT_H */
}
void
-mi_cmd_interpreter_exec (const char *command, char **argv, int argc)
+mi_cmd_interpreter_exec (const char *command, const char *const *argv,
+ int argc)
{
struct interp *interp_to_use;
int i;
static void mi_cmd_execute (struct mi_parse *parse);
static void mi_execute_async_cli_command (const char *cli_command,
- char **argv, int argc);
+ const char *const *argv, int argc);
static bool register_changed_p (int regnum, readonly_detached_regcache *,
readonly_detached_regcache *);
static void output_register (frame_info_ptr, int regnum, int format,
struct mi_timestamp *end);
void
-mi_cmd_gdb_exit (const char *command, char **argv, int argc)
+mi_cmd_gdb_exit (const char *command, const char *const *argv, int argc)
{
struct mi_interp *mi = (struct mi_interp *) current_interpreter ();
}
void
-mi_cmd_exec_next (const char *command, char **argv, int argc)
+mi_cmd_exec_next (const char *command, const char *const *argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
}
void
-mi_cmd_exec_next_instruction (const char *command, char **argv, int argc)
+mi_cmd_exec_next_instruction (const char *command, const char *const *argv,
+ int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
}
void
-mi_cmd_exec_step (const char *command, char **argv, int argc)
+mi_cmd_exec_step (const char *command, const char *const *argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
}
void
-mi_cmd_exec_step_instruction (const char *command, char **argv, int argc)
+mi_cmd_exec_step_instruction (const char *command, const char *const *argv,
+ int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
}
void
-mi_cmd_exec_finish (const char *command, char **argv, int argc)
+mi_cmd_exec_finish (const char *command, const char *const *argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
}
void
-mi_cmd_exec_return (const char *command, char **argv, int argc)
+mi_cmd_exec_return (const char *command, const char *const *argv, int argc)
{
/* This command doesn't really execute the target, it just pops the
specified number of frames. */
}
void
-mi_cmd_exec_jump (const char *args, char **argv, int argc)
+mi_cmd_exec_jump (const char *args, const char *const *argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
mi_execute_async_cli_command ("jump", argv, argc);
}
static void
-exec_continue (char **argv, int argc)
+exec_continue (const char *const *argv, int argc)
{
prepare_execution_command (current_inferior ()->top_target (), mi_async_p ());
}
static void
-exec_reverse_continue (char **argv, int argc)
+exec_reverse_continue (const char *const *argv, int argc)
{
enum exec_direction_kind dir = execution_direction;
}
void
-mi_cmd_exec_continue (const char *command, char **argv, int argc)
+mi_cmd_exec_continue (const char *command, const char *const *argv, int argc)
{
if (argc > 0 && strcmp (argv[0], "--reverse") == 0)
exec_reverse_continue (argv + 1, argc - 1);
mi_cmd_execute. */
void
-mi_cmd_exec_interrupt (const char *command, char **argv, int argc)
+mi_cmd_exec_interrupt (const char *command, const char *const *argv, int argc)
{
/* In all-stop mode, everything stops, so we don't need to try
anything specific. */
}
void
-mi_cmd_exec_run (const char *command, char **argv, int argc)
+mi_cmd_exec_run (const char *command, const char *const *argv, int argc)
{
int start_p = 0;
};
int oind = 0;
- char *oarg;
+ const char *oarg;
while (1)
{
}
void
-mi_cmd_target_detach (const char *command, char **argv, int argc)
+mi_cmd_target_detach (const char *command, const char *const *argv, int argc)
{
if (argc != 0 && argc != 1)
error (_("Usage: -target-detach [pid | thread-group]"));
if (argc == 1)
{
struct thread_info *tp;
- char *end = argv[0];
+ char *end;
int pid;
/* First see if we are dealing with a thread-group id. */
}
void
-mi_cmd_target_flash_erase (const char *command, char **argv, int argc)
+mi_cmd_target_flash_erase (const char *command, const char *const *argv,
+ int argc)
{
flash_erase_command (NULL, 0);
}
void
-mi_cmd_thread_select (const char *command, char **argv, int argc)
+mi_cmd_thread_select (const char *command, const char *const *argv, int argc)
{
if (argc != 1)
error (_("-thread-select: USAGE: threadnum."));
}
void
-mi_cmd_thread_list_ids (const char *command, char **argv, int argc)
+mi_cmd_thread_list_ids (const char *command, const char *const *argv, int argc)
{
if (argc != 0)
error (_("-thread-list-ids: No arguments required."));
}
void
-mi_cmd_thread_info (const char *command, char **argv, int argc)
+mi_cmd_thread_info (const char *command, const char *const *argv, int argc)
{
if (argc != 0 && argc != 1)
error (_("Invalid MI command"));
}
void
-mi_cmd_list_thread_groups (const char *command, char **argv, int argc)
+mi_cmd_list_thread_groups (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
int available = 0;
};
int oind = 0;
- char *oarg;
+ const char *oarg;
while (1)
{
}
void
-mi_cmd_data_list_register_names (const char *command, char **argv, int argc)
+mi_cmd_data_list_register_names (const char *command, const char *const *argv,
+ int argc)
{
struct gdbarch *gdbarch;
struct ui_out *uiout = current_uiout;
}
void
-mi_cmd_data_list_changed_registers (const char *command, char **argv, int argc)
+mi_cmd_data_list_changed_registers (const char *command,
+ const char *const *argv, int argc)
{
static std::unique_ptr<readonly_detached_regcache> this_regs;
struct ui_out *uiout = current_uiout;
their values is returned. */
void
-mi_cmd_data_list_register_values (const char *command, char **argv, int argc)
+mi_cmd_data_list_register_values (const char *command, const char *const *argv,
+ int argc)
{
struct ui_out *uiout = current_uiout;
frame_info_ptr frame;
while (1)
{
- char *oarg;
+ const char *oarg;
int opt = mi_getopt ("-data-list-register-values", argc, argv,
opts, &oind, &oarg);
-data-write-register-values <format>
[<regnum1> <value1>...<regnumN> <valueN>] */
void
-mi_cmd_data_write_register_values (const char *command, char **argv, int argc)
+mi_cmd_data_write_register_values (const char *command,
+ const char *const *argv, int argc)
{
struct regcache *regcache;
struct gdbarch *gdbarch;
included in double quotes. */
void
-mi_cmd_data_evaluate_expression (const char *command, char **argv, int argc)
+mi_cmd_data_evaluate_expression (const char *command, const char *const *argv,
+ int argc)
{
struct value *val;
struct value_print_options opts;
The number of bytes read is SIZE*ROW*COL. */
void
-mi_cmd_data_read_memory (const char *command, char **argv, int argc)
+mi_cmd_data_read_memory (const char *command, const char *const *argv,
+ int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
struct ui_out *uiout = current_uiout;
int nr_bytes;
long offset = 0;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
OFFSET_OPT
}
void
-mi_cmd_data_read_memory_bytes (const char *command, char **argv, int argc)
+mi_cmd_data_read_memory_bytes (const char *command, const char *const *argv,
+ int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
struct ui_out *uiout = current_uiout;
long offset = 0;
int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
OFFSET_OPT
Prints nothing. */
void
-mi_cmd_data_write_memory (const char *command, char **argv, int argc)
+mi_cmd_data_write_memory (const char *command, const char *const *argv,
+ int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
LONGEST value;
long offset = 0;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
OFFSET_OPT
COUNT: number of bytes to be filled (decimal integer). */
void
-mi_cmd_data_write_memory_bytes (const char *command, char **argv, int argc)
+mi_cmd_data_write_memory_bytes (const char *command, const char *const *argv,
+ int argc)
{
CORE_ADDR addr;
- char *cdata;
+ const char *cdata;
size_t len_hex, len_bytes, len_units, i, steps, remaining_units;
long int count_units;
int unit_size;
}
void
-mi_cmd_enable_timings (const char *command, char **argv, int argc)
+mi_cmd_enable_timings (const char *command, const char *const *argv, int argc)
{
if (argc == 0)
do_timings = 1;
}
void
-mi_cmd_list_features (const char *command, char **argv, int argc)
+mi_cmd_list_features (const char *command, const char *const *argv, int argc)
{
if (argc == 0)
{
}
void
-mi_cmd_list_target_features (const char *command, char **argv, int argc)
+mi_cmd_list_target_features (const char *command, const char *const *argv,
+ int argc)
{
if (argc == 0)
{
}
void
-mi_cmd_add_inferior (const char *command, char **argv, int argc)
+mi_cmd_add_inferior (const char *command, const char *const *argv, int argc)
{
bool no_connection = false;
};
int oind = 0;
- char *oarg;
+ const char *oarg;
while (1)
{
}
void
-mi_cmd_remove_inferior (const char *command, char **argv, int argc)
+mi_cmd_remove_inferior (const char *command, const char *const *argv, int argc)
{
int id;
struct inferior *inf_to_remove;
case CLI_COMMAND:
{
- char *argv[2];
+ const char *argv[2];
/* A CLI command was read from the input stream. */
/* This "feature" will be removed as soon as we have a
/* Echo the command on the console. */
gdb_printf (gdb_stdlog, "%s\n", context->command);
/* Call the "console" interpreter. */
- argv[0] = (char *) INTERP_CONSOLE;
+ argv[0] = INTERP_CONSOLE;
argv[1] = context->command;
mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2);
}
void
-mi_execute_async_cli_command (const char *cli_command, char **argv, int argc)
+mi_execute_async_cli_command (const char *cli_command, const char *const *argv,
+ int argc)
{
std::string run = cli_command;
}
void
-mi_cmd_trace_define_variable (const char *command, char **argv, int argc)
+mi_cmd_trace_define_variable (const char *command, const char *const *argv,
+ int argc)
{
LONGEST initval = 0;
struct trace_state_variable *tsv;
- char *name = 0;
+ const char *name;
if (argc != 1 && argc != 2)
error (_("Usage: -trace-define-variable VARIABLE [VALUE]"));
}
void
-mi_cmd_trace_list_variables (const char *command, char **argv, int argc)
+mi_cmd_trace_list_variables (const char *command, const char *const *argv,
+ int argc)
{
if (argc != 0)
error (_("-trace-list-variables: no arguments allowed"));
}
void
-mi_cmd_trace_find (const char *command, char **argv, int argc)
+mi_cmd_trace_find (const char *command, const char *const *argv, int argc)
{
- char *mode;
+ const char *mode;
if (argc == 0)
error (_("trace selection mode is required"));
}
void
-mi_cmd_trace_save (const char *command, char **argv, int argc)
+mi_cmd_trace_save (const char *command, const char *const *argv, int argc)
{
int target_saves = 0;
int generate_ctf = 0;
- char *filename;
+ const char *filename;
int oind = 0;
- char *oarg;
+ const char *oarg;
enum opt
{
}
void
-mi_cmd_trace_start (const char *command, char **argv, int argc)
+mi_cmd_trace_start (const char *command, const char *const *argv, int argc)
{
start_tracing (NULL);
}
void
-mi_cmd_trace_status (const char *command, char **argv, int argc)
+mi_cmd_trace_status (const char *command, const char *const *argv, int argc)
{
trace_status_mi (0);
}
void
-mi_cmd_trace_stop (const char *command, char **argv, int argc)
+mi_cmd_trace_stop (const char *command, const char *const *argv, int argc)
{
stop_tracing (NULL);
trace_status_mi (1);
/* Implement the "-ada-task-info" command. */
void
-mi_cmd_ada_task_info (const char *command, char **argv, int argc)
+mi_cmd_ada_task_info (const char *command, const char *const *argv, int argc)
{
if (argc != 0 && argc != 1)
error (_("Invalid MI command"));
/* Implement the "-trace-frame-collected" command. */
void
-mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
+mi_cmd_trace_frame_collected (const char *command, const char *const *argv,
+ int argc)
{
struct bp_location *tloc;
int stepping_frame;
while (1)
{
- char *oarg;
+ const char *oarg;
int opt = mi_getopt ("-trace-frame-collected", argc, argv, opts,
&oind, &oarg);
if (opt < 0)
/* See mi/mi-main.h. */
void
-mi_cmd_fix_multi_location_breakpoint_output (const char *command, char **argv,
+mi_cmd_fix_multi_location_breakpoint_output (const char *command,
+ const char *const *argv,
int argc)
{
fix_multi_location_breakpoint_output_globally = true;
/* See mi/mi-main.h. */
void
-mi_cmd_fix_breakpoint_script_output (const char *command, char **argv, int argc)
+mi_cmd_fix_breakpoint_script_output (const char *command,
+ const char *const *argv, int argc)
{
fix_breakpoint_script_output_globally = true;
}
/* Implement the "-complete" command. */
void
-mi_cmd_complete (const char *command, char **argv, int argc)
+mi_cmd_complete (const char *command, const char *const *argv, int argc)
{
if (argc != 1)
error (_("Usage: -complete COMMAND"));
/* Implementation of -fix-multi-location-breakpoint-output. */
extern void mi_cmd_fix_multi_location_breakpoint_output (const char *command,
- char **argv, int argc);
+ const char *const *argv,
+ int argc);
/* Implementation of -fix-breakpoint-script-output. */
extern void mi_cmd_fix_breakpoint_script_output (const char *command,
- char **argv, int argc);
+ const char *const *argv,
+ int argc);
#endif /* MI_MI_MAIN_H */
in ascending PC order. */
void
-mi_cmd_symbol_list_lines (const char *command, char **argv, int argc)
+mi_cmd_symbol_list_lines (const char *command, const char *const *argv,
+ int argc)
{
struct gdbarch *gdbarch;
- char *filename;
+ const char *filename;
struct symtab *s;
int i;
struct ui_out *uiout = current_uiout;
the parsed value. If the text can't be parsed then an error is thrown. */
static size_t
-parse_max_results_option (char *arg)
+parse_max_results_option (const char *arg)
{
- char *ptr = arg;
+ char *ptr;
long long val = strtoll (arg, &ptr, 10);
if (arg == ptr || *ptr != '\0' || val > SIZE_MAX || val < 0)
error (_("invalid value for --max-results argument"));
Processes command line options from ARGV and ARGC. */
static void
-mi_info_functions_or_variables (enum search_domain kind, char **argv, int argc)
+mi_info_functions_or_variables (enum search_domain kind,
+ const char *const *argv, int argc)
{
size_t max_results = SIZE_MAX;
const char *regexp = nullptr;
};
int oind = 0;
- char *oarg = nullptr;
+ const char *oarg = nullptr;
while (1)
{
static void
mi_info_module_functions_or_variables (enum search_domain kind,
- char **argv, int argc)
+ const char *const *argv, int argc)
{
const char *module_regexp = nullptr;
const char *regexp = nullptr;
};
int oind = 0;
- char *oarg = nullptr;
+ const char *oarg = nullptr;
while (1)
{
/* Implement -symbol-info-functions command. */
void
-mi_cmd_symbol_info_functions (const char *command, char **argv, int argc)
+mi_cmd_symbol_info_functions (const char *command, const char *const *argv,
+ int argc)
{
mi_info_functions_or_variables (FUNCTIONS_DOMAIN, argv, argc);
}
/* Implement -symbol-info-module-functions command. */
void
-mi_cmd_symbol_info_module_functions (const char *command, char **argv,
- int argc)
+mi_cmd_symbol_info_module_functions (const char *command,
+ const char *const *argv, int argc)
{
mi_info_module_functions_or_variables (FUNCTIONS_DOMAIN, argv, argc);
}
/* Implement -symbol-info-module-variables command. */
void
-mi_cmd_symbol_info_module_variables (const char *command, char **argv,
- int argc)
+mi_cmd_symbol_info_module_variables (const char *command,
+ const char *const *argv, int argc)
{
mi_info_module_functions_or_variables (VARIABLES_DOMAIN, argv, argc);
}
/* Implement -symbol-inf-modules command. */
void
-mi_cmd_symbol_info_modules (const char *command, char **argv, int argc)
+mi_cmd_symbol_info_modules (const char *command, const char *const *argv,
+ int argc)
{
size_t max_results = SIZE_MAX;
const char *regexp = nullptr;
};
int oind = 0;
- char *oarg = nullptr;
+ const char *oarg = nullptr;
while (1)
{
/* Implement -symbol-info-types command. */
void
-mi_cmd_symbol_info_types (const char *command, char **argv, int argc)
+mi_cmd_symbol_info_types (const char *command, const char *const *argv,
+ int argc)
{
size_t max_results = SIZE_MAX;
const char *regexp = nullptr;
};
int oind = 0;
- char *oarg = nullptr;
+ const char *oarg = nullptr;
while (true)
{
/* Implement -symbol-info-variables command. */
void
-mi_cmd_symbol_info_variables (const char *command, char **argv, int argc)
+mi_cmd_symbol_info_variables (const char *command, const char *const *argv,
+ int argc)
{
mi_info_functions_or_variables (VARIABLES_DOMAIN, argv, argc);
}