This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] -Wwrite-strings: The Rest
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 5 Apr 2017 18:23:40 -0000
- Subject: [binutils-gdb] -Wwrite-strings: The Rest
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a121b7c1ac76833018f4fc3adaeddc3147272dd0
commit a121b7c1ac76833018f4fc3adaeddc3147272dd0
Author: Pedro Alves <palves@redhat.com>
Date: Wed Apr 5 19:21:37 2017 +0100
-Wwrite-strings: The Rest
This is the remainder boring constification that all looks more of less
borderline obvious IMO.
gdb/ChangeLog:
2017-04-05 Pedro Alves <palves@redhat.com>
* ada-exp.y (yyerror): Constify.
* ada-lang.c (bound_name, get_selections)
(ada_variant_discrim_type)
(ada_variant_discrim_name, ada_value_struct_elt)
(ada_lookup_struct_elt_type, is_unchecked_variant)
(ada_which_variant_applies, standard_exc, ada_get_next_arg)
(catch_ada_exception_command_split)
(catch_ada_assert_command_split, catch_assert_command)
(ada_op_name): Constify.
* ada-lang.h (ada_yyerror, get_selections)
(ada_variant_discrim_name, ada_value_struct_elt): Constify.
* arc-tdep.c (arc_print_frame_cache): Constify.
* arm-tdep.c (arm_skip_stub): Constify.
* ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref)
(gen_aggregate_elt_ref): Constify.
* bcache.c (print_bcache_statistics): Constify.
* bcache.h (print_bcache_statistics): Constify.
* break-catch-throw.c (catch_exception_command_1):
* breakpoint.c (struct ep_type_description::description):
Constify.
(add_solib_catchpoint): Constify.
(catch_fork_command_1): Add cast.
(add_catch_command): Constify.
* breakpoint.h (add_catch_command, add_solib_catchpoint):
Constify.
* bsd-uthread.c (bsd_uthread_state): Constify.
* buildsym.c (patch_subfile_names): Constify.
* buildsym.h (next_symbol_text_func, patch_subfile_names):
Constify.
* c-exp.y (yyerror): Constify.
(token::oper): Constify.
* c-lang.h (c_yyerror, cp_print_class_member): Constify.
* c-varobj.c (cplus_describe_child): Constify.
* charset.c (find_charset_names): Add cast.
(find_charset_names): Constify array and add const_cast.
* cli/cli-cmds.c (complete_command, cd_command): Constify.
(edit_command): Constify.
* cli/cli-decode.c (lookup_cmd): Constify.
* cli/cli-dump.c (dump_memory_command, dump_value_command):
Constify.
(struct dump_context): Constify.
(add_dump_command, restore_command): Constify.
* cli/cli-script.c (get_command_line): Constify.
* cli/cli-script.h (get_command_line): Constify.
* cli/cli-utils.c (check_for_argument): Constify.
* cli/cli-utils.h (check_for_argument): Constify.
* coff-pe-read.c (struct read_pe_section_data): Constify.
* command.h (lookup_cmd): Constify.
* common/print-utils.c (decimal2str): Constify.
* completer.c (gdb_print_filename): Constify.
* corefile.c (set_gnutarget): Constify.
* cp-name-parser.y (yyerror): Constify.
* cp-valprint.c (cp_print_class_member): Constify.
* cris-tdep.c (cris_register_name, crisv32_register_name):
Constify.
* d-exp.y (yyerror): Constify.
(struct token::oper): Constify.
* d-lang.h (d_yyerror): Constify.
* dbxread.c (struct header_file_location::name): Constify.
(add_old_header_file, add_new_header_file, last_function_name)
(dbx_next_symbol_text, add_bincl_to_list)
(find_corresponding_bincl_psymtab, set_namestring)
(find_stab_function_addr, read_dbx_symtab, start_psymtab)
(dbx_end_psymtab, read_ofile_symtab, process_one_symbol):
* defs.h (command_line_input, print_address_symbolic)
(deprecated_readline_begin_hook): Constify.
* dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name):
Constify.
* event-top.c (handle_line_of_input): Constify and add cast.
* exceptions.c (catch_errors): Constify.
* exceptions.h (catch_errors): Constify.
* expprint.c (print_subexp_standard, op_string, op_name)
(op_name_standard, dump_raw_expression, dump_raw_expression):
* expression.h (op_name, op_string, dump_raw_expression):
Constify.
* f-exp.y (yyerror): Constify.
(struct token::oper): Constify.
(struct f77_boolean_val::name): Constify.
* f-lang.c (f_word_break_characters): Constify.
* f-lang.h (f_yyerror): Constify.
* fork-child.c (fork_inferior): Add cast.
* frv-tdep.c (struct gdbarch_tdep::register_names): Constify.
(new_variant): Constify.
* gdbarch.sh (pstring_ptr, pstring_list): Constify.
* gdbarch.c: Regenerate.
* gdbcore.h (set_gnutarget): Constify.
* go-exp.y (yyerror): Constify.
(token::oper): Constify.
* go-lang.h (go_yyerror): Constify.
* go32-nat.c (go32_sysinfo): Constify.
* guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify.
* guile/scm-cmd.c (cmdscm_function): Constify.
* guile/scm-param.c (pascm_param_value): Constify.
* h8300-tdep.c (h8300_register_name, h8300s_register_name)
(h8300sx_register_name): Constify.
* hppa-tdep.c (hppa32_register_name, hppa64_register_name):
Constify.
* ia64-tdep.c (ia64_register_names): Constify.
* infcmd.c (construct_inferior_arguments): Constify.
(path_command, attach_post_wait): Constify.
* language.c (show_range_command, show_case_command)
(unk_lang_error): Constify.
* language.h (language_defn::la_error)
(language_defn::la_name_of_this): Constify.
* linespec.c (decode_line_2): Constify.
* linux-thread-db.c (thread_db_err_str): Constify.
* lm32-tdep.c (lm32_register_name): Constify.
* m2-exp.y (yyerror): Constify.
* m2-lang.h (m2_yyerror): Constify.
* m32r-tdep.c (m32r_register_names): Constify and make static.
* m68hc11-tdep.c (m68hc11_register_names): Constify.
* m88k-tdep.c (m88k_register_name): Constify.
* macroexp.c (appendmem): Constify.
* mdebugread.c (fdr_name, add_data_symbol, parse_type)
(upgrade_type, parse_external, parse_partial_symbols)
(mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab)
(new_symbol): Constify.
* memattr.c (mem_info_command): Constify.
* mep-tdep.c (register_name_from_keyword): Constify.
* mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env):
Constify.
* mi/mi-cmd-stack.c (list_args_or_locals): Constify.
* mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify.
* mi/mi-main.c (captured_mi_execute_command): Constify and add
cast.
(mi_execute_async_cli_command): Constify.
* mips-tdep.c (mips_register_name): Constify.
* mn10300-tdep.c (register_name, mn10300_generic_register_name)
(am33_register_name, am33_2_register_name)
* moxie-tdep.c (moxie_register_names): Constify.
* nat/linux-osdata.c (osdata_type): Constify fields.
* nto-tdep.c (nto_parse_redirection): Constify.
* objc-lang.c (lookup_struct_typedef, lookup_objc_class)
(lookup_child_selector): Constify.
(objc_methcall::name): Constify.
* objc-lang.h (lookup_objc_class, lookup_child_selector)
(lookup_struct_typedef): Constify.
* objfiles.c (pc_in_section): Constify.
* objfiles.h (pc_in_section): Constify.
* p-exp.y (struct token::oper): Constify.
(yyerror): Constify.
* p-lang.h (pascal_yyerror): Constify.
* parser-defs.h (op_name_standard): Constify.
(op_print::string): Constify.
(exp_descriptor::op_name): Constify.
* printcmd.c (print_address_symbolic): Constify.
* psymtab.c (print_partial_symbols): Constify.
* python/py-breakpoint.c (stop_func): Constify.
(bppy_get_expression): Constify.
* python/py-cmd.c (cmdpy_completer::name): Constify.
(cmdpy_function): Constify.
* python/py-event.c (evpy_add_attribute)
(gdbpy_initialize_event_generic): Constify.
* python/py-event.h (evpy_add_attribute)
(gdbpy_initialize_event_generic): Constify.
* python/py-evts.c (add_new_registry): Constify.
* python/py-finishbreakpoint.c (outofscope_func): Constify.
* python/py-framefilter.c (get_py_iter_from_func): Constify.
* python/py-inferior.c (get_buffer): Add cast.
* python/py-param.c (parm_constant::name): Constify.
* python/py-unwind.c (fprint_frame_id): Constify.
* python/python.c (gdbpy_parameter_value): Constify.
* remote-fileio.c (remote_fio_func_map): Make 'name' const.
* remote.c (memory_packet_config::name): Constify.
(show_packet_config_cmd, remote_write_bytes)
(remote_buffer_add_string):
* reverse.c (exec_reverse_once): Constify.
* rs6000-tdep.c (variant::name, variant::description): Constify.
* rust-exp.y (rustyyerror): Constify.
* rust-lang.c (rust_op_name): Constify.
* rust-lang.h (rustyyerror): Constify.
* serial.h (serial_ops::name): Constify.
* sh-tdep.c (sh_sh_register_name, sh_sh3_register_name)
(sh_sh3e_register_name, sh_sh2e_register_name)
(sh_sh2a_register_name, sh_sh2a_nofpu_register_name)
(sh_sh_dsp_register_name, sh_sh3_dsp_register_name)
(sh_sh4_register_name, sh_sh4_nofpu_register_name)
(sh_sh4al_dsp_register_name): Constify.
* sh64-tdep.c (sh64_register_name): Constify.
* solib-darwin.c (lookup_symbol_from_bfd): Constify.
* spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify.
* stabsread.c (patch_block_stabs, read_type_number)
(ref_map::stabs, ref_add, process_reference)
(symbol_reference_defined, define_symbol, define_symbol)
(error_type, read_type, read_member_functions, read_cpp_abbrev)
(read_one_struct_field, read_struct_fields, read_baseclasses)
(read_tilde_fields, read_struct_type, read_array_type)
(read_enum_type, read_sun_builtin_type, read_sun_floating_type)
(read_huge_number, read_range_type, read_args, common_block_start)
(find_name_end): Constify.
* stabsread.h (common_block_start, define_symbol)
(process_one_symbol, symbol_reference_defined, ref_add):
* symfile.c (get_section_index, add_symbol_file_command):
* symfile.h (get_section_index): Constify.
* target-descriptions.c (tdesc_type::name): Constify.
(tdesc_free_type): Add cast.
* target.c (find_default_run_target):
(add_deprecated_target_alias, find_default_run_target)
(target_announce_detach): Constify.
(do_option): Constify.
* target.h (add_deprecated_target_alias): Constify.
* thread.c (print_thread_info_1): Constify.
* top.c (deprecated_readline_begin_hook, command_line_input):
Constify.
(init_main): Add casts.
* top.h (handle_line_of_input): Constify.
* tracefile-tfile.c (tfile_write_uploaded_tsv): Constify.
* tracepoint.c (tvariables_info_1, trace_status_mi): Constify.
(tfind_command): Rename to ...
(tfind_command_1): ... this and constify.
(tfind_command): New function.
(tfind_end_command, tfind_start_command): Adjust.
(encode_source_string): Constify.
* tracepoint.h (encode_source_string): Constify.
* tui/tui-data.c (tui_partial_win_by_name): Constify.
* tui/tui-data.h (tui_partial_win_by_name): Constify.
* tui/tui-source.c (tui_set_source_content_nil): Constify.
* tui/tui-source.h (tui_set_source_content_nil): Constify.
* tui/tui-win.c (parse_scrolling_args): Constify.
* tui/tui-windata.c (tui_erase_data_content): Constify.
* tui/tui-windata.h (tui_erase_data_content): Constify.
* tui/tui-winsource.c (tui_erase_source_content): Constify.
* tui/tui.c (tui_enable): Add cast.
* utils.c (defaulted_query): Constify.
(init_page_info): Add cast.
(puts_debug, subset_compare): Constify.
* utils.h (subset_compare): Constify.
* varobj.c (varobj_format_string): Constify.
* varobj.h (varobj_format_string): Constify.
* vax-tdep.c (vax_register_name): Constify.
* windows-nat.c (windows_detach): Constify.
* xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify.
* xml-support.c (gdb_xml_end_element): Constify.
* xml-tdesc.c (tdesc_start_reg): Constify.
* xstormy16-tdep.c (xstormy16_register_name): Constify.
* xtensa-tdep.c (xtensa_find_register_by_name): Constify.
* xtensa-tdep.h (xtensa_register_t::name): Constify.
gdb/gdbserver/ChangeLog:
2017-04-05 Pedro Alves <palves@redhat.com>
* gdbreplay.c (sync_error): Constify.
* linux-x86-low.c (push_opcode): Constify.
Diff:
---
gdb/ChangeLog | 240 +++++++++++++++++++++++++++++++++++++++
gdb/ada-exp.y | 4 +-
gdb/ada-lang.c | 54 ++++-----
gdb/ada-lang.h | 8 +-
gdb/arc-tdep.c | 2 +-
gdb/arm-tdep.c | 2 +-
gdb/ax-gdb.c | 21 ++--
gdb/bcache.c | 2 +-
gdb/bcache.h | 2 +-
gdb/breakpoint.c | 8 +-
gdb/breakpoint.h | 4 +-
gdb/bsd-uthread.c | 2 +-
gdb/buildsym.c | 2 +-
gdb/buildsym.h | 4 +-
gdb/c-exp.y | 6 +-
gdb/c-lang.h | 4 +-
gdb/c-varobj.c | 2 +-
gdb/charset.c | 11 +-
gdb/cli/cli-cmds.c | 14 +--
gdb/cli/cli-decode.c | 3 +-
gdb/cli/cli-dump.c | 15 +--
gdb/cli/cli-script.c | 2 +-
gdb/cli/cli-script.h | 2 +-
gdb/coff-pe-read.c | 2 +-
gdb/command.h | 3 +-
gdb/common/print-utils.c | 2 +-
gdb/completer.c | 3 +-
gdb/corefile.c | 2 +-
gdb/cp-name-parser.y | 4 +-
gdb/cp-valprint.c | 2 +-
gdb/cris-tdep.c | 6 +-
gdb/d-exp.y | 6 +-
gdb/d-lang.h | 2 +-
gdb/dbxread.c | 80 ++++++-------
gdb/defs.h | 7 +-
gdb/dwarf2read.c | 8 +-
gdb/event-top.c | 2 +-
gdb/exceptions.c | 4 +-
gdb/exceptions.h | 3 +-
gdb/expprint.c | 14 +--
gdb/expression.h | 6 +-
gdb/f-exp.y | 8 +-
gdb/f-lang.h | 2 +-
gdb/fork-child.c | 2 +-
gdb/frv-tdep.c | 6 +-
gdb/gdbarch.c | 4 +-
gdb/gdbarch.sh | 4 +-
gdb/gdbcore.h | 2 +-
gdb/gdbserver/ChangeLog | 5 +
gdb/gdbserver/gdbreplay.c | 2 +-
gdb/gdbserver/linux-x86-low.c | 2 +-
gdb/go-exp.y | 6 +-
gdb/go-lang.h | 2 +-
gdb/go32-nat.c | 2 +-
gdb/guile/scm-breakpoint.c | 3 +-
gdb/guile/scm-cmd.c | 4 +-
gdb/guile/scm-param.c | 2 +-
gdb/h8300-tdep.c | 6 +-
gdb/hppa-tdep.c | 4 +-
gdb/ia64-tdep.c | 2 +-
gdb/infcmd.c | 12 +-
gdb/language.c | 8 +-
gdb/language.h | 4 +-
gdb/linespec.c | 3 +-
gdb/linux-thread-db.c | 2 +-
gdb/lm32-tdep.c | 2 +-
gdb/m2-exp.y | 4 +-
gdb/m2-lang.h | 2 +-
gdb/m32r-tdep.c | 2 +-
gdb/m68hc11-tdep.c | 2 +-
gdb/m88k-tdep.c | 2 +-
gdb/macroexp.c | 2 +-
gdb/mdebugread.c | 46 ++++----
gdb/memattr.c | 2 +-
gdb/mep-tdep.c | 2 +-
gdb/mi/mi-cmd-env.c | 4 +-
gdb/mi/mi-cmd-stack.c | 2 +-
gdb/mi/mi-cmd-var.c | 2 +-
gdb/mi/mi-main.c | 6 +-
gdb/mips-tdep.c | 6 +-
gdb/mn10300-tdep.c | 10 +-
gdb/moxie-tdep.c | 2 +-
gdb/nat/linux-osdata.c | 6 +-
gdb/nto-tdep.c | 2 +-
gdb/objc-lang.c | 8 +-
gdb/objc-lang.h | 7 +-
gdb/objfiles.c | 2 +-
gdb/objfiles.h | 2 +-
gdb/p-exp.y | 6 +-
gdb/p-lang.h | 2 +-
gdb/parser-defs.h | 6 +-
gdb/printcmd.c | 2 +-
gdb/psymtab.c | 2 +-
gdb/python/py-breakpoint.c | 4 +-
gdb/python/py-cmd.c | 10 +-
gdb/python/py-event.c | 4 +-
gdb/python/py-event.h | 4 +-
gdb/python/py-evts.c | 2 +-
gdb/python/py-finishbreakpoint.c | 2 +-
gdb/python/py-framefilter.c | 2 +-
gdb/python/py-inferior.c | 5 +-
gdb/python/py-param.c | 2 +-
gdb/python/py-unwind.c | 2 +-
gdb/python/python.c | 2 +-
gdb/remote-fileio.c | 2 +-
gdb/remote.c | 8 +-
gdb/reverse.c | 2 +-
gdb/rs6000-tdep.c | 4 +-
gdb/rust-exp.y | 2 +-
gdb/rust-lang.c | 2 +-
gdb/rust-lang.h | 2 +-
gdb/serial.h | 2 +-
gdb/sh-tdep.c | 22 ++--
gdb/sh64-tdep.c | 2 +-
gdb/solib-darwin.c | 2 +-
gdb/spu-tdep.c | 4 +-
gdb/stabsread.c | 129 +++++++++++----------
gdb/stabsread.h | 10 +-
gdb/symfile.c | 12 +-
gdb/symfile.h | 2 +-
gdb/target-descriptions.c | 8 +-
gdb/target.c | 10 +-
gdb/target.h | 3 +-
gdb/thread.c | 2 +-
gdb/top.c | 5 +-
gdb/top.h | 2 +-
gdb/tracefile-tfile.c | 4 +-
gdb/tracepoint.c | 22 ++--
gdb/tracepoint.h | 2 +-
gdb/tui/tui-data.c | 2 +-
gdb/tui/tui-data.h | 2 +-
gdb/tui/tui-source.c | 2 +-
gdb/tui/tui-source.h | 2 +-
gdb/tui/tui-win.c | 11 +-
gdb/tui/tui-windata.c | 2 +-
gdb/tui/tui-windata.h | 2 +-
gdb/tui/tui-winsource.c | 2 +-
gdb/tui/tui.c | 2 +-
gdb/utils.c | 11 +-
gdb/utils.h | 2 +-
gdb/varobj.c | 2 +-
gdb/varobj.h | 2 +-
gdb/vax-tdep.c | 2 +-
gdb/windows-nat.c | 2 +-
gdb/xcoffread.c | 8 +-
gdb/xml-support.c | 10 +-
gdb/xml-tdesc.c | 3 +-
gdb/xstormy16-tdep.c | 2 +-
gdb/xtensa-tdep.c | 2 +-
gdb/xtensa-tdep.h | 2 +-
150 files changed, 737 insertions(+), 452 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3a40ad9..cbf3c0c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,245 @@
2017-04-05 Pedro Alves <palves@redhat.com>
+ * ada-exp.y (yyerror): Constify.
+ * ada-lang.c (bound_name, get_selections)
+ (ada_variant_discrim_type)
+ (ada_variant_discrim_name, ada_value_struct_elt)
+ (ada_lookup_struct_elt_type, is_unchecked_variant)
+ (ada_which_variant_applies, standard_exc, ada_get_next_arg)
+ (catch_ada_exception_command_split)
+ (catch_ada_assert_command_split, catch_assert_command)
+ (ada_op_name): Constify.
+ * ada-lang.h (ada_yyerror, get_selections)
+ (ada_variant_discrim_name, ada_value_struct_elt): Constify.
+ * arc-tdep.c (arc_print_frame_cache): Constify.
+ * arm-tdep.c (arm_skip_stub): Constify.
+ * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref)
+ (gen_aggregate_elt_ref): Constify.
+ * bcache.c (print_bcache_statistics): Constify.
+ * bcache.h (print_bcache_statistics): Constify.
+ * break-catch-throw.c (catch_exception_command_1):
+ * breakpoint.c (struct ep_type_description::description):
+ Constify.
+ (add_solib_catchpoint): Constify.
+ (catch_fork_command_1): Add cast.
+ (add_catch_command): Constify.
+ * breakpoint.h (add_catch_command, add_solib_catchpoint):
+ Constify.
+ * bsd-uthread.c (bsd_uthread_state): Constify.
+ * buildsym.c (patch_subfile_names): Constify.
+ * buildsym.h (next_symbol_text_func, patch_subfile_names):
+ Constify.
+ * c-exp.y (yyerror): Constify.
+ (token::oper): Constify.
+ * c-lang.h (c_yyerror, cp_print_class_member): Constify.
+ * c-varobj.c (cplus_describe_child): Constify.
+ * charset.c (find_charset_names): Add cast.
+ (find_charset_names): Constify array and add const_cast.
+ * cli/cli-cmds.c (complete_command, cd_command): Constify.
+ (edit_command): Constify.
+ * cli/cli-decode.c (lookup_cmd): Constify.
+ * cli/cli-dump.c (dump_memory_command, dump_value_command):
+ Constify.
+ (struct dump_context): Constify.
+ (add_dump_command, restore_command): Constify.
+ * cli/cli-script.c (get_command_line): Constify.
+ * cli/cli-script.h (get_command_line): Constify.
+ * cli/cli-utils.c (check_for_argument): Constify.
+ * cli/cli-utils.h (check_for_argument): Constify.
+ * coff-pe-read.c (struct read_pe_section_data): Constify.
+ * command.h (lookup_cmd): Constify.
+ * common/print-utils.c (decimal2str): Constify.
+ * completer.c (gdb_print_filename): Constify.
+ * corefile.c (set_gnutarget): Constify.
+ * cp-name-parser.y (yyerror): Constify.
+ * cp-valprint.c (cp_print_class_member): Constify.
+ * cris-tdep.c (cris_register_name, crisv32_register_name):
+ Constify.
+ * d-exp.y (yyerror): Constify.
+ (struct token::oper): Constify.
+ * d-lang.h (d_yyerror): Constify.
+ * dbxread.c (struct header_file_location::name): Constify.
+ (add_old_header_file, add_new_header_file, last_function_name)
+ (dbx_next_symbol_text, add_bincl_to_list)
+ (find_corresponding_bincl_psymtab, set_namestring)
+ (find_stab_function_addr, read_dbx_symtab, start_psymtab)
+ (dbx_end_psymtab, read_ofile_symtab, process_one_symbol):
+ * defs.h (command_line_input, print_address_symbolic)
+ (deprecated_readline_begin_hook): Constify.
+ * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name):
+ Constify.
+ * event-top.c (handle_line_of_input): Constify and add cast.
+ * exceptions.c (catch_errors): Constify.
+ * exceptions.h (catch_errors): Constify.
+ * expprint.c (print_subexp_standard, op_string, op_name)
+ (op_name_standard, dump_raw_expression, dump_raw_expression):
+ * expression.h (op_name, op_string, dump_raw_expression):
+ Constify.
+ * f-exp.y (yyerror): Constify.
+ (struct token::oper): Constify.
+ (struct f77_boolean_val::name): Constify.
+ * f-lang.c (f_word_break_characters): Constify.
+ * f-lang.h (f_yyerror): Constify.
+ * fork-child.c (fork_inferior): Add cast.
+ * frv-tdep.c (struct gdbarch_tdep::register_names): Constify.
+ (new_variant): Constify.
+ * gdbarch.sh (pstring_ptr, pstring_list): Constify.
+ * gdbarch.c: Regenerate.
+ * gdbcore.h (set_gnutarget): Constify.
+ * go-exp.y (yyerror): Constify.
+ (token::oper): Constify.
+ * go-lang.h (go_yyerror): Constify.
+ * go32-nat.c (go32_sysinfo): Constify.
+ * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify.
+ * guile/scm-cmd.c (cmdscm_function): Constify.
+ * guile/scm-param.c (pascm_param_value): Constify.
+ * h8300-tdep.c (h8300_register_name, h8300s_register_name)
+ (h8300sx_register_name): Constify.
+ * hppa-tdep.c (hppa32_register_name, hppa64_register_name):
+ Constify.
+ * ia64-tdep.c (ia64_register_names): Constify.
+ * infcmd.c (construct_inferior_arguments): Constify.
+ (path_command, attach_post_wait): Constify.
+ * language.c (show_range_command, show_case_command)
+ (unk_lang_error): Constify.
+ * language.h (language_defn::la_error)
+ (language_defn::la_name_of_this): Constify.
+ * linespec.c (decode_line_2): Constify.
+ * linux-thread-db.c (thread_db_err_str): Constify.
+ * lm32-tdep.c (lm32_register_name): Constify.
+ * m2-exp.y (yyerror): Constify.
+ * m2-lang.h (m2_yyerror): Constify.
+ * m32r-tdep.c (m32r_register_names): Constify and make static.
+ * m68hc11-tdep.c (m68hc11_register_names): Constify.
+ * m88k-tdep.c (m88k_register_name): Constify.
+ * macroexp.c (appendmem): Constify.
+ * mdebugread.c (fdr_name, add_data_symbol, parse_type)
+ (upgrade_type, parse_external, parse_partial_symbols)
+ (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab)
+ (new_symbol): Constify.
+ * memattr.c (mem_info_command): Constify.
+ * mep-tdep.c (register_name_from_keyword): Constify.
+ * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env):
+ Constify.
+ * mi/mi-cmd-stack.c (list_args_or_locals): Constify.
+ * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify.
+ * mi/mi-main.c (captured_mi_execute_command): Constify and add
+ cast.
+ (mi_execute_async_cli_command): Constify.
+ * mips-tdep.c (mips_register_name): Constify.
+ * mn10300-tdep.c (register_name, mn10300_generic_register_name)
+ (am33_register_name, am33_2_register_name)
+ * moxie-tdep.c (moxie_register_names): Constify.
+ * nat/linux-osdata.c (osdata_type): Constify fields.
+ * nto-tdep.c (nto_parse_redirection): Constify.
+ * objc-lang.c (lookup_struct_typedef, lookup_objc_class)
+ (lookup_child_selector): Constify.
+ (objc_methcall::name): Constify.
+ * objc-lang.h (lookup_objc_class, lookup_child_selector)
+ (lookup_struct_typedef): Constify.
+ * objfiles.c (pc_in_section): Constify.
+ * objfiles.h (pc_in_section): Constify.
+ * p-exp.y (struct token::oper): Constify.
+ (yyerror): Constify.
+ * p-lang.h (pascal_yyerror): Constify.
+ * parser-defs.h (op_name_standard): Constify.
+ (op_print::string): Constify.
+ (exp_descriptor::op_name): Constify.
+ * printcmd.c (print_address_symbolic): Constify.
+ * psymtab.c (print_partial_symbols): Constify.
+ * python/py-breakpoint.c (stop_func): Constify.
+ (bppy_get_expression): Constify.
+ * python/py-cmd.c (cmdpy_completer::name): Constify.
+ (cmdpy_function): Constify.
+ * python/py-event.c (evpy_add_attribute)
+ (gdbpy_initialize_event_generic): Constify.
+ * python/py-event.h (evpy_add_attribute)
+ (gdbpy_initialize_event_generic): Constify.
+ * python/py-evts.c (add_new_registry): Constify.
+ * python/py-finishbreakpoint.c (outofscope_func): Constify.
+ * python/py-framefilter.c (get_py_iter_from_func): Constify.
+ * python/py-inferior.c (get_buffer): Add cast.
+ * python/py-param.c (parm_constant::name): Constify.
+ * python/py-unwind.c (fprint_frame_id): Constify.
+ * python/python.c (gdbpy_parameter_value): Constify.
+ * remote-fileio.c (remote_fio_func_map): Make 'name' const.
+ * remote.c (memory_packet_config::name): Constify.
+ (show_packet_config_cmd, remote_write_bytes)
+ (remote_buffer_add_string):
+ * reverse.c (exec_reverse_once): Constify.
+ * rs6000-tdep.c (variant::name, variant::description): Constify.
+ * rust-exp.y (rustyyerror): Constify.
+ * rust-lang.c (rust_op_name): Constify.
+ * rust-lang.h (rustyyerror): Constify.
+ * serial.h (serial_ops::name): Constify.
+ * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name)
+ (sh_sh3e_register_name, sh_sh2e_register_name)
+ (sh_sh2a_register_name, sh_sh2a_nofpu_register_name)
+ (sh_sh_dsp_register_name, sh_sh3_dsp_register_name)
+ (sh_sh4_register_name, sh_sh4_nofpu_register_name)
+ (sh_sh4al_dsp_register_name): Constify.
+ * sh64-tdep.c (sh64_register_name): Constify.
+ * solib-darwin.c (lookup_symbol_from_bfd): Constify.
+ * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify.
+ * stabsread.c (patch_block_stabs, read_type_number)
+ (ref_map::stabs, ref_add, process_reference)
+ (symbol_reference_defined, define_symbol, define_symbol)
+ (error_type, read_type, read_member_functions, read_cpp_abbrev)
+ (read_one_struct_field, read_struct_fields, read_baseclasses)
+ (read_tilde_fields, read_struct_type, read_array_type)
+ (read_enum_type, read_sun_builtin_type, read_sun_floating_type)
+ (read_huge_number, read_range_type, read_args, common_block_start)
+ (find_name_end): Constify.
+ * stabsread.h (common_block_start, define_symbol)
+ (process_one_symbol, symbol_reference_defined, ref_add):
+ * symfile.c (get_section_index, add_symbol_file_command):
+ * symfile.h (get_section_index): Constify.
+ * target-descriptions.c (tdesc_type::name): Constify.
+ (tdesc_free_type): Add cast.
+ * target.c (find_default_run_target):
+ (add_deprecated_target_alias, find_default_run_target)
+ (target_announce_detach): Constify.
+ (do_option): Constify.
+ * target.h (add_deprecated_target_alias): Constify.
+ * thread.c (print_thread_info_1): Constify.
+ * top.c (deprecated_readline_begin_hook, command_line_input):
+ Constify.
+ (init_main): Add casts.
+ * top.h (handle_line_of_input): Constify.
+ * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify.
+ * tracepoint.c (tvariables_info_1, trace_status_mi): Constify.
+ (tfind_command): Rename to ...
+ (tfind_command_1): ... this and constify.
+ (tfind_command): New function.
+ (tfind_end_command, tfind_start_command): Adjust.
+ (encode_source_string): Constify.
+ * tracepoint.h (encode_source_string): Constify.
+ * tui/tui-data.c (tui_partial_win_by_name): Constify.
+ * tui/tui-data.h (tui_partial_win_by_name): Constify.
+ * tui/tui-source.c (tui_set_source_content_nil): Constify.
+ * tui/tui-source.h (tui_set_source_content_nil): Constify.
+ * tui/tui-win.c (parse_scrolling_args): Constify.
+ * tui/tui-windata.c (tui_erase_data_content): Constify.
+ * tui/tui-windata.h (tui_erase_data_content): Constify.
+ * tui/tui-winsource.c (tui_erase_source_content): Constify.
+ * tui/tui.c (tui_enable): Add cast.
+ * utils.c (defaulted_query): Constify.
+ (init_page_info): Add cast.
+ (puts_debug, subset_compare): Constify.
+ * utils.h (subset_compare): Constify.
+ * varobj.c (varobj_format_string): Constify.
+ * varobj.h (varobj_format_string): Constify.
+ * vax-tdep.c (vax_register_name): Constify.
+ * windows-nat.c (windows_detach): Constify.
+ * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify.
+ * xml-support.c (gdb_xml_end_element): Constify.
+ * xml-tdesc.c (tdesc_start_reg): Constify.
+ * xstormy16-tdep.c (xstormy16_register_name): Constify.
+ * xtensa-tdep.c (xtensa_find_register_by_name): Constify.
+ * xtensa-tdep.h (xtensa_register_t::name): Constify.
+
+2017-04-05 Pedro Alves <palves@redhat.com>
+
* proc-api.c (struct trans): Constify.
(procfs_note): Constify.
* proc-events.c (struct trans, syscall_table):
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index d9fcdfa..1eea454 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -77,7 +77,7 @@ int yyparse (void);
static int yylex (void);
-void yyerror (char *);
+void yyerror (const char *);
static void write_int (struct parser_state *, LONGEST, struct type *);
@@ -751,7 +751,7 @@ ada_parse (struct parser_state *par_state)
}
void
-yyerror (char *msg)
+yyerror (const char *msg)
{
error (_("Error in expression, near `%s'."), lexptr);
}
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 7be135e..2e5643b 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -130,7 +130,7 @@ static void replace_operator_with_call (struct expression **, int, int, int,
static int possible_user_operator_p (enum exp_opcode, struct value **);
-static char *ada_op_name (enum exp_opcode);
+static const char *ada_op_name (enum exp_opcode);
static const char *ada_decoded_op_name (enum exp_opcode);
@@ -150,7 +150,7 @@ static enum ada_renaming_category parse_old_style_renaming (struct type *,
static struct symbol *find_old_style_renaming_symbol (const char *,
const struct block *);
-static struct type *ada_lookup_struct_elt_type (struct type *, char *,
+static struct type *ada_lookup_struct_elt_type (struct type *, const char *,
int, int, int *);
static struct value *evaluate_subexp_type (struct expression *, int *);
@@ -1576,7 +1576,7 @@ ada_fixup_array_indexes_type (struct type *index_desc_type)
/* Names of MAX_ADA_DIMENS bounds in P_BOUNDS fields of array descriptors. */
-static char *bound_name[] = {
+static const char *bound_name[] = {
"LB0", "UB0", "LB1", "UB1", "LB2", "UB2", "LB3", "UB3",
"LB4", "UB4", "LB5", "UB5", "LB6", "UB6", "LB7", "UB7"
};
@@ -4035,10 +4035,10 @@ See set/show multiple-symbol."));
int
get_selections (int *choices, int n_choices, int max_results,
- int is_all_choice, char *annotation_suffix)
+ int is_all_choice, const char *annotation_suffix)
{
char *args;
- char *prompt;
+ const char *prompt;
int n_chosen;
int first_choice = is_all_choice ? 2 : 1;
@@ -7066,7 +7066,7 @@ ada_is_variant_part (struct type *type, int field_num)
struct type *
ada_variant_discrim_type (struct type *var_type, struct type *outer_type)
{
- char *name = ada_variant_discrim_name (var_type);
+ const char *name = ada_variant_discrim_name (var_type);
return ada_lookup_struct_elt_type (outer_type, name, 1, 1, NULL);
}
@@ -7087,7 +7087,7 @@ ada_is_others_clause (struct type *type, int field_num)
returns the name of the discriminant controlling the variant.
The value is valid until the next call to ada_variant_discrim_name. */
-char *
+const char *
ada_variant_discrim_name (struct type *type0)
{
static char *result = NULL;
@@ -7484,7 +7484,7 @@ ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
calling error. */
struct value *
-ada_value_struct_elt (struct value *arg, char *name, int no_err)
+ada_value_struct_elt (struct value *arg, const char *name, int no_err)
{
struct type *t, *t1;
struct value *v;
@@ -7598,7 +7598,7 @@ type_as_string (struct type *type)
TYPE is not a type of the right kind. */
static struct type *
-ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
+ada_lookup_struct_elt_type (struct type *type, const char *name, int refok,
int noerr, int *dispp)
{
int i;
@@ -7711,7 +7711,7 @@ BadName:
static int
is_unchecked_variant (struct type *var_type, struct type *outer_type)
{
- char *discrim_name = ada_variant_discrim_name (var_type);
+ const char *discrim_name = ada_variant_discrim_name (var_type);
return (ada_lookup_struct_elt_type (outer_type, discrim_name, 0, 1, NULL)
== NULL);
@@ -7729,7 +7729,7 @@ ada_which_variant_applies (struct type *var_type, struct type *outer_type,
{
int others_clause;
int i;
- char *discrim_name = ada_variant_discrim_name (var_type);
+ const char *discrim_name = ada_variant_discrim_name (var_type);
struct value *outer;
struct value *discrim;
LONGEST discrim_val;
@@ -11834,7 +11834,7 @@ ada_modulus (struct type *type)
an Ada83 compiler). As such, we do not include Numeric_Error from
this list of standard exceptions. */
-static char *standard_exc[] = {
+static const char *standard_exc[] = {
"constraint_error",
"program_error",
"storage_error",
@@ -12791,19 +12791,19 @@ static struct breakpoint_ops catch_assert_breakpoint_ops;
Return NULL if ARGPS does not contain any more tokens. */
static char *
-ada_get_next_arg (char **argsp)
+ada_get_next_arg (const char **argsp)
{
- char *args = *argsp;
- char *end;
+ const char *args = *argsp;
+ const char *end;
char *result;
- args = skip_spaces (args);
+ args = skip_spaces_const (args);
if (args[0] == '\0')
return NULL; /* No more arguments. */
/* Find the end of the current argument. */
- end = skip_to_space (args);
+ end = skip_to_space_const (args);
/* Adjust ARGSP to point to the start of the next argument. */
@@ -12827,7 +12827,7 @@ ada_get_next_arg (char **argsp)
after use). Otherwise COND_STRING is set to NULL. */
static void
-catch_ada_exception_command_split (char *args,
+catch_ada_exception_command_split (const char *args,
enum ada_exception_catchpoint_kind *ex,
char **excep_string,
char **cond_string)
@@ -12850,12 +12850,12 @@ catch_ada_exception_command_split (char *args,
/* Check to see if we have a condition. */
- args = skip_spaces (args);
+ args = skip_spaces_const (args);
if (startswith (args, "if")
&& (isspace (args[2]) || args[2] == '\0'))
{
args += 2;
- args = skip_spaces (args);
+ args = skip_spaces_const (args);
if (args[0] == '\0')
error (_("Condition missing after `if' keyword"));
@@ -13077,9 +13077,10 @@ create_ada_exception_catchpoint (struct gdbarch *gdbarch,
/* Implement the "catch exception" command. */
static void
-catch_ada_exception_command (char *arg, int from_tty,
+catch_ada_exception_command (char *arg_entry, int from_tty,
struct cmd_list_element *command)
{
+ const char *arg = arg_entry;
struct gdbarch *gdbarch = get_current_arch ();
int tempflag;
enum ada_exception_catchpoint_kind ex_kind;
@@ -13107,16 +13108,16 @@ catch_ada_exception_command (char *arg, int from_tty,
(the memory needs to be deallocated after use). */
static void
-catch_ada_assert_command_split (char *args, char **cond_string)
+catch_ada_assert_command_split (const char *args, char **cond_string)
{
- args = skip_spaces (args);
+ args = skip_spaces_const (args);
/* Check whether a condition was provided. */
if (startswith (args, "if")
&& (isspace (args[2]) || args[2] == '\0'))
{
args += 2;
- args = skip_spaces (args);
+ args = skip_spaces_const (args);
if (args[0] == '\0')
error (_("condition missing after `if' keyword"));
*cond_string = xstrdup (args);
@@ -13131,9 +13132,10 @@ catch_ada_assert_command_split (char *args, char **cond_string)
/* Implement the "catch assert" command. */
static void
-catch_assert_command (char *arg, int from_tty,
+catch_assert_command (char *arg_entry, int from_tty,
struct cmd_list_element *command)
{
+ const char *arg = arg_entry;
struct gdbarch *gdbarch = get_current_arch ();
int tempflag;
char *cond_string = NULL;
@@ -13571,7 +13573,7 @@ ada_operator_check (struct expression *exp, int pos,
return 0;
}
-static char *
+static const char *
ada_op_name (enum exp_opcode opcode)
{
switch (opcode)
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 794a282..5f97a6c 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -159,7 +159,7 @@ extern int ada_get_field_index (const struct type *type,
extern int ada_parse (struct parser_state *); /* Defined in ada-exp.y */
-extern void ada_yyerror (char *); /* Defined in ada-exp.y */
+extern void ada_yyerror (const char *); /* Defined in ada-exp.y */
/* Defined in ada-typeprint.c */
extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
@@ -243,7 +243,7 @@ extern void ada_fill_in_ada_prototype (struct symbol *);
extern int user_select_syms (struct block_symbol *, int, int);
-extern int get_selections (int *, int, int, int, char *);
+extern int get_selections (int *, int, int, int, const char *);
extern int ada_scan_number (const char *, int, LONGEST *, int *);
@@ -288,9 +288,9 @@ extern int ada_is_others_clause (struct type *, int);
extern int ada_in_variant (LONGEST, struct type *, int);
-extern char *ada_variant_discrim_name (struct type *);
+extern const char *ada_variant_discrim_name (struct type *);
-extern struct value *ada_value_struct_elt (struct value *, char *, int);
+extern struct value *ada_value_struct_elt (struct value *, const char *, int);
extern int ada_is_aligner_type (struct type *);
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 657b1eb..4f866a9 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -1530,7 +1530,7 @@ arc_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
/* Dump the frame info. Used for internal debugging only. */
static void
-arc_print_frame_cache (struct gdbarch *gdbarch, char *message,
+arc_print_frame_cache (struct gdbarch *gdbarch, const char *message,
struct arc_frame_cache *cache, int addresses_known)
{
debug_printf ("arc: frame_info %s\n", message);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index ade770e..9be7943 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -8367,7 +8367,7 @@ arm_skip_stub (struct frame_info *frame, CORE_ADDR pc)
{
/* Use the name suffix to determine which register contains the
target PC. */
- static char *table[15] =
+ static const char *table[15] =
{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "sl", "fp", "ip", "sp", "lr"
};
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 01099f5..05b1dd7 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -128,7 +128,8 @@ static void gen_binop (struct agent_expr *ax,
struct axs_value *value1,
struct axs_value *value2,
enum agent_op op,
- enum agent_op op_unsigned, int may_carry, char *name);
+ enum agent_op op_unsigned, int may_carry,
+ const char *name);
static void gen_logical_not (struct agent_expr *ax, struct axs_value *value,
struct type *result_type);
static void gen_complement (struct agent_expr *ax, struct axs_value *value);
@@ -144,12 +145,13 @@ static void gen_primitive_field (struct expression *exp,
static int gen_struct_ref_recursive (struct expression *exp,
struct agent_expr *ax,
struct axs_value *value,
- char *field, int offset,
+ const char *field, int offset,
struct type *type);
static void gen_struct_ref (struct expression *exp, struct agent_expr *ax,
struct axs_value *value,
- char *field,
- char *operator_name, char *operand_name);
+ const char *field,
+ const char *operator_name,
+ const char *operand_name);
static void gen_static_field (struct gdbarch *gdbarch,
struct agent_expr *ax, struct axs_value *value,
struct type *type, int fieldno);
@@ -1149,7 +1151,7 @@ static void
gen_binop (struct agent_expr *ax, struct axs_value *value,
struct axs_value *value1, struct axs_value *value2,
enum agent_op op, enum agent_op op_unsigned,
- int may_carry, char *name)
+ int may_carry, const char *name)
{
/* We only handle INT op INT. */
if ((TYPE_CODE (value1->type) != TYPE_CODE_INT)
@@ -1434,7 +1436,7 @@ gen_primitive_field (struct expression *exp,
static int
gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
struct axs_value *value,
- char *field, int offset, struct type *type)
+ const char *field, int offset, struct type *type)
{
int i, rslt;
int nbases = TYPE_N_BASECLASSES (type);
@@ -1498,8 +1500,8 @@ gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
it operates on; we use them in error messages. */
static void
gen_struct_ref (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value, char *field,
- char *operator_name, char *operand_name)
+ struct axs_value *value, const char *field,
+ const char *operator_name, const char *operand_name)
{
struct type *type;
int found;
@@ -1671,7 +1673,8 @@ static int
gen_aggregate_elt_ref (struct expression *exp,
struct agent_expr *ax, struct axs_value *value,
struct type *type, char *field,
- char *operator_name, char *operand_name)
+ const char *operator_name,
+ const char *operand_name)
{
switch (TYPE_CODE (type))
{
diff --git a/gdb/bcache.c b/gdb/bcache.c
index d6c0921..06ab843 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -356,7 +356,7 @@ print_percentage (int portion, int total)
BCACHE holds. Statistics are printed using `printf_filtered' and
its ilk. */
void
-print_bcache_statistics (struct bcache *c, char *type)
+print_bcache_statistics (struct bcache *c, const char *type)
{
int occupied_buckets;
int max_chain_length;
diff --git a/gdb/bcache.h b/gdb/bcache.h
index 8ec0bde..f9590aa 100644
--- a/gdb/bcache.h
+++ b/gdb/bcache.h
@@ -165,7 +165,7 @@ extern struct bcache *bcache_xmalloc (
eliminating duplication. TYPE should be a string describing the
kind of data BCACHE holds. Statistics are printed using
`printf_filtered' and its ilk. */
-extern void print_bcache_statistics (struct bcache *bcache, char *type);
+extern void print_bcache_statistics (struct bcache *bcache, const char *type);
extern int bcache_memory_used (struct bcache *bcache);
/* The hash functions */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 4cd7a00..3925ec6 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6215,7 +6215,7 @@ bptype_string (enum bptype type)
struct ep_type_description
{
enum bptype type;
- char *description;
+ const char *description;
};
static struct ep_type_description bptypes[] =
{
@@ -8507,7 +8507,7 @@ static struct breakpoint_ops catch_solib_breakpoint_ops;
created in an enabled state. */
void
-add_solib_catchpoint (char *arg, int is_load, int is_temp, int enabled)
+add_solib_catchpoint (const char *arg, int is_load, int is_temp, int enabled)
{
struct solib_catchpoint *c;
struct gdbarch *gdbarch = get_current_arch ();
@@ -8515,7 +8515,7 @@ add_solib_catchpoint (char *arg, int is_load, int is_temp, int enabled)
if (!arg)
arg = "";
- arg = skip_spaces (arg);
+ arg = skip_spaces_const (arg);
c = new solib_catchpoint ();
cleanup = make_cleanup (xfree, c);
@@ -15857,7 +15857,7 @@ static struct cmd_list_element *catch_cmdlist;
static struct cmd_list_element *tcatch_cmdlist;
void
-add_catch_command (char *name, char *docstring,
+add_catch_command (const char *name, const char *docstring,
cmd_sfunc_ftype *sfunc,
completer_ftype *completer,
void *user_data_catch,
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 6940270..a7f2128 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -1275,7 +1275,7 @@ extern void initialize_breakpoint_ops (void);
function. */
extern void
- add_catch_command (char *name, char *docstring,
+ add_catch_command (const char *name, const char *docstring,
cmd_sfunc_ftype *sfunc,
completer_ftype *completer,
void *user_data_catch,
@@ -1517,7 +1517,7 @@ extern int is_catchpoint (struct breakpoint *);
/* Shared helper function (MI and CLI) for creating and installing
a shared object event catchpoint. */
-extern void add_solib_catchpoint (char *arg, int is_load, int is_temp,
+extern void add_solib_catchpoint (const char *arg, int is_load, int is_temp,
int enabled);
/* Enable breakpoints and delete when hit. Called with ARG == NULL
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 5d4775c..9769d20 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -464,7 +464,7 @@ bsd_uthread_update_thread_list (struct target_ops *ops)
}
/* Possible states a thread can be in. */
-static char *bsd_uthread_state[] =
+static const char *bsd_uthread_state[] =
{
"RUNNING",
"SIGTHREAD",
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 76d74f8..cbad027 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -825,7 +825,7 @@ free_buildsym_compunit (void)
directory name actually is (by checking for a trailing '/'). */
void
-patch_subfile_names (struct subfile *subfile, char *name)
+patch_subfile_names (struct subfile *subfile, const char *name)
{
if (subfile != NULL
&& buildsym_compunit->comp_dir == NULL
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
index fc5f0e7..60109a0 100644
--- a/gdb/buildsym.h
+++ b/gdb/buildsym.h
@@ -194,7 +194,7 @@ typedef void (record_line_ftype) (struct subfile *subfile, int line,
/* Function to invoke get the next symbol. Return the symbol name. */
-EXTERN char *(*next_symbol_text_func) (struct objfile *);
+EXTERN const char *(*next_symbol_text_func) (struct objfile *);
extern void add_symbol_to_list (struct symbol *symbol,
struct pending **listhead);
@@ -216,7 +216,7 @@ extern void really_free_pendings (void *dummy);
extern void start_subfile (const char *name);
-extern void patch_subfile_names (struct subfile *subfile, char *name);
+extern void patch_subfile_names (struct subfile *subfile, const char *name);
extern void push_subfile (void);
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 7c25641..b2fc195 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -70,7 +70,7 @@ int yyparse (void);
static int yylex (void);
-void yyerror (char *);
+void yyerror (const char *);
static int type_aggregate_p (struct type *);
@@ -2217,7 +2217,7 @@ DEF_ENUM_FLAGS_TYPE (enum token_flag, token_flags);
struct token
{
- char *oper;
+ const char *oper;
int token;
enum exp_opcode opcode;
token_flags flags;
@@ -3265,7 +3265,7 @@ c_print_token (FILE *file, int type, YYSTYPE value)
#endif
void
-yyerror (char *msg)
+yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
index c4b19ec..9746238 100644
--- a/gdb/c-lang.h
+++ b/gdb/c-lang.h
@@ -63,7 +63,7 @@ DEF_ENUM_FLAGS_TYPE (enum c_string_type_values, c_string_type);
extern int c_parse (struct parser_state *);
-extern void c_yyerror (char *);
+extern void c_yyerror (const char *);
extern int c_parse_escape (const char **, struct obstack *);
@@ -120,7 +120,7 @@ extern void c_type_print_base (struct type *, struct ui_file *,
/* These are in cp-valprint.c */
extern void cp_print_class_member (const gdb_byte *, struct type *,
- struct ui_file *, char *);
+ struct ui_file *, const char *);
extern void cp_print_value_fields (struct type *, struct type *,
LONGEST, CORE_ADDR,
diff --git a/gdb/c-varobj.c b/gdb/c-varobj.c
index a5793e5..e3b097b 100644
--- a/gdb/c-varobj.c
+++ b/gdb/c-varobj.c
@@ -843,7 +843,7 @@ cplus_describe_child (const struct varobj *parent, int index,
}
else
{
- char *access = NULL;
+ const char *access = NULL;
int children[3];
cplus_class_num_children (type, children);
diff --git a/gdb/charset.c b/gdb/charset.c
index cc24f70..8302c59 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -706,7 +706,11 @@ static VEC (char_ptr) *charsets;
static void
find_charset_names (void)
{
- VEC_safe_push (char_ptr, charsets, GDB_DEFAULT_HOST_CHARSET);
+ /* Cast is fine here, because CHARSETS is never released. Note that
+ the vec does not hold "const char *" pointers instead of "char *"
+ because the non-phony version stores heap-allocated strings in
+ it. */
+ VEC_safe_push (char_ptr, charsets, (char *) GDB_DEFAULT_HOST_CHARSET);
VEC_safe_push (char_ptr, charsets, NULL);
}
@@ -775,7 +779,7 @@ static void
find_charset_names (void)
{
struct pex_obj *child;
- char *args[3];
+ const char *args[3];
int err, status;
int fail = 1;
int flags;
@@ -811,7 +815,8 @@ find_charset_names (void)
#endif
/* Note that we simply ignore errors here. */
if (!pex_run_in_environment (child, flags,
- args[0], args, environ_vector (iconv_env),
+ args[0], const_cast<char **> (args),
+ environ_vector (iconv_env),
NULL, NULL, &err))
{
FILE *in = pex_read_output (child, 0);
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index f7ffb6d..4956ba7 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -242,10 +242,11 @@ help_command (char *command, int from_tty)
[Is that why this function writes output with *_unfiltered?] */
static void
-complete_command (char *arg, int from_tty)
+complete_command (char *arg_entry, int from_tty)
{
+ const char *arg = arg_entry;
int argpoint;
- char *point, *arg_prefix;
+ char *arg_prefix;
VEC (char_ptr) *completions;
dont_repeat ();
@@ -270,7 +271,7 @@ complete_command (char *arg, int from_tty)
within, and except for filenames at the beginning of, the word to
be completed. The following crude imitation of readline's
word-breaking tries to accomodate this. */
- point = arg + argpoint;
+ const char *point = arg + argpoint;
while (point > arg)
{
if (strchr (rl_completer_word_break_characters, point[-1]) != 0)
@@ -392,10 +393,7 @@ cd_command (char *dir, int from_tty)
repeat might be useful but is more likely to be a mistake. */
dont_repeat ();
- if (dir == 0)
- dir = "~";
-
- dir = tilde_expand (dir);
+ dir = tilde_expand (dir != NULL ? dir : "~");
cleanup = make_cleanup (xfree, dir);
if (chdir (dir) < 0)
@@ -809,7 +807,7 @@ edit_command (char *arg, int from_tty)
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct symbol *sym;
- char *editor;
+ const char *editor;
char *p;
const char *fn;
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 4e302b7..fc14465 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1479,7 +1479,8 @@ undef_cmd_error (const char *cmdtype, const char *q)
the function field of the struct cmd_list_element is 0). */
struct cmd_list_element *
-lookup_cmd (const char **line, struct cmd_list_element *list, char *cmdtype,
+lookup_cmd (const char **line, struct cmd_list_element *list,
+ const char *cmdtype,
int allow_unknown, int ignore_help_classes)
{
struct cmd_list_element *last_list = 0;
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 9630261..213622d 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -247,7 +247,7 @@ dump_memory_to_file (const char *cmd, const char *mode, const char *file_format)
}
static void
-dump_memory_command (char *cmd, char *mode)
+dump_memory_command (char *cmd, const char *mode)
{
dump_memory_to_file (cmd, mode, "binary");
}
@@ -298,7 +298,7 @@ dump_value_to_file (const char *cmd, const char *mode, const char *file_format)
}
static void
-dump_value_command (char *cmd, char *mode)
+dump_value_command (char *cmd, const char *mode)
{
dump_value_to_file (cmd, mode, "binary");
}
@@ -377,8 +377,8 @@ append_binary_value (char *args, int from_tty)
struct dump_context
{
- void (*func) (char *cmd, char *mode);
- char *mode;
+ void (*func) (char *cmd, const char *mode);
+ const char *mode;
};
static void
@@ -390,8 +390,9 @@ call_dump_func (struct cmd_list_element *c, char *args, int from_tty)
}
static void
-add_dump_command (char *name, void (*func) (char *args, char *mode),
- char *descr)
+add_dump_command (const char *name,
+ void (*func) (char *args, const char *mode),
+ const char *descr)
{
struct cmd_list_element *c;
@@ -576,7 +577,7 @@ restore_command (char *args_in, int from_tty)
filename = scan_filename_with_cleanup (&args, NULL);
if (args != NULL && *args != '\0')
{
- char *binary_string = "binary";
+ static const char binary_string[] = "binary";
/* Look for optional "binary" flag. */
if (startswith (args, binary_string))
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index c3f1c65..33b657d 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -166,7 +166,7 @@ build_command_line (enum command_control_type type, const char *args)
such as "if" and "while". */
struct command_line *
-get_command_line (enum command_control_type type, char *arg)
+get_command_line (enum command_control_type type, const char *arg)
{
struct command_line *cmd;
struct cleanup *old_chain = NULL;
diff --git a/gdb/cli/cli-script.h b/gdb/cli/cli-script.h
index 969c5c6..c885976 100644
--- a/gdb/cli/cli-script.h
+++ b/gdb/cli/cli-script.h
@@ -39,7 +39,7 @@ extern enum command_control_type
execute_control_command_untraced (struct command_line *cmd);
extern struct command_line *get_command_line (enum command_control_type,
- char *);
+ const char *);
extern void print_command_lines (struct ui_out *,
struct command_line *, unsigned int);
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index 65004c0..e8c6b67 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -54,7 +54,7 @@ struct read_pe_section_data
enum minimal_symbol_type ms_type; /* Type to assign symbols in
section. */
unsigned int index; /* BFD section number. */
- char *section_name; /* Recorded section name. */
+ const char *section_name; /* Recorded section name. */
};
#define IMAGE_SCN_CNT_CODE 0x20
diff --git a/gdb/command.h b/gdb/command.h
index 2c86da4..ae20021 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -204,7 +204,8 @@ extern enum cmd_types cmd_type (struct cmd_list_element *cmd);
#define CMD_LIST_AMBIGUOUS ((struct cmd_list_element *) -1)
extern struct cmd_list_element *lookup_cmd (const char **,
- struct cmd_list_element *, char *,
+ struct cmd_list_element *,
+ const char *,
int, int);
extern struct cmd_list_element *lookup_cmd_1 (const char **,
diff --git a/gdb/common/print-utils.c b/gdb/common/print-utils.c
index a0fb541..52ecaf1 100644
--- a/gdb/common/print-utils.c
+++ b/gdb/common/print-utils.c
@@ -38,7 +38,7 @@ get_print_cell (void)
}
static char *
-decimal2str (char *sign, ULONGEST addr, int width)
+decimal2str (const char *sign, ULONGEST addr, int width)
{
/* Steal code from valprint.c:print_decimal(). Should this worry
about the real size of addr as the above does? */
diff --git a/gdb/completer.c b/gdb/completer.c
index 9183e2a..7e46416 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -1684,7 +1684,8 @@ gdb_print_filename (char *to_print, char *full_pathname, int prefix_bytes,
const struct match_list_displayer *displayer)
{
int printed_len, extension_char, slen, tlen;
- char *s, c, *new_full_pathname, *dn;
+ char *s, c, *new_full_pathname;
+ const char *dn;
extern int _rl_complete_mark_directories;
extension_char = 0;
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 54cb789..13a90b9 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -509,7 +509,7 @@ complete_set_gnutarget (struct cmd_list_element *cmd,
/* Set the gnutarget. */
void
-set_gnutarget (char *newtarget)
+set_gnutarget (const char *newtarget)
{
if (gnutarget_string != NULL)
xfree (gnutarget_string);
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index 73a4d90..78745cb 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -173,7 +173,7 @@ static struct demangle_component *d_binary (const char *,
int yyparse (void);
static int yylex (void);
-static void yyerror (char *);
+static void yyerror (const char *);
/* Enable yydebug for the stand-alone parser. */
#ifdef TEST_CPNAMES
@@ -1934,7 +1934,7 @@ yylex (void)
}
static void
-yyerror (char *msg)
+yyerror (const char *msg)
{
if (global_errmsg)
return;
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 143bb48..73fe03d 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -759,7 +759,7 @@ cp_find_class_member (struct type **self_p, int *fieldno,
void
cp_print_class_member (const gdb_byte *valaddr, struct type *type,
- struct ui_file *stream, char *prefix)
+ struct ui_file *stream, const char *prefix)
{
enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index aefd44a..a46356f 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1695,7 +1695,7 @@ cris_special_register_name (struct gdbarch *gdbarch, int regno)
static const char *
cris_register_name (struct gdbarch *gdbarch, int regno)
{
- static char *cris_genreg_names[] =
+ static const char *cris_genreg_names[] =
{ "r0", "r1", "r2", "r3", \
"r4", "r5", "r6", "r7", \
"r8", "r9", "r10", "r11", \
@@ -1720,14 +1720,14 @@ cris_register_name (struct gdbarch *gdbarch, int regno)
static const char *
crisv32_register_name (struct gdbarch *gdbarch, int regno)
{
- static char *crisv32_genreg_names[] =
+ static const char *crisv32_genreg_names[] =
{ "r0", "r1", "r2", "r3", \
"r4", "r5", "r6", "r7", \
"r8", "r9", "r10", "r11", \
"r12", "r13", "sp", "acr"
};
- static char *crisv32_sreg_names[] =
+ static const char *crisv32_sreg_names[] =
{ "s0", "s1", "s2", "s3", \
"s4", "s5", "s6", "s7", \
"s8", "s9", "s10", "s11", \
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index 8625e41..06eef5f 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -69,7 +69,7 @@ int yyparse (void);
static int yylex (void);
-void yyerror (char *);
+void yyerror (const char *);
static int type_aggregate_p (struct type *);
@@ -957,7 +957,7 @@ parse_string_or_char (const char *tokptr, const char **outptr,
struct token
{
- char *oper;
+ const char *oper;
int token;
enum exp_opcode opcode;
};
@@ -1648,7 +1648,7 @@ d_parse (struct parser_state *par_state)
}
void
-yyerror (char *msg)
+yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
diff --git a/gdb/d-lang.h b/gdb/d-lang.h
index 27e05a1..f47050a 100644
--- a/gdb/d-lang.h
+++ b/gdb/d-lang.h
@@ -58,7 +58,7 @@ struct builtin_d_type
extern int d_parse (struct parser_state *);
-extern void d_yyerror (char *);
+extern void d_yyerror (const char *);
/* Defined in d-lang.c */
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index e95d228..daa3ce9 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -237,7 +237,7 @@ find_text_range (bfd * sym_bfd, struct objfile *objfile)
struct header_file_location
{
- char *name; /* Name of header file */
+ const char *name; /* Name of header file */
int instance; /* See above */
struct partial_symtab *pst; /* Partial symtab that has the
BINCL/EINCL defs for this file. */
@@ -262,13 +262,14 @@ static void read_dbx_symtab (minimal_symbol_reader &, struct objfile *);
static void free_bincl_list (struct objfile *);
-static struct partial_symtab *find_corresponding_bincl_psymtab (char *, int);
+static struct partial_symtab *find_corresponding_bincl_psymtab (const char *,
+ int);
-static void add_bincl_to_list (struct partial_symtab *, char *, int);
+static void add_bincl_to_list (struct partial_symtab *, const char *, int);
static void init_bincl_list (int, struct objfile *);
-static char *dbx_next_symbol_text (struct objfile *);
+static const char *dbx_next_symbol_text (struct objfile *);
static void fill_symbuf (bfd *);
@@ -284,13 +285,13 @@ static void record_minimal_symbol (minimal_symbol_reader &,
const char *, CORE_ADDR, int,
struct objfile *);
-static void add_new_header_file (char *, int);
+static void add_new_header_file (const char *, int);
-static void add_old_header_file (char *, int);
+static void add_old_header_file (const char *, int);
static void add_this_object_header_file (int);
-static struct partial_symtab *start_psymtab (struct objfile *, char *,
+static struct partial_symtab *start_psymtab (struct objfile *, const char *,
CORE_ADDR, int,
struct partial_symbol **,
struct partial_symbol **);
@@ -340,7 +341,7 @@ add_this_object_header_file (int i)
symbol tables for the same header file. */
static void
-add_old_header_file (char *name, int instance)
+add_old_header_file (const char *name, int instance)
{
struct header_file *p = HEADER_FILES (dbxread_objfile);
int i;
@@ -366,7 +367,7 @@ add_old_header_file (char *name, int instance)
so we record the file when its "begin" is seen and ignore the "end". */
static void
-add_new_header_file (char *name, int instance)
+add_new_header_file (const char *name, int instance)
{
int i;
struct header_file *hfile;
@@ -734,7 +735,7 @@ static int symbuf_end;
/* Name of last function encountered. Used in Solaris to approximate
object file boundaries. */
-static char *last_function_name;
+static const char *last_function_name;
/* The address in memory of the string table of the object file we are
reading (which might not be the "main" object file, but might be a
@@ -842,7 +843,7 @@ stabs_seek (int sym_offset)
(a \ at the end of the text of a name)
call this function to get the continuation. */
-static char *
+static const char *
dbx_next_symbol_text (struct objfile *objfile)
{
struct internal_nlist nlist;
@@ -873,7 +874,7 @@ init_bincl_list (int number, struct objfile *objfile)
/* Add a bincl to the list. */
static void
-add_bincl_to_list (struct partial_symtab *pst, char *name, int instance)
+add_bincl_to_list (struct partial_symtab *pst, const char *name, int instance)
{
if (next_bincl >= bincl_list + bincls_allocated)
{
@@ -895,7 +896,7 @@ add_bincl_to_list (struct partial_symtab *pst, char *name, int instance)
with that header_file_location. */
static struct partial_symtab *
-find_corresponding_bincl_psymtab (char *name, int instance)
+find_corresponding_bincl_psymtab (const char *name, int instance)
{
struct header_file_location *bincl;
@@ -933,10 +934,10 @@ make_cleanup_free_bincl_list (struct objfile *objfile)
give a fake name, and print a single error message per symbol file read,
rather than abort the symbol reading or flood the user with messages. */
-static char *
+static const char *
set_namestring (struct objfile *objfile, const struct internal_nlist *nlist)
{
- char *namestring;
+ const char *namestring;
if (nlist->n_strx + file_string_table_offset
>= DBX_STRINGTAB_SIZE (objfile)
@@ -954,18 +955,19 @@ set_namestring (struct objfile *objfile, const struct internal_nlist *nlist)
}
static CORE_ADDR
-find_stab_function_addr (char *namestring, const char *filename,
+find_stab_function_addr (const char *namestring, const char *filename,
struct objfile *objfile)
{
struct bound_minimal_symbol msym;
- char *p;
int n;
- p = strchr (namestring, ':');
- if (p == NULL)
- p = namestring;
- n = p - namestring;
- p = (char *) alloca (n + 2);
+ const char *colon = strchr (namestring, ':');
+ if (colon == NULL)
+ n = 0;
+ else
+ n = colon - namestring;
+
+ char *p = (char *) alloca (n + 2);
strncpy (p, namestring, n);
p[n] = 0;
@@ -1017,10 +1019,10 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
struct internal_nlist nlist;
CORE_ADDR text_addr;
int text_size;
- char *sym_name;
+ const char *sym_name;
int sym_len;
- char *namestring;
+ const char *namestring;
int nsl;
int past_first_source_file = 0;
CORE_ADDR last_function_start = 0;
@@ -1283,7 +1285,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
static int prev_so_symnum = -10;
static int first_so_symnum;
const char *p;
- static char *dirname_nso;
+ static const char *dirname_nso;
int prev_textlow_not_set;
valu = nlist.n_value + ANOFFSET (objfile->section_offsets,
@@ -1477,7 +1479,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
case N_M2C: /* I suspect that I can ignore this here. */
case N_SCOPE: /* Same. */
{
- char *p;
+ const char *p;
namestring = set_namestring (objfile, &nlist);
@@ -1631,7 +1633,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
Accept either. */
while (*p && *p != ';' && *p != ',')
{
- char *q;
+ const char *q;
/* Check for and handle cretinous dbx symbol name
continuation! */
@@ -1996,7 +1998,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
(normal). */
static struct partial_symtab *
-start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
+start_psymtab (struct objfile *objfile, const char *filename, CORE_ADDR textlow,
int ldsymoff, struct partial_symbol **global_syms,
struct partial_symbol **static_syms)
{
@@ -2057,15 +2059,15 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
if (pst->texthigh == 0 && last_function_name
&& gdbarch_sofun_address_maybe_missing (gdbarch))
{
- char *p;
int n;
struct bound_minimal_symbol minsym;
- p = strchr (last_function_name, ':');
- if (p == NULL)
- p = last_function_name;
- n = p - last_function_name;
- p = (char *) alloca (n + 2);
+ const char *colon = strchr (last_function_name, ':');
+ if (colon == NULL)
+ n = 0;
+ else
+ n = colon - last_function_name;
+ char *p = (char *) alloca (n + 2);
strncpy (p, last_function_name, n);
p[n] = 0;
@@ -2293,7 +2295,7 @@ dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
static void
read_ofile_symtab (struct objfile *objfile, struct partial_symtab *pst)
{
- char *namestring;
+ const char *namestring;
struct external_nlist *bufp;
struct internal_nlist nlist;
unsigned char type;
@@ -2499,7 +2501,7 @@ cp_set_block_scope (const struct symbol *symbol,
is used in end_symtab. */
void
-process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
+process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
const struct section_offsets *section_offsets,
struct objfile *objfile)
{
@@ -2805,7 +2807,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
down ONE MORE function call level, which we really don't want
to do). */
{
- char *p;
+ const char *p;
/* Normal object file and NLMs have non-zero text seg offsets,
but don't need their static syms offset in this fashion.
@@ -2898,7 +2900,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
if (name)
{
int deftype;
- char *colon_pos = strchr (name, ':');
+ const char *colon_pos = strchr (name, ':');
if (colon_pos == NULL)
deftype = '\0';
@@ -3021,7 +3023,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
definition. If a symbol reference is being defined, go ahead
and add it. Otherwise, just return. */
- char *s = name;
+ const char *s = name;
int refnum;
/* If this stab defines a new reference ID that is not on the
diff --git a/gdb/defs.h b/gdb/defs.h
index aa58605..f689ec5 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -309,7 +309,7 @@ typedef void initialize_file_ftype (void);
extern char *gdb_readline_wrapper (const char *);
-extern char *command_line_input (const char *, int, char *);
+extern char *command_line_input (const char *, int, const char *);
extern void print_prompt (void);
@@ -324,7 +324,8 @@ extern int info_verbose;
extern void set_next_address (struct gdbarch *, CORE_ADDR);
extern int print_address_symbolic (struct gdbarch *, CORE_ADDR,
- struct ui_file *, int, char *);
+ struct ui_file *, int,
+ const char *);
extern int build_address_symbolic (struct gdbarch *,
CORE_ADDR addr,
@@ -678,7 +679,7 @@ extern int (*deprecated_query_hook) (const char *, va_list)
extern void (*deprecated_warning_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
extern void (*deprecated_interactive_hook) (void);
-extern void (*deprecated_readline_begin_hook) (char *, ...)
+extern void (*deprecated_readline_begin_hook) (const char *, ...)
ATTRIBUTE_FPTR_PRINTF_1;
extern char *(*deprecated_readline_hook) (const char *);
extern void (*deprecated_readline_end_hook) (void);
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index aa20c42..966e1ee 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1825,7 +1825,7 @@ static const char *dwarf_attr_name (unsigned int);
static const char *dwarf_form_name (unsigned int);
-static char *dwarf_bool_name (unsigned int);
+static const char *dwarf_bool_name (unsigned int);
static const char *dwarf_type_encoding_name (unsigned int);
@@ -19800,7 +19800,7 @@ guess_full_die_structure_name (struct die_info *die, struct dwarf2_cu *cu)
prefix part in such case. See
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47510. */
-static char *
+static const char *
anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *attr;
@@ -19853,7 +19853,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
struct die_info *parent, *spec_die;
struct dwarf2_cu *spec_cu;
struct type *parent_type;
- char *retval;
+ const char *retval;
if (cu->language != language_cplus
&& cu->language != language_fortran && cu->language != language_d
@@ -20255,7 +20255,7 @@ dwarf_form_name (unsigned form)
return name;
}
-static char *
+static const char *
dwarf_bool_name (unsigned mybool)
{
if (mybool)
diff --git a/gdb/event-top.c b/gdb/event-top.c
index dd2770a..1281df8 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -650,7 +650,7 @@ command_line_append_input_line (struct buffer *cmd_line_buffer, char *rl)
char *
handle_line_of_input (struct buffer *cmd_line_buffer,
- char *rl, int repeat, char *annotation_suffix)
+ char *rl, int repeat, const char *annotation_suffix)
{
struct ui *ui = current_ui;
int from_tty = ui->instream == ui->stdin_stream;
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index b0f28d9..f9a80a0 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -221,8 +221,8 @@ catch_exceptions_with_msg (struct ui_out *func_uiout,
/* This function is superseded by catch_exceptions(). */
int
-catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
- return_mask mask)
+catch_errors (catch_errors_ftype *func, void *func_args,
+ const char *errstring, return_mask mask)
{
struct gdb_exception exception = exception_none;
volatile int val = 0;
diff --git a/gdb/exceptions.h b/gdb/exceptions.h
index cf7d0f0..b2cdee3 100644
--- a/gdb/exceptions.h
+++ b/gdb/exceptions.h
@@ -86,7 +86,8 @@ extern int catch_exceptions_with_msg (struct ui_out *uiout,
This function is superseded by catch_exceptions(). */
typedef int (catch_errors_ftype) (void *);
-extern int catch_errors (catch_errors_ftype *, void *, char *, return_mask);
+extern int catch_errors (catch_errors_ftype *, void *,
+ const char *, return_mask);
/* Compare two exception objects for print equality. */
extern int exception_print_same (struct gdb_exception e1,
diff --git a/gdb/expprint.c b/gdb/expprint.c
index b74d32c..9b8ac4c 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -62,7 +62,7 @@ print_subexp_standard (struct expression *exp, int *pos,
const struct op_print *op_print_tab;
int pc;
unsigned nargs;
- char *op_str;
+ const char *op_str;
int assign_modify = 0;
enum exp_opcode opcode;
enum precedence myprec = PREC_NULL;
@@ -649,7 +649,7 @@ print_subexp_standard (struct expression *exp, int *pos,
/* Return the operator corresponding to opcode OP as
a string. NULL indicates that the opcode was not found in the
current language table. */
-char *
+const char *
op_string (enum exp_opcode op)
{
int tem;
@@ -669,7 +669,7 @@ static int dump_subexp_body (struct expression *exp, struct ui_file *, int);
/* Name for OPCODE, when it appears in expression EXP. */
-char *
+const char *
op_name (struct expression *exp, enum exp_opcode opcode)
{
return exp->language_defn->la_exp_desc->op_name (opcode);
@@ -678,7 +678,7 @@ op_name (struct expression *exp, enum exp_opcode opcode)
/* Default name for the standard operator OPCODE (i.e., one defined in
the definition of enum exp_opcode). */
-char *
+const char *
op_name_standard (enum exp_opcode opcode)
{
switch (opcode)
@@ -703,10 +703,9 @@ op_name_standard (enum exp_opcode opcode)
void
dump_raw_expression (struct expression *exp, struct ui_file *stream,
- char *note)
+ const char *note)
{
int elt;
- char *opcode_name;
char *eltscan;
int eltsize;
@@ -722,9 +721,10 @@ dump_raw_expression (struct expression *exp, struct ui_file *stream,
for (elt = 0; elt < exp->nelts; elt++)
{
fprintf_filtered (stream, "\t%5d ", elt);
- opcode_name = op_name (exp, exp->elts[elt].opcode);
+ const char *opcode_name = op_name (exp, exp->elts[elt].opcode);
fprintf_filtered (stream, "%20s ", opcode_name);
+
print_longest (stream, 'd', 0, exp->elts[elt].longconst);
fprintf_filtered (stream, " ");
diff --git a/gdb/expression.h b/gdb/expression.h
index e4e96f6..8fe6b07 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -146,12 +146,12 @@ extern struct value *evaluate_subexp_standard
extern void print_expression (struct expression *, struct ui_file *);
-extern char *op_name (struct expression *exp, enum exp_opcode opcode);
+extern const char *op_name (struct expression *exp, enum exp_opcode opcode);
-extern char *op_string (enum exp_opcode);
+extern const char *op_string (enum exp_opcode);
extern void dump_raw_expression (struct expression *,
- struct ui_file *, char *);
+ struct ui_file *, const char *);
extern void dump_prefix_expression (struct expression *, struct ui_file *);
/* In an OP_RANGE expression, either bound could be empty, indicating
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 49d797d..7e9e234 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -72,7 +72,7 @@ int yyparse (void);
static int yylex (void);
-void yyerror (char *);
+void yyerror (const char *);
static void growbuf_by_size (int);
@@ -773,7 +773,7 @@ parse_number (struct parser_state *par_state,
struct token
{
- char *oper;
+ const char *oper;
int token;
enum exp_opcode opcode;
};
@@ -807,7 +807,7 @@ static const struct token dot_ops[] =
struct f77_boolean_val
{
- char *name;
+ const char *name;
int value;
};
@@ -1219,7 +1219,7 @@ f_parse (struct parser_state *par_state)
}
void
-yyerror (char *msg)
+yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index 08a5f25..5633b41 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -25,7 +25,7 @@ struct parser_state;
extern int f_parse (struct parser_state *);
-extern void f_yyerror (char *); /* Defined in f-exp.y */
+extern void f_yyerror (const char *); /* Defined in f-exp.y */
extern void f_print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *);
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index dc2a314..04d2cdf 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -292,7 +292,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
<args>". */
argv = (char **) alloca (4 * sizeof (char *));
argv[0] = shell_file;
- argv[1] = "-c";
+ argv[1] = (char *) "-c";
argv[2] = shell_command;
argv[3] = (char *) 0;
}
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 87124e7..8744733 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -87,7 +87,7 @@ struct gdbarch_tdep
int num_hw_breakpoints;
/* Register names. */
- char **register_names;
+ const char **register_names;
};
/* Return the FR-V ABI associated with GDBARCH. */
@@ -147,8 +147,8 @@ new_variant (void)
/* By default, don't supply any general-purpose or floating-point
register names. */
var->register_names
- = (char **) xmalloc ((frv_num_regs + frv_num_pseudo_regs)
- * sizeof (char *));
+ = (const char **) xmalloc ((frv_num_regs + frv_num_pseudo_regs)
+ * sizeof (const char *));
for (r = 0; r < frv_num_regs + frv_num_pseudo_regs; r++)
var->register_names[r] = "";
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 6debb10..319a890 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -84,7 +84,7 @@ pstring (const char *string)
return string;
}
-static char *
+static const char *
pstring_ptr (char **string)
{
if (string == NULL || *string == NULL)
@@ -95,7 +95,7 @@ pstring_ptr (char **string)
/* Helper function to print a list of strings, represented as "const
char *const *". The list is printed comma-separated. */
-static char *
+static const char *
pstring_list (const char *const *list)
{
static char ret[100];
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index c471b73..bdfb6b2 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1678,7 +1678,7 @@ pstring (const char *string)
return string;
}
-static char *
+static const char *
pstring_ptr (char **string)
{
if (string == NULL || *string == NULL)
@@ -1689,7 +1689,7 @@ pstring_ptr (char **string)
/* Helper function to print a list of strings, represented as "const
char *const *". The list is printed comma-separated. */
-static char *
+static const char *
pstring_list (const char *const *list)
{
static char ret[100];
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
index 12ce466..40ae37c 100644
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -167,7 +167,7 @@ extern void validate_files (void);
extern char *gnutarget;
-extern void set_gnutarget (char *);
+extern void set_gnutarget (const char *);
/* Structure to keep track of core register reading functions for
various core file types. */
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 0bfe2ec..a09006a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,10 @@
2017-04-05 Pedro Alves <palves@redhat.com>
+ * gdbreplay.c (sync_error): Constify.
+ * linux-x86-low.c (push_opcode): Constify.
+
+2017-04-05 Pedro Alves <palves@redhat.com>
+
* win32-low.c (get_child_debug_event)
<CREATE_PROCESS_DEBUG_EVENT>: Don't report TARGET_WAITKIND_EXECD.
Report TARGET_WAITKIND_SPURIOUS instead.
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 3bd9f3f..b768506 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -142,7 +142,7 @@ perror_with_name (const char *string)
}
static void
-sync_error (FILE *fp, char *desc, int expect, int got)
+sync_error (FILE *fp, const char *desc, int expect, int got)
{
fprintf (stderr, "\n%s\n", desc);
fprintf (stderr, "At logfile offset %ld, expected '0x%x' got '0x%x'\n",
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 6df1d51..b39026c 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -1067,7 +1067,7 @@ append_insns (CORE_ADDR *to, size_t len, const unsigned char *buf)
}
static int
-push_opcode (unsigned char *buf, char *op)
+push_opcode (unsigned char *buf, const char *op)
{
unsigned char *buf_org = buf;
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index c4d0d2b..1906e68 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -81,7 +81,7 @@ int yyparse (void);
static int yylex (void);
-void yyerror (char *);
+void yyerror (const char *);
%}
@@ -936,7 +936,7 @@ parse_string_or_char (const char *tokptr, const char **outptr,
struct token
{
- char *oper;
+ const char *oper;
int token;
enum exp_opcode opcode;
};
@@ -1588,7 +1588,7 @@ go_parse (struct parser_state *par_state)
}
void
-yyerror (char *msg)
+yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
diff --git a/gdb/go-lang.h b/gdb/go-lang.h
index 101cf9d..e08b2f0 100644
--- a/gdb/go-lang.h
+++ b/gdb/go-lang.h
@@ -60,7 +60,7 @@ enum go_type
extern int go_parse (struct parser_state *);
-extern void go_yyerror (char *);
+extern void go_yyerror (const char *);
/* Defined in go-lang.c. */
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index d2d8d7a..a20067e 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -1126,7 +1126,7 @@ go32_sysinfo (char *arg, int from_tty)
/* CPUID with EAX = 1 returns processor signature and features. */
if (cpuid_max >= 1)
{
- static char *brand_name[] = {
+ static const char *brand_name[] = {
"",
" Celeron",
" III",
diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c
index 71cffbb..9189446 100644
--- a/gdb/guile/scm-breakpoint.c
+++ b/gdb/guile/scm-breakpoint.c
@@ -851,7 +851,6 @@ gdbscm_breakpoint_expression (SCM self)
{
breakpoint_smob *bp_smob
= bpscm_get_valid_breakpoint_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
- char *str;
struct watchpoint *wp;
if (!is_watchpoint (bp_smob->bp))
@@ -859,7 +858,7 @@ gdbscm_breakpoint_expression (SCM self)
wp = (struct watchpoint *) bp_smob->bp;
- str = wp->exp_string;
+ const char *str = wp->exp_string;
if (! str)
str = "";
diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c
index 5f6d442..ae5d145 100644
--- a/gdb/guile/scm-cmd.c
+++ b/gdb/guile/scm-cmd.c
@@ -291,8 +291,10 @@ cmdscm_destroyer (struct cmd_list_element *self, void *context)
/* Called by gdb to invoke the command. */
static void
-cmdscm_function (struct cmd_list_element *command, char *args, int from_tty)
+cmdscm_function (struct cmd_list_element *command,
+ char *args_entry, int from_tty)
{
+ const char *args = args_entry;
command_smob *c_smob/*obj*/ = (command_smob *) get_cmd_context (command);
SCM arg_scm, tty_scm, result;
diff --git a/gdb/guile/scm-param.c b/gdb/guile/scm-param.c
index 6d2cc13..ab00fd9 100644
--- a/gdb/guile/scm-param.c
+++ b/gdb/guile/scm-param.c
@@ -602,7 +602,7 @@ pascm_param_value (enum var_types type, void *var,
case var_filename:
case var_enum:
{
- char *str = * (char **) var;
+ const char *str = *(char **) var;
if (str == NULL)
str = "";
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 10ef796..060e5d3 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -954,7 +954,7 @@ h8300_register_name (struct gdbarch *gdbarch, int regno)
{
/* The register names change depending on which h8300 processor
type is selected. */
- static char *register_names[] = {
+ static const char *register_names[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6",
"sp", "", "pc", "cycles", "tick", "inst",
"ccr", /* pseudo register */
@@ -971,7 +971,7 @@ h8300_register_name (struct gdbarch *gdbarch, int regno)
static const char *
h8300s_register_name (struct gdbarch *gdbarch, int regno)
{
- static char *register_names[] = {
+ static const char *register_names[] = {
"er0", "er1", "er2", "er3", "er4", "er5", "er6",
"sp", "", "pc", "cycles", "", "tick", "inst",
"mach", "macl",
@@ -989,7 +989,7 @@ h8300s_register_name (struct gdbarch *gdbarch, int regno)
static const char *
h8300sx_register_name (struct gdbarch *gdbarch, int regno)
{
- static char *register_names[] = {
+ static const char *register_names[] = {
"er0", "er1", "er2", "er3", "er4", "er5", "er6",
"sp", "", "pc", "cycles", "", "tick", "inst",
"mach", "macl", "sbr", "vbr",
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index a5053c6..2636a27 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -613,7 +613,7 @@ typedef BP_MANIPULATION (hppa_break_insn) hppa_breakpoint;
static const char *
hppa32_register_name (struct gdbarch *gdbarch, int i)
{
- static char *names[] = {
+ static const char *names[] = {
"flags", "r1", "rp", "r3",
"r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11",
@@ -656,7 +656,7 @@ hppa32_register_name (struct gdbarch *gdbarch, int i)
static const char *
hppa64_register_name (struct gdbarch *gdbarch, int i)
{
- static char *names[] = {
+ static const char *names[] = {
"flags", "r1", "rp", "r3",
"r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11",
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 4c53bc6..22e1588 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -140,7 +140,7 @@ enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS,
/* Array of register names; There should be ia64_num_regs strings in
the initializer. */
-static char *ia64_register_names[] =
+static const char *ia64_register_names[] =
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index d41e609..f6ffb9b 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -261,14 +261,14 @@ construct_inferior_arguments (int argc, char **argv)
#ifdef __MINGW32__
/* This holds all the characters considered special to the
Windows shells. */
- char *special = "\"!&*|[]{}<>?`~^=;, \t\n";
- const char quote = '"';
+ static const char special[] = "\"!&*|[]{}<>?`~^=;, \t\n";
+ static const char quote = '"';
#else
/* This holds all the characters considered special to the
typical Unix shells. We include `^' because the SunOS
/bin/sh treats it as a synonym for `|'. */
- char *special = "\"!#$&*()\\|[]{}<>?'`~^; \t\n";
- const char quote = '\'';
+ static const char special[] = "\"!#$&*()\\|[]{}<>?'`~^; \t\n";
+ static const char quote = '\'';
#endif
int i;
int length = 0;
@@ -2267,7 +2267,7 @@ static void
path_command (char *dirname, int from_tty)
{
char *exec_path;
- char *env;
+ const char *env;
dont_repeat ();
env = get_in_environ (current_inferior ()->environment, path_var_name);
@@ -2681,7 +2681,7 @@ enum attach_post_wait_mode
should be running. Else if ATTACH, */
static void
-attach_post_wait (char *args, int from_tty, enum attach_post_wait_mode mode)
+attach_post_wait (const char *args, int from_tty, enum attach_post_wait_mode mode)
{
struct inferior *inferior;
diff --git a/gdb/language.c b/gdb/language.c
index f1fc220..ee0101d 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -46,7 +46,7 @@
extern void _initialize_language (void);
-static void unk_lang_error (char *);
+static void unk_lang_error (const char *);
static int unk_lang_parser (struct parser_state *);
@@ -206,7 +206,7 @@ show_range_command (struct ui_file *file, int from_tty,
{
if (range_mode == range_mode_auto)
{
- char *tmp;
+ const char *tmp;
switch (range_check)
{
@@ -280,7 +280,7 @@ show_case_command (struct ui_file *file, int from_tty,
{
if (case_mode == case_mode_auto)
{
- char *tmp = NULL;
+ const char *tmp = NULL;
switch (case_sensitivity)
{
@@ -731,7 +731,7 @@ unk_lang_parser (struct parser_state *ps)
}
static void
-unk_lang_error (char *msg)
+unk_lang_error (const char *msg)
{
error (_("Attempted to parse an expression with unknown language"));
}
diff --git a/gdb/language.h b/gdb/language.h
index 96080ac..58bcbe8 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -183,7 +183,7 @@ struct language_defn
/* Parser error function. */
- void (*la_error) (char *);
+ void (*la_error) (const char *);
/* Given an expression *EXPP created by prefixifying the result of
la_parser, perform any remaining processing necessary to complete
@@ -271,7 +271,7 @@ struct language_defn
/* If this is non-NULL, specifies the name that of the implicit
local variable that refers to the current object instance. */
- char *la_name_of_this;
+ const char *la_name_of_this;
/* This is a function that lookup_symbol will call when it gets to
the part of symbol lookup where C looks up static and global
diff --git a/gdb/linespec.c b/gdb/linespec.c
index a3cb0cb..dcbe253 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1293,7 +1293,8 @@ decode_line_2 (struct linespec_state *self,
struct symtabs_and_lines *result,
const char *select_mode)
{
- char *args, *prompt;
+ char *args;
+ const char *prompt;
int i;
struct cleanup *old_chain;
VEC (const_char_ptr) *filters = NULL;
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 0e2607b..eda3d7b 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -262,7 +262,7 @@ struct private_thread_info
};
-static char *
+static const char *
thread_db_err_str (td_err_e err)
{
static char buf[64];
diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
index 3cd9338..bd3e182 100644
--- a/gdb/lm32-tdep.c
+++ b/gdb/lm32-tdep.c
@@ -91,7 +91,7 @@ lm32_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
static const char *
lm32_register_name (struct gdbarch *gdbarch, int reg_nr)
{
- static char *register_names[] = {
+ static const char *register_names[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index acf2e1b..9179187 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -65,7 +65,7 @@ int yyparse (void);
static int yylex (void);
-void yyerror (char *);
+void yyerror (const char *);
static int parse_number (int);
@@ -1050,7 +1050,7 @@ m2_parse (struct parser_state *par_state)
}
void
-yyerror (char *msg)
+yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h
index 6f73394..30fddd7 100644
--- a/gdb/m2-lang.h
+++ b/gdb/m2-lang.h
@@ -22,7 +22,7 @@ struct parser_state;
extern int m2_parse (struct parser_state *); /* Defined in m2-exp.y */
-extern void m2_yyerror (char *); /* Defined in m2-exp.y */
+extern void m2_yyerror (const char *); /* Defined in m2-exp.y */
/* Defined in m2-typeprint.c */
extern void m2_print_type (struct type *, const char *, struct ui_file *, int,
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 40f29d3..1d0d7ed 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -202,7 +202,7 @@ m32r_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
}
}
-char *m32r_register_names[] = {
+static const char *m32r_register_names[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "fp", "lr", "sp",
"psw", "cbr", "spi", "spu", "bpc", "pc", "accl", "acch",
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index d06598f..893d9c2 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -166,7 +166,7 @@ struct m68hc11_unwind_cache
/* Table of registers for 68HC11. This includes the hard registers
and the soft registers used by GCC. */
-static char *
+static const char *
m68hc11_register_names[] =
{
"x", "d", "y", "sp", "pc", "a", "b",
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
index 6ae9590..57fe644 100644
--- a/gdb/m88k-tdep.c
+++ b/gdb/m88k-tdep.c
@@ -49,7 +49,7 @@ m88k_fetch_instruction (CORE_ADDR pc, enum bfd_endian byte_order)
static const char *
m88k_register_name (struct gdbarch *gdbarch, int regnum)
{
- static char *register_names[] =
+ static const char *register_names[] =
{
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index 5537d9d..e7a0dad 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -170,7 +170,7 @@ appendc (struct macro_buffer *b, int c)
/* Append the LEN bytes at ADDR to the buffer B. */
static void
-appendmem (struct macro_buffer *b, char *addr, int len)
+appendmem (struct macro_buffer *b, const char *addr, int len)
{
int new_len = b->len + len;
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 952dffb..8e27194 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -220,7 +220,7 @@ static int found_ecoff_debugging_info;
/* Forward declarations. */
static int upgrade_type (int, struct type **, int, union aux_ext *,
- int, char *);
+ int, const char *);
static void parse_partial_symbols (minimal_symbol_reader &,
struct objfile *);
@@ -228,9 +228,9 @@ static void parse_partial_symbols (minimal_symbol_reader &,
static int has_opaque_xref (FDR *, SYMR *);
static int cross_ref (int, union aux_ext *, struct type **, enum type_code,
- char **, int, char *);
+ const char **, int, const char *);
-static struct symbol *new_symbol (char *);
+static struct symbol *new_symbol (const char *);
static struct type *new_type (char *);
@@ -245,14 +245,14 @@ static struct linetable *new_linetable (int);
static struct blockvector *new_bvect (int);
static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
- int, char *);
+ int, const char *);
-static struct symbol *mylookup_symbol (char *, const struct block *,
+static struct symbol *mylookup_symbol (const char *, const struct block *,
domain_enum, enum address_class);
static void sort_blocks (struct symtab *);
-static struct partial_symtab *new_psymtab (char *, struct objfile *);
+static struct partial_symtab *new_psymtab (const char *, struct objfile *);
static void psymtab_to_symtab_1 (struct objfile *objfile,
struct partial_symtab *, const char *);
@@ -268,7 +268,7 @@ static struct linetable *shrink_linetable (struct linetable *);
static void handle_psymbol_enumerators (struct objfile *, FDR *, int,
CORE_ADDR);
-static char *mdebug_next_symbol_text (struct objfile *);
+static const char *mdebug_next_symbol_text (struct objfile *);
/* Exported procedure: Builds a symtab from the partial symtab SELF.
Restores the environment in effect when SELF was created, delegates
@@ -322,7 +322,7 @@ get_rfd (int cf, int rf)
/* Return a safer print NAME for a file descriptor. */
-static char *
+static const char *
fdr_name (FDR *f)
{
if (f->rss == -1)
@@ -574,7 +574,7 @@ static int mdebug_regparm_index;
static void
add_data_symbol (SYMR *sh, union aux_ext *ax, int bigend,
struct symbol *s, int aclass_index, struct block *b,
- struct objfile *objfile, char *name)
+ struct objfile *objfile, const char *name)
{
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_ACLASS_INDEX (s) = aclass_index;
@@ -596,7 +596,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
- char *name;
+ const char *name;
struct symbol *s;
struct block *b;
struct mdebug_pending *pend;
@@ -1530,7 +1530,7 @@ basic_type (int bt, struct objfile *objfile)
static struct type *
parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
- int bigend, char *sym_name)
+ int bigend, const char *sym_name)
{
TIR t[1];
struct type *tp = 0;
@@ -1658,7 +1658,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
name. This apparently is a MIPS extension for C sets. */
t->bt == btSet)
{
- char *name;
+ const char *name;
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
@@ -1718,7 +1718,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
FIXME: We are not doing any guessing on range types. */
if (t->bt == btRange)
{
- char *name;
+ const char *name;
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
@@ -1751,7 +1751,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
}
if (t->bt == btTypedef)
{
- char *name;
+ const char *name;
/* Try to cross reference this type, it should succeed. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
@@ -1819,7 +1819,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
static int
upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
- char *sym_name)
+ const char *sym_name)
{
int off;
struct type *t;
@@ -2110,7 +2110,7 @@ parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
/* Reading .o files */
if (SC_IS_UNDEF (es->asym.sc) || es->asym.sc == scNil)
{
- char *what;
+ const char *what;
switch (es->asym.st)
{
case stNil:
@@ -2851,7 +2851,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
switch (type_code)
{
- char *p;
+ const char *p;
/* Standard, external, non-debugger, symbols. */
@@ -3205,7 +3205,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
Accept either. */
while (*p && *p != ';' && *p != ',')
{
- char *q;
+ const char *q;
/* Check for and handle cretinous dbx
symbol name continuation! */
@@ -3887,7 +3887,7 @@ handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
/* Get the next symbol. OBJFILE is unused. */
-static char *
+static const char *
mdebug_next_symbol_text (struct objfile *objfile)
{
SYMR sh;
@@ -4360,7 +4360,7 @@ static int
cross_ref (int fd, union aux_ext *ax, struct type **tpp,
enum type_code type_code,
/* Use to alloc new type if none is found. */
- char **pname, int bigend, char *sym_name)
+ const char **pname, int bigend, const char *sym_name)
{
RNDXR rn[1];
unsigned int rf;
@@ -4556,7 +4556,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
keeping the symtab sorted. */
static struct symbol *
-mylookup_symbol (char *name, const struct block *block,
+mylookup_symbol (const char *name, const struct block *block,
domain_enum domain, enum address_class theclass)
{
struct block_iterator iter;
@@ -4742,7 +4742,7 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile)
/* Allocate a new partial_symtab NAME. */
static struct partial_symtab *
-new_psymtab (char *name, struct objfile *objfile)
+new_psymtab (const char *name, struct objfile *objfile)
{
struct partial_symtab *psymtab;
@@ -4836,7 +4836,7 @@ new_block (enum block_type type)
/* Create a new symbol with printname NAME. */
static struct symbol *
-new_symbol (char *name)
+new_symbol (const char *name)
{
struct symbol *s = allocate_symbol (mdebugread_objfile);
diff --git a/gdb/memattr.c b/gdb/memattr.c
index e01e2c8..2493537 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -441,7 +441,7 @@ mem_info_command (char *args, int from_tty)
for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
{
- char *tmp;
+ const char *tmp;
printf_filtered ("%-3d %-3c\t",
m->number,
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index b1dcc86..5a45d6e 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -305,7 +305,7 @@ register_set_keyword_table (const CGEN_HW_ENTRY *hw)
/* Given a keyword table KEYWORD and a register number REGNUM, return
the name of the register, or "" if KEYWORD contains no register
whose number is REGNUM. */
-static char *
+static const char *
register_name_from_keyword (CGEN_KEYWORD *keyword_table, int regnum)
{
const CGEN_KEYWORD_ENTRY *entry
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index a6347ee..4093178 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -116,7 +116,7 @@ mi_cmd_env_path (const char *command, char **argv, int argc)
{
struct ui_out *uiout = current_uiout;
char *exec_path;
- char *env;
+ const char *env;
int reset = 0;
int oind = 0;
int i;
@@ -271,7 +271,7 @@ void
_initialize_mi_cmd_env (void)
{
struct gdb_environ *environment;
- char *env;
+ const char *env;
/* We want original execution path to reset to, if desired later.
At this point, current inferior is not created, so cannot use
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index bb56205..bd91033 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -578,7 +578,7 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
struct block_iterator iter;
struct cleanup *cleanup_list;
struct type *type;
- char *name_of_result;
+ const char *name_of_result;
struct ui_out *uiout = current_uiout;
block = get_frame_block (fi, 0);
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 430c07b..78ef8e0 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -492,7 +492,7 @@ mi_cmd_var_show_attributes (const char *command, char **argv, int argc)
{
struct ui_out *uiout = current_uiout;
int attr;
- char *attstr;
+ const char *attstr;
struct varobj *var;
if (argc != 1)
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 9a87657..91fe104 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -89,7 +89,7 @@ static void mi_cmd_execute (struct mi_parse *parse);
static void mi_execute_cli_command (const char *cmd, int args_p,
const char *args);
-static void mi_execute_async_cli_command (char *cli_command,
+static void mi_execute_async_cli_command (const char *cli_command,
char **argv, int argc);
static int register_changed_p (int regnum, struct regcache *,
struct regcache *);
@@ -2031,7 +2031,7 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context)
/* Echo the command on the console. */
fprintf_unfiltered (gdb_stdlog, "%s\n", context->command);
/* Call the "console" interpreter. */
- argv[0] = INTERP_CONSOLE;
+ argv[0] = (char *) INTERP_CONSOLE;
argv[1] = context->command;
mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2);
@@ -2344,7 +2344,7 @@ mi_execute_cli_command (const char *cmd, int args_p, const char *args)
}
void
-mi_execute_async_cli_command (char *cli_command, char **argv, int argc)
+mi_execute_async_cli_command (const char *cli_command, char **argv, int argc)
{
struct cleanup *old_cleanups;
char *run;
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 41cb9d8..45d1d73 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -608,7 +608,7 @@ mips_register_name (struct gdbarch *gdbarch, int regno)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* GPR names for all ABIs other than n32/n64. */
- static char *mips_gpr_names[] = {
+ static const char *mips_gpr_names[] = {
"zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
@@ -616,7 +616,7 @@ mips_register_name (struct gdbarch *gdbarch, int regno)
};
/* GPR names for n32 and n64 ABIs. */
- static char *mips_n32_n64_gpr_names[] = {
+ static const char *mips_n32_n64_gpr_names[] = {
"zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
"a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
@@ -6880,7 +6880,7 @@ set_mips_command (char *args, int from_tty)
static void
show_mipsfpu_command (char *args, int from_tty)
{
- char *fpu;
+ const char *fpu;
if (gdbarch_bfd_arch_info (target_gdbarch ())->arch != bfd_arch_mips)
{
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 38356e5..0f5e10f 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -246,8 +246,8 @@ mn10300_return_value (struct gdbarch *gdbarch, struct value *function,
return RETURN_VALUE_REGISTER_CONVENTION;
}
-static char *
-register_name (int reg, char **regs, long sizeof_regs)
+static const char *
+register_name (int reg, const char **regs, long sizeof_regs)
{
if (reg < 0 || reg >= sizeof_regs / sizeof (regs[0]))
return NULL;
@@ -258,7 +258,7 @@ register_name (int reg, char **regs, long sizeof_regs)
static const char *
mn10300_generic_register_name (struct gdbarch *gdbarch, int reg)
{
- static char *regs[] =
+ static const char *regs[] =
{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
"sp", "pc", "mdr", "psw", "lir", "lar", "", "",
"", "", "", "", "", "", "", "",
@@ -271,7 +271,7 @@ mn10300_generic_register_name (struct gdbarch *gdbarch, int reg)
static const char *
am33_register_name (struct gdbarch *gdbarch, int reg)
{
- static char *regs[] =
+ static const char *regs[] =
{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
"sp", "pc", "mdr", "psw", "lir", "lar", "",
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
@@ -283,7 +283,7 @@ am33_register_name (struct gdbarch *gdbarch, int reg)
static const char *
am33_2_register_name (struct gdbarch *gdbarch, int reg)
{
- static char *regs[] =
+ static const char *regs[] =
{
"d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
"sp", "pc", "mdr", "psw", "lir", "lar", "mdrq", "r0",
diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c
index 7383f27..d0f4223 100644
--- a/gdb/moxie-tdep.c
+++ b/gdb/moxie-tdep.c
@@ -74,7 +74,7 @@ typedef BP_MANIPULATION (moxie_break_insn) moxie_breakpoint;
/* Moxie register names. */
-char *moxie_register_names[] = {
+static const char *moxie_register_names[] = {
"$fp", "$sp", "$r0", "$r1", "$r2",
"$r3", "$r4", "$r5", "$r6", "$r7",
"$r8", "$r9", "$r10", "$r11", "$r12",
diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
index 2417a46..ba2e5a5 100644
--- a/gdb/nat/linux-osdata.c
+++ b/gdb/nat/linux-osdata.c
@@ -1627,9 +1627,9 @@ linux_xfer_osdata_modules (gdb_byte *readbuf,
}
struct osdata_type {
- char *type;
- char *title;
- char *description;
+ const char *type;
+ const char *title;
+ const char *description;
LONGEST (*getter) (gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
} osdata_table[] = {
{ "cpus", "CPUs", "Listing of all cpus/cores on the system",
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 04ad06c..8f8d1d5 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -190,7 +190,7 @@ nto_parse_redirection (char *pargv[], const char **pin, const char **pout,
const char **perr)
{
char **argv;
- char *in, *out, *err, *p;
+ const char *in, *out, *err, *p;
int argc, i, n;
for (n = 0; pargv[n]; n++);
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index ad7c64e..e102b80 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -81,7 +81,7 @@ static const struct objfile_data *objc_objfile_data;
suitably defined. */
struct symbol *
-lookup_struct_typedef (char *name, const struct block *block, int noerr)
+lookup_struct_typedef (const char *name, const struct block *block, int noerr)
{
struct symbol *sym;
@@ -106,7 +106,7 @@ lookup_struct_typedef (char *name, const struct block *block, int noerr)
}
CORE_ADDR
-lookup_objc_class (struct gdbarch *gdbarch, char *classname)
+lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
{
struct type *char_type = builtin_type (gdbarch)->builtin_char;
struct value * function, *classval;
@@ -135,7 +135,7 @@ lookup_objc_class (struct gdbarch *gdbarch, char *classname)
}
CORE_ADDR
-lookup_child_selector (struct gdbarch *gdbarch, char *selname)
+lookup_child_selector (struct gdbarch *gdbarch, const char *selname)
{
struct type *char_type = builtin_type (gdbarch)->builtin_char;
struct value * function, *selstring;
@@ -1233,7 +1233,7 @@ print_object_command (char *args, int from_tty)
*/
struct objc_methcall {
- char *name;
+ const char *name;
/* Return instance method to be called. */
int (*stop_at) (CORE_ADDR, CORE_ADDR *);
/* Start of pc range corresponding to method invocation. */
diff --git a/gdb/objc-lang.h b/gdb/objc-lang.h
index 49e6878..e22b198 100644
--- a/gdb/objc-lang.h
+++ b/gdb/objc-lang.h
@@ -29,9 +29,9 @@ struct block;
struct parser_state;
extern CORE_ADDR lookup_objc_class (struct gdbarch *gdbarch,
- char *classname);
+ const char *classname);
extern CORE_ADDR lookup_child_selector (struct gdbarch *gdbarch,
- char *methodname);
+ const char *methodname);
extern char *objc_demangle (const char *mangled, int options);
@@ -48,7 +48,8 @@ extern void start_msglist (void);
extern void add_msglist (struct stoken *str, int addcolon);
extern int end_msglist (struct parser_state *);
-struct symbol *lookup_struct_typedef (char *name, const struct block *block,
+struct symbol *lookup_struct_typedef (const char *name,
+ const struct block *block,
int noerr);
#endif
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 758fa86..9500b1c 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1469,7 +1469,7 @@ find_pc_section (CORE_ADDR pc)
/* Return non-zero if PC is in a section called NAME. */
int
-pc_in_section (CORE_ADDR pc, char *name)
+pc_in_section (CORE_ADDR pc, const char *name)
{
struct obj_section *s;
int retval = 0;
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index f719d30..58db6c9 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -514,7 +514,7 @@ extern int have_minimal_symbols (void);
extern struct obj_section *find_pc_section (CORE_ADDR pc);
/* R[...]
[diff truncated at 100000 bytes]