diff options
author | Pedro Alves <palves@redhat.com> | 2017-04-05 19:21:34 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-04-05 19:21:34 +0100 |
commit | 9f33b8b7c19413efbb37638bdba54706e4da8573 (patch) | |
tree | 64ba49281155c84dd527c7a6edd7977f9c011292 /gdb/mi/mi-cmd-var.c | |
parent | 67cb5b2da285175d37782f3606992b8052234b00 (diff) | |
download | gdb-9f33b8b7c19413efbb37638bdba54706e4da8573.zip gdb-9f33b8b7c19413efbb37638bdba54706e4da8573.tar.gz gdb-9f33b8b7c19413efbb37638bdba54706e4da8573.tar.bz2 |
-Wwrite-strings: Constify mi_cmd_argv_ftype's 'command' parameter
-Wwrite-strings flags this attempt to pass a literal to a "char *":
mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2);
Fix that by constifying mi_cmd_argv_ftype's 'command' parameter and
adjusting all MI commands.
gdb/ChangeLog:
2017-04-05 Pedro Alves <palves@redhat.com>
* mi/mi-cmd-break.c (mi_cmd_break_insert_1, mi_cmd_break_insert)
(mi_cmd_dprintf_insert, mi_cmd_break_passcount)
(mi_cmd_break_watch, mi_cmd_break_commands): Constify 'command'
parameter.
* mi/mi-cmd-catch.c (mi_cmd_catch_assert, mi_cmd_catch_exception)
(mi_cmd_catch_load, mi_cmd_catch_unload): Constify cmd' parameter.
* mi/mi-cmd-disas.c (mi_cmd_disassemble): Constify 'command'
parameter.
* mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_cd, mi_cmd_env_path)
(mi_cmd_env_dir, mi_cmd_inferior_tty_set, _cmd_inferior_tty_show)
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
(mi_cmd_file_list_exec_source_files)
(mi_cmd_file_list_shared_libraries): Constify 'command' parameter.
* mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
(mi_cmd_info_gdb_mi_command, mi_cmd_info_os): Constify 'command'
parameter.
* mi/mi-cmd-stack.c (mi_cmd_enable_frame_filters)
(mi_cmd_stack_list_frames, mi_cmd_stack_info_depth)
(mi_cmd_stack_list_locals, mi_cmd_stack_list_args)
(mi_cmd_stack_list_variables, mi_cmd_stack_select_frame)
(mi_cmd_stack_info_frame): Constify 'command' parameter.
* mi/mi-cmd-target.c (mi_cmd_target_file_get)
(mi_cmd_target_file_put, mi_cmd_target_file_delete): Constify
'command' parameter.
* mi/mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete)
(mi_cmd_var_set_format, mi_cmd_var_set_visualizer)
(mi_cmd_var_set_frozen, mi_cmd_var_show_format)
(mi_cmd_var_info_num_children, mi_cmd_var_list_children)
(mi_cmd_var_info_type, mi_cmd_var_info_path_expression)
(mi_cmd_var_info_expression, mi_cmd_var_show_attributes)
(mi_cmd_var_evaluate_expression, mi_cmd_var_assign)
(mi_cmd_var_update, mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Constify 'command' parameter.
* mi/mi-cmds.h (mi_cmd_argv_ftype): Constify 'command' parameter.
* mi/mi-interp.c (mi_cmd_interpreter_exec): Constify 'command'
parameter.
* mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_next)
(mi_cmd_exec_next_instruction, mi_cmd_exec_step)
(mi_cmd_exec_step_instruction, mi_cmd_exec_finish)
(mi_cmd_exec_return ,mi_cmd_exec_jump, mi_cmd_exec_continue)
(mi_cmd_exec_interrupt, mi_cmd_exec_run, mi_cmd_target_detach)
(mi_cmd_target_flash_erase, mi_cmd_thread_select)
(mi_cmd_thread_list_ids, mi_cmd_thread_info)
(mi_cmd_list_thread_groups, mi_cmd_data_list_register_names)
(mi_cmd_data_list_changed_registers)
(mi_cmd_data_write_register_values)
(mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory)
(mi_cmd_data_read_memory_bytes, mi_cmd_data_write_memory)
(mi_cmd_data_write_memory_bytes, mi_cmd_enable_timings)
(mi_cmd_list_features, mi_cmd_list_target_features)
(mi_cmd_add_inferior, mi_cmd_remove_inferior)
(mi_cmd_trace_define_variable, mi_cmd_trace_list_variables)
(mi_cmd_trace_find, mi_cmd_trace_save, mi_cmd_trace_start)
(mi_cmd_trace_status, mi_cmd_trace_stop, mi_cmd_ada_task_info)
(mi_cmd_trace_frame_collected): Constify 'command'
parameter.
* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Constify
'command' parameter.
Diffstat (limited to 'gdb/mi/mi-cmd-var.c')
-rw-r--r-- | gdb/mi/mi-cmd-var.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index fdfc726..430c07b 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -89,7 +89,7 @@ print_varobj (struct varobj *var, enum print_values print_values, /* VAROBJ operations */ void -mi_cmd_var_create (char *command, char **argv, int argc) +mi_cmd_var_create (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; CORE_ADDR frameaddr = 0; @@ -150,7 +150,7 @@ mi_cmd_var_create (char *command, char **argv, int argc) } void -mi_cmd_var_delete (char *command, char **argv, int argc) +mi_cmd_var_delete (const char *command, char **argv, int argc) { char *name; struct varobj *var; @@ -232,7 +232,7 @@ mi_parse_format (const char *arg) } void -mi_cmd_var_set_format (char *command, char **argv, int argc) +mi_cmd_var_set_format (const char *command, char **argv, int argc) { enum varobj_display_formats format; struct varobj *var; @@ -258,7 +258,7 @@ mi_cmd_var_set_format (char *command, char **argv, int argc) } void -mi_cmd_var_set_visualizer (char *command, char **argv, int argc) +mi_cmd_var_set_visualizer (const char *command, char **argv, int argc) { struct varobj *var; @@ -274,7 +274,7 @@ mi_cmd_var_set_visualizer (char *command, char **argv, int argc) } void -mi_cmd_var_set_frozen (char *command, char **argv, int argc) +mi_cmd_var_set_frozen (const char *command, char **argv, int argc) { struct varobj *var; int frozen; @@ -299,7 +299,7 @@ mi_cmd_var_set_frozen (char *command, char **argv, int argc) } void -mi_cmd_var_show_format (char *command, char **argv, int argc) +mi_cmd_var_show_format (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; enum varobj_display_formats format; @@ -318,7 +318,7 @@ mi_cmd_var_show_format (char *command, char **argv, int argc) } void -mi_cmd_var_info_num_children (char *command, char **argv, int argc) +mi_cmd_var_info_num_children (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; struct varobj *var; @@ -365,7 +365,7 @@ mi_print_value_p (struct varobj *var, enum print_values print_values) } void -mi_cmd_var_list_children (char *command, char **argv, int argc) +mi_cmd_var_list_children (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; struct varobj *var; @@ -434,7 +434,7 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) } void -mi_cmd_var_info_type (char *command, char **argv, int argc) +mi_cmd_var_info_type (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; struct varobj *var; @@ -450,7 +450,7 @@ mi_cmd_var_info_type (char *command, char **argv, int argc) } void -mi_cmd_var_info_path_expression (char *command, char **argv, int argc) +mi_cmd_var_info_path_expression (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; struct varobj *var; @@ -467,7 +467,7 @@ mi_cmd_var_info_path_expression (char *command, char **argv, int argc) } void -mi_cmd_var_info_expression (char *command, char **argv, int argc) +mi_cmd_var_info_expression (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; const struct language_defn *lang; @@ -488,7 +488,7 @@ mi_cmd_var_info_expression (char *command, char **argv, int argc) } void -mi_cmd_var_show_attributes (char *command, char **argv, int argc) +mi_cmd_var_show_attributes (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; int attr; @@ -512,7 +512,7 @@ mi_cmd_var_show_attributes (char *command, char **argv, int argc) } void -mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) +mi_cmd_var_evaluate_expression (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; struct varobj *var; @@ -579,7 +579,7 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) } void -mi_cmd_var_assign (char *command, char **argv, int argc) +mi_cmd_var_assign (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; struct varobj *var; @@ -646,7 +646,7 @@ mi_cmd_var_update_iter (struct varobj *var, void *data_pointer) } void -mi_cmd_var_update (char *command, char **argv, int argc) +mi_cmd_var_update (const char *command, char **argv, int argc) { struct ui_out *uiout = current_uiout; struct cleanup *cleanup; @@ -797,7 +797,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values, } void -mi_cmd_enable_pretty_printing (char *command, char **argv, int argc) +mi_cmd_enable_pretty_printing (const char *command, char **argv, int argc) { if (argc != 0) error (_("-enable-pretty-printing: no arguments allowed")); @@ -806,7 +806,7 @@ mi_cmd_enable_pretty_printing (char *command, char **argv, int argc) } void -mi_cmd_var_set_update_range (char *command, char **argv, int argc) +mi_cmd_var_set_update_range (const char *command, char **argv, int argc) { struct varobj *var; int from, to; |