From 58da9bdea03d5b96943696b6c7e69bef6ef419cc Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 13 Oct 2014 21:45:40 +0100 Subject: Make GDB build with both g++ and gcc, on x86_64 Fedora 20 --- gdb/ada-lang.c | 2 +- gdb/ada-typeprint.c | 8 +- gdb/amd64-linux-nat.c | 11 ++- gdb/breakpoint.h | 40 ++++---- gdb/c-varobj.c | 6 +- gdb/cli/cli-setshow.c | 2 +- gdb/common/gdb_vecs.c | 3 +- gdb/common/linux-ptrace.c | 2 +- gdb/cp-valprint.c | 2 +- gdb/dcache.h | 2 + gdb/defs.h | 10 +- gdb/doublest.h | 8 ++ gdb/dwarf2read.c | 6 +- gdb/exceptions.c | 6 +- gdb/exceptions.h | 28 ++++++ gdb/extension-priv.h | 2 +- gdb/extension.c | 2 +- gdb/features/feature_to_c.sh | 8 +- gdb/gdbarch.c | 208 +++++++++++++++++++++--------------------- gdb/gdbarch.h | 2 + gdb/gdbarch.sh | 6 +- gdb/gdbserver/i386-low.c | 4 +- gdb/gdbserver/inferiors.h | 2 +- gdb/gdbserver/linux-low.c | 20 ++-- gdb/gdbserver/linux-x86-low.c | 22 +++-- gdb/gdbserver/server.h | 8 ++ gdb/gdbserver/thread-db.c | 46 +++++----- gdb/gdbserver/tracepoint.c | 2 +- gdb/gnu-v3-abi.c | 2 +- gdb/go-lang.c | 4 +- gdb/guile/guile.c | 2 +- gdb/i386-tdep.h | 2 +- gdb/inferior.h | 14 +-- gdb/inflow.c | 20 ++-- gdb/jv-typeprint.c | 3 +- gdb/linux-nat.c | 10 ++ gdb/linux-tdep.c | 10 ++ gdb/linux-thread-db.c | 2 +- gdb/maint.c | 10 +- gdb/psymtab.c | 2 +- gdb/python/python-internal.h | 1 + gdb/python/python.c | 10 +- gdb/ser-tcp.c | 2 +- gdb/stabsread.c | 2 +- gdb/symfile-debug.c | 14 +-- gdb/symfile.c | 2 +- gdb/symtab.c | 4 +- gdb/target.h | 19 ++-- gdb/tui/tui-io.c | 20 ++-- gdb/tui/tui-regs.c | 2 +- include/libiberty.h | 14 ++- 51 files changed, 380 insertions(+), 259 deletions(-) mode change 100644 => 100755 gdb/features/feature_to_c.sh diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index afe68c27fd4..673380d9e95 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -8979,7 +8979,7 @@ ada_enum_name (const char *name) { static char *result; static size_t result_len = 0; - char *tmp; + const char *tmp; /* First, unqualify the enumeration name: 1. Search for the last '.' character. If we find one, then skip diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 4e6239713ed..71ac4d3a504 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -182,7 +182,7 @@ print_range (struct type *type, struct ui_file *stream, set *N past the bound and its delimiter, if any. */ static void -print_range_bound (struct type *type, char *bounds, int *n, +print_range_bound (struct type *type, const char *bounds, int *n, struct ui_file *stream) { LONGEST B; @@ -209,8 +209,8 @@ print_range_bound (struct type *type, char *bounds, int *n, else { int bound_len; - char *bound = bounds + *n; - char *pend; + const char *bound = bounds + *n; + const char *pend; pend = strstr (bound, "__"); if (pend == NULL) @@ -279,7 +279,7 @@ print_range_type (struct type *raw_type, struct ui_file *stream, else { int prefix_len = subtype_info - name; - char *bounds_str; + const char *bounds_str; int n; subtype_info += 5; diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index fa4afebbee1..545910dd0a3 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -286,14 +286,16 @@ amd64_linux_dr_get (ptid_t ptid, int regnum) { int tid; unsigned long value; + int offset; tid = ptid_get_lwp (ptid); if (tid == 0) tid = ptid_get_pid (ptid); errno = 0; - value = ptrace (PTRACE_PEEKUSER, tid, - offsetof (struct user, u_debugreg[regnum]), 0); + + offset = offsetof (struct user, u_debugreg) + sizeof (((struct user *)0)->u_debugreg[0]) * regnum; + value = ptrace (PTRACE_PEEKUSER, tid, offset, 0); if (errno != 0) perror_with_name (_("Couldn't read debug register")); @@ -306,14 +308,15 @@ static void amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) { int tid; + int offset; tid = ptid_get_lwp (ptid); if (tid == 0) tid = ptid_get_pid (ptid); errno = 0; - ptrace (PTRACE_POKEUSER, tid, - offsetof (struct user, u_debugreg[regnum]), value); + offset = offsetof (struct user, u_debugreg) + sizeof (((struct user *)0)->u_debugreg[0]) * regnum; + ptrace (PTRACE_POKEUSER, tid, offset, value); if (errno != 0) perror_with_name (_("Couldn't write debug register")); } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index d8e88fc26b2..0488b762dc1 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -472,6 +472,26 @@ struct bp_location struct symtab *symtab; }; +/* The possible return values for print_bpstat, print_it_normal, + print_it_done, print_it_noop. */ +enum print_stop_action + { + /* We printed nothing or we need to do some more analysis. */ + PRINT_UNKNOWN = -1, + + /* We printed something, and we *do* desire that something to be + followed by a location. */ + PRINT_SRC_AND_LOC, + + /* We printed something, and we do *not* desire that something to + be followed by a location. */ + PRINT_SRC_ONLY, + + /* We already printed all we needed to print, don't print anything + else. */ + PRINT_NOTHING + }; + /* This structure is a collection of function pointers that, if available, will be called instead of the performing the default action for this bptype. */ @@ -962,26 +982,6 @@ struct bpstat_what int is_longjmp; }; -/* The possible return values for print_bpstat, print_it_normal, - print_it_done, print_it_noop. */ -enum print_stop_action - { - /* We printed nothing or we need to do some more analysis. */ - PRINT_UNKNOWN = -1, - - /* We printed something, and we *do* desire that something to be - followed by a location. */ - PRINT_SRC_AND_LOC, - - /* We printed something, and we do *not* desire that something to - be followed by a location. */ - PRINT_SRC_ONLY, - - /* We already printed all we needed to print, don't print anything - else. */ - PRINT_NOTHING - }; - /* Tell what to do about this bpstat. */ struct bpstat_what bpstat_what (bpstat); diff --git a/gdb/c-varobj.c b/gdb/c-varobj.c index 9c2860d2886..0f0deaf2630 100644 --- a/gdb/c-varobj.c +++ b/gdb/c-varobj.c @@ -317,7 +317,7 @@ c_describe_child (struct varobj *parent, int index, if (cfull_expression) { - char *join = was_ptr ? "->" : "."; + const char *join = was_ptr ? "->" : "."; *cfull_expression = xstrprintf ("(%s)%s%s", parent_expression, join, field_name); @@ -681,7 +681,7 @@ cplus_describe_child (struct varobj *parent, int index, if (TYPE_CODE (type) == TYPE_CODE_STRUCT || TYPE_CODE (type) == TYPE_CODE_UNION) { - char *join = was_ptr ? "->" : "."; + const char *join = was_ptr ? "->" : "."; if (CPLUS_FAKE_CHILD (parent)) { @@ -765,7 +765,7 @@ cplus_describe_child (struct varobj *parent, int index, if (cfull_expression) { - char *ptr = was_ptr ? "*" : ""; + const char *ptr = was_ptr ? "*" : ""; /* Cast the parent to the base' type. Note that in gdb, expression like diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index eb082e44c65..c93f2b14417 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -522,7 +522,7 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c) break; case var_boolean: { - char *opt = *(int *) c->var ? "on" : "off"; + const char *opt = *(int *) c->var ? "on" : "off"; observer_notify_command_param_changed (name, opt); } diff --git a/gdb/common/gdb_vecs.c b/gdb/common/gdb_vecs.c index fe303e953b2..f9d284710ec 100644 --- a/gdb/common/gdb_vecs.c +++ b/gdb/common/gdb_vecs.c @@ -54,7 +54,8 @@ delim_string_to_char_ptr_vec_append (VEC (char_ptr) **vecp, do { size_t this_len; - char *next_field, *this_field; + const char *next_field; + char *this_field; next_field = strchr (str, delimiter); if (next_field == NULL) diff --git a/gdb/common/linux-ptrace.c b/gdb/common/linux-ptrace.c index a35e94f8a09..cc90a5aba4c 100644 --- a/gdb/common/linux-ptrace.c +++ b/gdb/common/linux-ptrace.c @@ -64,7 +64,7 @@ linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer) #if defined __i386__ || defined __x86_64__ /* Address of the 'ret' instruction in asm code block below. */ -extern void (linux_ptrace_test_ret_to_nx_instr) (void); +EXTERN_C void (linux_ptrace_test_ret_to_nx_instr) (void); #include #include diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index bb443897d30..9dd4ade72ab 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -90,7 +90,7 @@ static void cp_print_value (struct type *, struct type *, /* GCC versions after 2.4.5 use this. */ -const char vtbl_ptr_name[] = "__vtbl_ptr_type"; +extern const char vtbl_ptr_name[] = "__vtbl_ptr_type"; /* Return truth value for assertion that TYPE is of the type "pointer to virtual function". */ diff --git a/gdb/dcache.h b/gdb/dcache.h index 020abd6bb4d..5cd2fe51792 100644 --- a/gdb/dcache.h +++ b/gdb/dcache.h @@ -21,6 +21,8 @@ #ifndef DCACHE_H #define DCACHE_H +#include "target.h" + typedef struct dcache_struct DCACHE; /* Invalidate DCACHE. */ diff --git a/gdb/defs.h b/gdb/defs.h index 47da43a6652..7de129e30c7 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -280,11 +280,19 @@ extern char *relocate_gdb_directory (const char *initial, int flag); extern int annotation_level; /* in stack.c */ +#ifdef __cplusplus +# define EXTERN_C extern "C" +# define EXTERN_CONST extern const +#else +# define EXTERN_C extern +# define EXTERN_CONST const +#endif + /* From regex.c or libc. BSD 4.4 declares this with the argument type as "const char *" in unistd.h, so we can't declare the argument as "char *". */ -extern char *re_comp (const char *); +EXTERN_C char *re_comp (const char *); /* From symfile.c */ diff --git a/gdb/doublest.h b/gdb/doublest.h index c0c266173a6..6c55d92fbf0 100644 --- a/gdb/doublest.h +++ b/gdb/doublest.h @@ -33,8 +33,16 @@ struct floatformat; number. Typically, this is useful for native ports, where the actual format is irrelevant, since no conversions will be taking place. */ +#ifdef __cplusplus +extern "C" { +#endif + #include "floatformat.h" /* For struct floatformat */ +#ifdef __cplusplus +} +#endif + /* Use `long double' if the host compiler supports it. (Note that this is not necessarily any longer than `double'. On SunOS/gcc, it's the same as double.) This is necessary because GDB internally converts all floating diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 4efaade786c..b6bff5076da 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8871,7 +8871,7 @@ find_file_and_directory (struct die_info *die, struct dwarf2_cu *cu, { /* Irix 6.2 native cc prepends .: to the compilation directory, get rid of it. */ - char *cp = strchr (*comp_dir, ':'); + const char *cp = strchr (*comp_dir, ':'); if (cp && cp != *comp_dir && cp[-1] == '.' && cp[1] == '/') *comp_dir = cp + 1; @@ -18510,7 +18510,7 @@ static char * anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu) { struct attribute *attr; - char *base; + const char *base; if (die->tag != DW_TAG_class_type && die->tag != DW_TAG_interface_type && die->tag != DW_TAG_structure_type && die->tag != DW_TAG_union_type) @@ -18871,7 +18871,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) if (demangled) { - char *base; + const char *base; /* FIXME: we already did this for the partial symbol... */ DW_STRING (attr) = (const char *) obstack_copy0 (&cu->objfile->objfile_obstack, diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 1fd56102eea..54ce5978c61 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -29,7 +29,11 @@ #include "serial.h" #include "gdbthread.h" -const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL }; +const struct gdb_exception exception_none +#ifndef __cplusplus + = { 0, GDB_NO_ERROR, NULL }; +#endif +; /* Possible catcher states. */ enum catcher_state { diff --git a/gdb/exceptions.h b/gdb/exceptions.h index b8dadc7b01f..7168e5cbfb4 100644 --- a/gdb/exceptions.h +++ b/gdb/exceptions.h @@ -106,6 +106,34 @@ enum errors { struct gdb_exception { +#ifdef __cplusplus + gdb_exception() + {} + + gdb_exception volatile & operator=(gdb_exception const &other) volatile + { + this->reason = other.reason; + this->error = other.error; + this->message = other.message; + return *this; + } + gdb_exception& operator=(gdb_exception const volatile &other) + { + this->reason = other.reason; + this->error = other.error; + this->message = other.message; + return *this; + } + + gdb_exception(volatile const gdb_exception& ex) + : reason (ex.reason), error(ex.error), message(ex.message) + {} + + gdb_exception(const gdb_exception& ex) + : reason (ex.reason), error(ex.error), message(ex.message) + {} +#endif + enum return_reason reason; enum errors error; const char *message; diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h index 9e63a9c2913..ab6ad1f42c8 100644 --- a/gdb/extension-priv.h +++ b/gdb/extension-priv.h @@ -266,7 +266,7 @@ struct signal_handler int handler_saved; /* The signal handler. */ - RETSIGTYPE (*handler) (); + RETSIGTYPE (*handler) (int); }; /* State necessary to restore the currently active extension language diff --git a/gdb/extension.c b/gdb/extension.c index 1146cc7d03c..b3f3b989f15 100644 --- a/gdb/extension.c +++ b/gdb/extension.c @@ -691,7 +691,7 @@ static void install_gdb_sigint_handler (struct signal_handler *previous) { /* Save here to simplify comparison. */ - RETSIGTYPE (*handle_sigint_for_compare) () = handle_sigint; + RETSIGTYPE (*handle_sigint_for_compare) (int) = handle_sigint; previous->handler = signal (SIGINT, handle_sigint); if (previous->handler != handle_sigint_for_compare) diff --git a/gdb/features/feature_to_c.sh b/gdb/features/feature_to_c.sh old mode 100644 new mode 100755 index 1f435362f45..e6665f118da --- a/gdb/features/feature_to_c.sh +++ b/gdb/features/feature_to_c.sh @@ -63,7 +63,13 @@ for input; do done echo >> $output -echo "const char *const xml_builtin[][2] = {" >> $output + +echo "#ifdef __cplusplus" >> $output +echo "# define EXTERN_CONST extern const" >> $output +echo "#else" >> $output +echo "# define EXTERN_CONST const" >> $output +echo "#endif" >> $output +echo "EXTERN_CONST char *const xml_builtin[][2] = {" >> $output for input; do basename=`echo $input | sed 's,.*/,,'` diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index bf5087c1db5..ee41a3ca426 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -658,58 +658,58 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) plongest (gdbarch->addr_bit)); fprintf_unfiltered (file, "gdbarch_dump: addr_bits_remove = <%s>\n", - host_address_to_string (gdbarch->addr_bits_remove)); + host_address_to_string ((void *) gdbarch->addr_bits_remove)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n", gdbarch_address_class_name_to_type_flags_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: address_class_name_to_type_flags = <%s>\n", - host_address_to_string (gdbarch->address_class_name_to_type_flags)); + host_address_to_string ((void *) gdbarch->address_class_name_to_type_flags)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n", gdbarch_address_class_type_flags_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: address_class_type_flags = <%s>\n", - host_address_to_string (gdbarch->address_class_type_flags)); + host_address_to_string ((void *) gdbarch->address_class_type_flags)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n", gdbarch_address_class_type_flags_to_name_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: address_class_type_flags_to_name = <%s>\n", - host_address_to_string (gdbarch->address_class_type_flags_to_name)); + host_address_to_string ((void *) gdbarch->address_class_type_flags_to_name)); fprintf_unfiltered (file, "gdbarch_dump: address_to_pointer = <%s>\n", - host_address_to_string (gdbarch->address_to_pointer)); + host_address_to_string ((void *) gdbarch->address_to_pointer)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n", gdbarch_adjust_breakpoint_address_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: adjust_breakpoint_address = <%s>\n", - host_address_to_string (gdbarch->adjust_breakpoint_address)); + host_address_to_string ((void *) gdbarch->adjust_breakpoint_address)); fprintf_unfiltered (file, "gdbarch_dump: auto_charset = <%s>\n", - host_address_to_string (gdbarch->auto_charset)); + host_address_to_string ((void *) gdbarch->auto_charset)); fprintf_unfiltered (file, "gdbarch_dump: auto_wide_charset = <%s>\n", - host_address_to_string (gdbarch->auto_wide_charset)); + host_address_to_string ((void *) gdbarch->auto_wide_charset)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_auxv_parse_p() = %d\n", gdbarch_auxv_parse_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: auxv_parse = <%s>\n", - host_address_to_string (gdbarch->auxv_parse)); + host_address_to_string ((void *) gdbarch->auxv_parse)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n", gdbarch_ax_pseudo_register_collect_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: ax_pseudo_register_collect = <%s>\n", - host_address_to_string (gdbarch->ax_pseudo_register_collect)); + host_address_to_string ((void *) gdbarch->ax_pseudo_register_collect)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n", gdbarch_ax_pseudo_register_push_stack_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n", - host_address_to_string (gdbarch->ax_pseudo_register_push_stack)); + host_address_to_string ((void *) gdbarch->ax_pseudo_register_push_stack)); fprintf_unfiltered (file, "gdbarch_dump: believe_pcc_promotion = %s\n", plongest (gdbarch->believe_pcc_promotion)); @@ -721,7 +721,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) plongest (gdbarch->bits_big_endian)); fprintf_unfiltered (file, "gdbarch_dump: breakpoint_from_pc = <%s>\n", - host_address_to_string (gdbarch->breakpoint_from_pc)); + host_address_to_string ((void *) gdbarch->breakpoint_from_pc)); fprintf_unfiltered (file, "gdbarch_dump: byte_order = %s\n", plongest (gdbarch->byte_order)); @@ -733,43 +733,43 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) plongest (gdbarch->call_dummy_location)); fprintf_unfiltered (file, "gdbarch_dump: cannot_fetch_register = <%s>\n", - host_address_to_string (gdbarch->cannot_fetch_register)); + host_address_to_string ((void *) gdbarch->cannot_fetch_register)); fprintf_unfiltered (file, "gdbarch_dump: cannot_step_breakpoint = %s\n", plongest (gdbarch->cannot_step_breakpoint)); fprintf_unfiltered (file, "gdbarch_dump: cannot_store_register = <%s>\n", - host_address_to_string (gdbarch->cannot_store_register)); + host_address_to_string ((void *) gdbarch->cannot_store_register)); fprintf_unfiltered (file, "gdbarch_dump: char_signed = %s\n", plongest (gdbarch->char_signed)); fprintf_unfiltered (file, "gdbarch_dump: coff_make_msymbol_special = <%s>\n", - host_address_to_string (gdbarch->coff_make_msymbol_special)); + host_address_to_string ((void *) gdbarch->coff_make_msymbol_special)); fprintf_unfiltered (file, "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n", - host_address_to_string (gdbarch->convert_from_func_ptr_addr)); + host_address_to_string ((void *) gdbarch->convert_from_func_ptr_addr)); fprintf_unfiltered (file, "gdbarch_dump: convert_register_p = <%s>\n", - host_address_to_string (gdbarch->convert_register_p)); + host_address_to_string ((void *) gdbarch->convert_register_p)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_core_info_proc_p() = %d\n", gdbarch_core_info_proc_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: core_info_proc = <%s>\n", - host_address_to_string (gdbarch->core_info_proc)); + host_address_to_string ((void *) gdbarch->core_info_proc)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n", gdbarch_core_pid_to_str_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: core_pid_to_str = <%s>\n", - host_address_to_string (gdbarch->core_pid_to_str)); + host_address_to_string ((void *) gdbarch->core_pid_to_str)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_core_read_description_p() = %d\n", gdbarch_core_read_description_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: core_read_description = <%s>\n", - host_address_to_string (gdbarch->core_read_description)); + host_address_to_string ((void *) gdbarch->core_read_description)); fprintf_unfiltered (file, "gdbarch_dump: core_regset_sections = %s\n", host_address_to_string (gdbarch->core_regset_sections)); @@ -778,13 +778,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_core_xfer_shared_libraries_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: core_xfer_shared_libraries = <%s>\n", - host_address_to_string (gdbarch->core_xfer_shared_libraries)); + host_address_to_string ((void *) gdbarch->core_xfer_shared_libraries)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_core_xfer_shared_libraries_aix_p() = %d\n", gdbarch_core_xfer_shared_libraries_aix_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: core_xfer_shared_libraries_aix = <%s>\n", - host_address_to_string (gdbarch->core_xfer_shared_libraries_aix)); + host_address_to_string ((void *) gdbarch->core_xfer_shared_libraries_aix)); fprintf_unfiltered (file, "gdbarch_dump: decr_pc_after_break = %s\n", core_addr_to_string_nz (gdbarch->decr_pc_after_break)); @@ -799,22 +799,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_displaced_step_copy_insn_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: displaced_step_copy_insn = <%s>\n", - host_address_to_string (gdbarch->displaced_step_copy_insn)); + host_address_to_string ((void *) gdbarch->displaced_step_copy_insn)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n", gdbarch_displaced_step_fixup_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: displaced_step_fixup = <%s>\n", - host_address_to_string (gdbarch->displaced_step_fixup)); + host_address_to_string ((void *) gdbarch->displaced_step_fixup)); fprintf_unfiltered (file, "gdbarch_dump: displaced_step_free_closure = <%s>\n", - host_address_to_string (gdbarch->displaced_step_free_closure)); + host_address_to_string ((void *) gdbarch->displaced_step_free_closure)); fprintf_unfiltered (file, "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n", - host_address_to_string (gdbarch->displaced_step_hw_singlestep)); + host_address_to_string ((void *) gdbarch->displaced_step_hw_singlestep)); fprintf_unfiltered (file, "gdbarch_dump: displaced_step_location = <%s>\n", - host_address_to_string (gdbarch->displaced_step_location)); + host_address_to_string ((void *) gdbarch->displaced_step_location)); fprintf_unfiltered (file, "gdbarch_dump: double_bit = %s\n", plongest (gdbarch->double_bit)); @@ -826,46 +826,46 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_dummy_id_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: dummy_id = <%s>\n", - host_address_to_string (gdbarch->dummy_id)); + host_address_to_string ((void *) gdbarch->dummy_id)); fprintf_unfiltered (file, "gdbarch_dump: dwarf2_addr_size = %s\n", plongest (gdbarch->dwarf2_addr_size)); fprintf_unfiltered (file, "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n", - host_address_to_string (gdbarch->dwarf2_reg_to_regnum)); + host_address_to_string ((void *) gdbarch->dwarf2_reg_to_regnum)); fprintf_unfiltered (file, "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n", - host_address_to_string (gdbarch->ecoff_reg_to_regnum)); + host_address_to_string ((void *) gdbarch->ecoff_reg_to_regnum)); fprintf_unfiltered (file, "gdbarch_dump: elf_make_msymbol_special = <%s>\n", - host_address_to_string (gdbarch->elf_make_msymbol_special)); + host_address_to_string ((void *) gdbarch->elf_make_msymbol_special)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_elfcore_write_linux_prpsinfo_p() = %d\n", gdbarch_elfcore_write_linux_prpsinfo_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: elfcore_write_linux_prpsinfo = <%s>\n", - host_address_to_string (gdbarch->elfcore_write_linux_prpsinfo)); + host_address_to_string ((void *) gdbarch->elfcore_write_linux_prpsinfo)); fprintf_unfiltered (file, "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n", - host_address_to_string (gdbarch->fast_tracepoint_valid_at)); + host_address_to_string ((void *) gdbarch->fast_tracepoint_valid_at)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n", gdbarch_fetch_pointer_argument_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: fetch_pointer_argument = <%s>\n", - host_address_to_string (gdbarch->fetch_pointer_argument)); + host_address_to_string ((void *) gdbarch->fetch_pointer_argument)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n", gdbarch_fetch_tls_load_module_address_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: fetch_tls_load_module_address = <%s>\n", - host_address_to_string (gdbarch->fetch_tls_load_module_address)); + host_address_to_string ((void *) gdbarch->fetch_tls_load_module_address)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n", gdbarch_find_memory_regions_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: find_memory_regions = <%s>\n", - host_address_to_string (gdbarch->find_memory_regions)); + host_address_to_string ((void *) gdbarch->find_memory_regions)); fprintf_unfiltered (file, "gdbarch_dump: float_bit = %s\n", plongest (gdbarch->float_bit)); @@ -880,7 +880,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_frame_align_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: frame_align = <%s>\n", - host_address_to_string (gdbarch->frame_align)); + host_address_to_string ((void *) gdbarch->frame_align)); fprintf_unfiltered (file, "gdbarch_dump: frame_args_skip = %s\n", core_addr_to_string_nz (gdbarch->frame_args_skip)); @@ -889,7 +889,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_frame_num_args_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: frame_num_args = <%s>\n", - host_address_to_string (gdbarch->frame_num_args)); + host_address_to_string ((void *) gdbarch->frame_num_args)); fprintf_unfiltered (file, "gdbarch_dump: frame_red_zone_size = %s\n", plongest (gdbarch->frame_red_zone_size)); @@ -904,34 +904,34 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_gdb_signal_from_target_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: gdb_signal_from_target = <%s>\n", - host_address_to_string (gdbarch->gdb_signal_from_target)); + host_address_to_string ((void *) gdbarch->gdb_signal_from_target)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_gdb_signal_to_target_p() = %d\n", gdbarch_gdb_signal_to_target_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: gdb_signal_to_target = <%s>\n", - host_address_to_string (gdbarch->gdb_signal_to_target)); + host_address_to_string ((void *) gdbarch->gdb_signal_to_target)); fprintf_unfiltered (file, "gdbarch_dump: gen_return_address = <%s>\n", - host_address_to_string (gdbarch->gen_return_address)); + host_address_to_string ((void *) gdbarch->gen_return_address)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n", gdbarch_get_longjmp_target_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: get_longjmp_target = <%s>\n", - host_address_to_string (gdbarch->get_longjmp_target)); + host_address_to_string ((void *) gdbarch->get_longjmp_target)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n", gdbarch_get_siginfo_type_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: get_siginfo_type = <%s>\n", - host_address_to_string (gdbarch->get_siginfo_type)); + host_address_to_string ((void *) gdbarch->get_siginfo_type)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n", gdbarch_get_syscall_number_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: get_syscall_number = <%s>\n", - host_address_to_string (gdbarch->get_syscall_number)); + host_address_to_string ((void *) gdbarch->get_syscall_number)); fprintf_unfiltered (file, "gdbarch_dump: half_bit = %s\n", plongest (gdbarch->half_bit)); @@ -949,34 +949,34 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) plongest (gdbarch->has_global_solist)); fprintf_unfiltered (file, "gdbarch_dump: has_shared_address_space = <%s>\n", - host_address_to_string (gdbarch->has_shared_address_space)); + host_address_to_string ((void *) gdbarch->has_shared_address_space)); fprintf_unfiltered (file, "gdbarch_dump: have_nonsteppable_watchpoint = %s\n", plongest (gdbarch->have_nonsteppable_watchpoint)); fprintf_unfiltered (file, "gdbarch_dump: in_function_epilogue_p = <%s>\n", - host_address_to_string (gdbarch->in_function_epilogue_p)); + host_address_to_string ((void *) gdbarch->in_function_epilogue_p)); fprintf_unfiltered (file, "gdbarch_dump: in_solib_return_trampoline = <%s>\n", - host_address_to_string (gdbarch->in_solib_return_trampoline)); + host_address_to_string ((void *) gdbarch->in_solib_return_trampoline)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_info_proc_p() = %d\n", gdbarch_info_proc_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: info_proc = <%s>\n", - host_address_to_string (gdbarch->info_proc)); + host_address_to_string ((void *) gdbarch->info_proc)); fprintf_unfiltered (file, "gdbarch_dump: inner_than = <%s>\n", - host_address_to_string (gdbarch->inner_than)); + host_address_to_string ((void *) gdbarch->inner_than)); fprintf_unfiltered (file, "gdbarch_dump: insn_is_call = <%s>\n", - host_address_to_string (gdbarch->insn_is_call)); + host_address_to_string ((void *) gdbarch->insn_is_call)); fprintf_unfiltered (file, "gdbarch_dump: insn_is_jump = <%s>\n", - host_address_to_string (gdbarch->insn_is_jump)); + host_address_to_string ((void *) gdbarch->insn_is_jump)); fprintf_unfiltered (file, "gdbarch_dump: insn_is_ret = <%s>\n", - host_address_to_string (gdbarch->insn_is_ret)); + host_address_to_string ((void *) gdbarch->insn_is_ret)); fprintf_unfiltered (file, "gdbarch_dump: int_bit = %s\n", plongest (gdbarch->int_bit)); @@ -985,10 +985,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_integer_to_address_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: integer_to_address = <%s>\n", - host_address_to_string (gdbarch->integer_to_address)); + host_address_to_string ((void *) gdbarch->integer_to_address)); fprintf_unfiltered (file, "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n", - host_address_to_string (gdbarch->iterate_over_objfiles_in_search_order)); + host_address_to_string ((void *) gdbarch->iterate_over_objfiles_in_search_order)); fprintf_unfiltered (file, "gdbarch_dump: long_bit = %s\n", plongest (gdbarch->long_bit)); @@ -1009,7 +1009,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_make_corefile_notes_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: make_corefile_notes = <%s>\n", - host_address_to_string (gdbarch->make_corefile_notes)); + host_address_to_string ((void *) gdbarch->make_corefile_notes)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n", gdbarch_max_insn_length_p (gdbarch)); @@ -1018,10 +1018,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) plongest (gdbarch->max_insn_length)); fprintf_unfiltered (file, "gdbarch_dump: memory_insert_breakpoint = <%s>\n", - host_address_to_string (gdbarch->memory_insert_breakpoint)); + host_address_to_string ((void *) gdbarch->memory_insert_breakpoint)); fprintf_unfiltered (file, "gdbarch_dump: memory_remove_breakpoint = <%s>\n", - host_address_to_string (gdbarch->memory_remove_breakpoint)); + host_address_to_string ((void *) gdbarch->memory_remove_breakpoint)); fprintf_unfiltered (file, "gdbarch_dump: num_pseudo_regs = %s\n", plongest (gdbarch->num_pseudo_regs)); @@ -1036,43 +1036,43 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_overlay_update_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: overlay_update = <%s>\n", - host_address_to_string (gdbarch->overlay_update)); + host_address_to_string ((void *) gdbarch->overlay_update)); fprintf_unfiltered (file, "gdbarch_dump: pc_regnum = %s\n", plongest (gdbarch->pc_regnum)); fprintf_unfiltered (file, "gdbarch_dump: pointer_to_address = <%s>\n", - host_address_to_string (gdbarch->pointer_to_address)); + host_address_to_string ((void *) gdbarch->pointer_to_address)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_print_float_info_p() = %d\n", gdbarch_print_float_info_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: print_float_info = <%s>\n", - host_address_to_string (gdbarch->print_float_info)); + host_address_to_string ((void *) gdbarch->print_float_info)); fprintf_unfiltered (file, "gdbarch_dump: print_insn = <%s>\n", - host_address_to_string (gdbarch->print_insn)); + host_address_to_string ((void *) gdbarch->print_insn)); fprintf_unfiltered (file, "gdbarch_dump: print_registers_info = <%s>\n", - host_address_to_string (gdbarch->print_registers_info)); + host_address_to_string ((void *) gdbarch->print_registers_info)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n", gdbarch_print_vector_info_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: print_vector_info = <%s>\n", - host_address_to_string (gdbarch->print_vector_info)); + host_address_to_string ((void *) gdbarch->print_vector_info)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_process_record_p() = %d\n", gdbarch_process_record_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: process_record = <%s>\n", - host_address_to_string (gdbarch->process_record)); + host_address_to_string ((void *) gdbarch->process_record)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n", gdbarch_process_record_signal_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: process_record_signal = <%s>\n", - host_address_to_string (gdbarch->process_record_signal)); + host_address_to_string ((void *) gdbarch->process_record_signal)); fprintf_unfiltered (file, "gdbarch_dump: ps_regnum = %s\n", plongest (gdbarch->ps_regnum)); @@ -1081,19 +1081,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_pseudo_register_read_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: pseudo_register_read = <%s>\n", - host_address_to_string (gdbarch->pseudo_register_read)); + host_address_to_string ((void *) gdbarch->pseudo_register_read)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n", gdbarch_pseudo_register_read_value_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: pseudo_register_read_value = <%s>\n", - host_address_to_string (gdbarch->pseudo_register_read_value)); + host_address_to_string ((void *) gdbarch->pseudo_register_read_value)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", gdbarch_pseudo_register_write_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: pseudo_register_write = <%s>\n", - host_address_to_string (gdbarch->pseudo_register_write)); + host_address_to_string ((void *) gdbarch->pseudo_register_write)); fprintf_unfiltered (file, "gdbarch_dump: ptr_bit = %s\n", plongest (gdbarch->ptr_bit)); @@ -1102,13 +1102,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_push_dummy_call_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: push_dummy_call = <%s>\n", - host_address_to_string (gdbarch->push_dummy_call)); + host_address_to_string ((void *) gdbarch->push_dummy_call)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n", gdbarch_push_dummy_code_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: push_dummy_code = <%s>\n", - host_address_to_string (gdbarch->push_dummy_code)); + host_address_to_string ((void *) gdbarch->push_dummy_code)); fprintf_unfiltered (file, "gdbarch_dump: ravenscar_ops = %s\n", host_address_to_string (gdbarch->ravenscar_ops)); @@ -1117,61 +1117,61 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_read_pc_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: read_pc = <%s>\n", - host_address_to_string (gdbarch->read_pc)); + host_address_to_string ((void *) gdbarch->read_pc)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n", gdbarch_record_special_symbol_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: record_special_symbol = <%s>\n", - host_address_to_string (gdbarch->record_special_symbol)); + host_address_to_string ((void *) gdbarch->record_special_symbol)); fprintf_unfiltered (file, "gdbarch_dump: register_name = <%s>\n", - host_address_to_string (gdbarch->register_name)); + host_address_to_string ((void *) gdbarch->register_name)); fprintf_unfiltered (file, "gdbarch_dump: register_reggroup_p = <%s>\n", - host_address_to_string (gdbarch->register_reggroup_p)); + host_address_to_string ((void *) gdbarch->register_reggroup_p)); fprintf_unfiltered (file, "gdbarch_dump: register_sim_regno = <%s>\n", - host_address_to_string (gdbarch->register_sim_regno)); + host_address_to_string ((void *) gdbarch->register_sim_regno)); fprintf_unfiltered (file, "gdbarch_dump: register_to_value = <%s>\n", - host_address_to_string (gdbarch->register_to_value)); + host_address_to_string ((void *) gdbarch->register_to_value)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_register_type_p() = %d\n", gdbarch_register_type_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: register_type = <%s>\n", - host_address_to_string (gdbarch->register_type)); + host_address_to_string ((void *) gdbarch->register_type)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n", gdbarch_regset_from_core_section_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: regset_from_core_section = <%s>\n", - host_address_to_string (gdbarch->regset_from_core_section)); + host_address_to_string ((void *) gdbarch->regset_from_core_section)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n", gdbarch_relocate_instruction_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: relocate_instruction = <%s>\n", - host_address_to_string (gdbarch->relocate_instruction)); + host_address_to_string ((void *) gdbarch->relocate_instruction)); fprintf_unfiltered (file, "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n", - host_address_to_string (gdbarch->remote_breakpoint_from_pc)); + host_address_to_string ((void *) gdbarch->remote_breakpoint_from_pc)); fprintf_unfiltered (file, "gdbarch_dump: remote_register_number = <%s>\n", - host_address_to_string (gdbarch->remote_register_number)); + host_address_to_string ((void *) gdbarch->remote_register_number)); fprintf_unfiltered (file, "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n", - host_address_to_string (gdbarch->return_in_first_hidden_param_p)); + host_address_to_string ((void *) gdbarch->return_in_first_hidden_param_p)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_return_value_p() = %d\n", gdbarch_return_value_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: return_value = <%s>\n", - host_address_to_string (gdbarch->return_value)); + host_address_to_string ((void *) gdbarch->return_value)); fprintf_unfiltered (file, "gdbarch_dump: sdb_reg_to_regnum = <%s>\n", - host_address_to_string (gdbarch->sdb_reg_to_regnum)); + host_address_to_string ((void *) gdbarch->sdb_reg_to_regnum)); fprintf_unfiltered (file, "gdbarch_dump: short_bit = %s\n", plongest (gdbarch->short_bit)); @@ -1180,40 +1180,40 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_single_step_through_delay_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: single_step_through_delay = <%s>\n", - host_address_to_string (gdbarch->single_step_through_delay)); + host_address_to_string ((void *) gdbarch->single_step_through_delay)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_skip_entrypoint_p() = %d\n", gdbarch_skip_entrypoint_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: skip_entrypoint = <%s>\n", - host_address_to_string (gdbarch->skip_entrypoint)); + host_address_to_string ((void *) gdbarch->skip_entrypoint)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n", gdbarch_skip_main_prologue_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: skip_main_prologue = <%s>\n", - host_address_to_string (gdbarch->skip_main_prologue)); + host_address_to_string ((void *) gdbarch->skip_main_prologue)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n", gdbarch_skip_permanent_breakpoint_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: skip_permanent_breakpoint = <%s>\n", - host_address_to_string (gdbarch->skip_permanent_breakpoint)); + host_address_to_string ((void *) gdbarch->skip_permanent_breakpoint)); fprintf_unfiltered (file, "gdbarch_dump: skip_prologue = <%s>\n", - host_address_to_string (gdbarch->skip_prologue)); + host_address_to_string ((void *) gdbarch->skip_prologue)); fprintf_unfiltered (file, "gdbarch_dump: skip_solib_resolver = <%s>\n", - host_address_to_string (gdbarch->skip_solib_resolver)); + host_address_to_string ((void *) gdbarch->skip_solib_resolver)); fprintf_unfiltered (file, "gdbarch_dump: skip_trampoline_code = <%s>\n", - host_address_to_string (gdbarch->skip_trampoline_code)); + host_address_to_string ((void *) gdbarch->skip_trampoline_code)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_software_single_step_p() = %d\n", gdbarch_software_single_step_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: software_single_step = <%s>\n", - host_address_to_string (gdbarch->software_single_step)); + host_address_to_string ((void *) gdbarch->software_single_step)); fprintf_unfiltered (file, "gdbarch_dump: sofun_address_maybe_missing = %s\n", plongest (gdbarch->sofun_address_maybe_missing)); @@ -1225,10 +1225,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) plongest (gdbarch->sp_regnum)); fprintf_unfiltered (file, "gdbarch_dump: stab_reg_to_regnum = <%s>\n", - host_address_to_string (gdbarch->stab_reg_to_regnum)); + host_address_to_string ((void *) gdbarch->stab_reg_to_regnum)); fprintf_unfiltered (file, "gdbarch_dump: stabs_argument_has_addr = <%s>\n", - host_address_to_string (gdbarch->stabs_argument_has_addr)); + host_address_to_string ((void *) gdbarch->stabs_argument_has_addr)); fprintf_unfiltered (file, "gdbarch_dump: stap_gdb_register_prefix = %s\n", pstring (gdbarch->stap_gdb_register_prefix)); @@ -1246,13 +1246,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_stap_is_single_operand_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: stap_is_single_operand = <%s>\n", - host_address_to_string (gdbarch->stap_is_single_operand)); + host_address_to_string ((void *) gdbarch->stap_is_single_operand)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_stap_parse_special_token_p() = %d\n", gdbarch_stap_parse_special_token_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: stap_parse_special_token = <%s>\n", - host_address_to_string (gdbarch->stap_parse_special_token)); + host_address_to_string ((void *) gdbarch->stap_parse_special_token)); fprintf_unfiltered (file, "gdbarch_dump: stap_register_indirection_prefixes = %s\n", pstring_list (gdbarch->stap_register_indirection_prefixes)); @@ -1270,7 +1270,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_static_transform_name_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: static_transform_name = <%s>\n", - host_address_to_string (gdbarch->static_transform_name)); + host_address_to_string ((void *) gdbarch->static_transform_name)); fprintf_unfiltered (file, "gdbarch_dump: target_desc = %s\n", host_address_to_string (gdbarch->target_desc)); @@ -1279,25 +1279,25 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_unwind_pc_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: unwind_pc = <%s>\n", - host_address_to_string (gdbarch->unwind_pc)); + host_address_to_string ((void *) gdbarch->unwind_pc)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n", gdbarch_unwind_sp_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: unwind_sp = <%s>\n", - host_address_to_string (gdbarch->unwind_sp)); + host_address_to_string ((void *) gdbarch->unwind_sp)); fprintf_unfiltered (file, "gdbarch_dump: value_from_register = <%s>\n", - host_address_to_string (gdbarch->value_from_register)); + host_address_to_string ((void *) gdbarch->value_from_register)); fprintf_unfiltered (file, "gdbarch_dump: value_to_register = <%s>\n", - host_address_to_string (gdbarch->value_to_register)); + host_address_to_string ((void *) gdbarch->value_to_register)); fprintf_unfiltered (file, "gdbarch_dump: vbit_in_delta = %s\n", plongest (gdbarch->vbit_in_delta)); fprintf_unfiltered (file, "gdbarch_dump: virtual_frame_pointer = <%s>\n", - host_address_to_string (gdbarch->virtual_frame_pointer)); + host_address_to_string ((void *) gdbarch->virtual_frame_pointer)); fprintf_unfiltered (file, "gdbarch_dump: vtable_function_descriptors = %s\n", plongest (gdbarch->vtable_function_descriptors)); @@ -1306,7 +1306,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdbarch_write_pc_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: write_pc = <%s>\n", - host_address_to_string (gdbarch->write_pc)); + host_address_to_string ((void *) gdbarch->write_pc)); if (gdbarch->dump_tdep != NULL) gdbarch->dump_tdep (gdbarch, file); } @@ -4614,7 +4614,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture, if (gdbarch_debug) fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n", bfd_arch_info->printable_name, - host_address_to_string (init)); + host_address_to_string ((void *) init)); /* Append it */ (*curr) = XNEW (struct gdbarch_registration); (*curr)->bfd_architecture = bfd_architecture; diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index c621091aa4a..e21714f86d9 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -59,6 +59,8 @@ struct stap_parse_info; struct ravenscar_arch_ops; struct elf_internal_linux_prpsinfo; +#include "regcache.h" + /* The architecture associated with the inferior through the connection to the target. diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index a2ff41703bd..48d0162e861 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -1148,6 +1148,8 @@ struct stap_parse_info; struct ravenscar_arch_ops; struct elf_internal_linux_prpsinfo; +#include "regcache.h" + /* The architecture associated with the inferior through the connection to the target. @@ -1802,7 +1804,7 @@ do then printf " fprintf_unfiltered (file,\n" printf " \"gdbarch_dump: ${function} = <%%s>\\\\n\",\n" - printf " host_address_to_string (gdbarch->${function}));\n" + printf " host_address_to_string ((void *) gdbarch->${function}));\n" else # It is a variable case "${print}:${returntype}" in @@ -2159,7 +2161,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture, if (gdbarch_debug) fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n", bfd_arch_info->printable_name, - host_address_to_string (init)); + host_address_to_string ((void *) init)); /* Append it */ (*curr) = XNEW (struct gdbarch_registration); (*curr)->bfd_architecture = bfd_architecture; diff --git a/gdb/gdbserver/i386-low.c b/gdb/gdbserver/i386-low.c index 03eebd1b761..3f800ed233e 100644 --- a/gdb/gdbserver/i386-low.c +++ b/gdb/gdbserver/i386-low.c @@ -365,8 +365,8 @@ i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, int align = addr % max_wp_len; /* Four (eight on AMD64) is the maximum length a debug register can watch. */ - int try = (len > max_wp_len ? (max_wp_len - 1) : len - 1); - int size = size_try_array[try][align]; + int try_len = (len > max_wp_len ? (max_wp_len - 1) : len - 1); + int size = size_try_array[try_len][align]; if (what == WP_COUNT) { diff --git a/gdb/gdbserver/inferiors.h b/gdb/gdbserver/inferiors.h index f584339bc9c..165db37e572 100644 --- a/gdb/gdbserver/inferiors.h +++ b/gdb/gdbserver/inferiors.h @@ -69,7 +69,7 @@ struct process_info const struct target_desc *tdesc; /* Private target data. */ - struct process_info_private *private; + struct process_info_private *priv; }; #define ptid_of(inf) ((inf)->entry.id) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 0ef8d600bf3..10096632072 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -356,13 +356,13 @@ linux_add_process (int pid, int attached) struct process_info *proc; proc = add_process (pid, attached); - proc->private = xcalloc (1, sizeof (*proc->private)); + proc->priv = xcalloc (1, sizeof (*proc->priv)); /* Set the arch when the first LWP stops. */ - proc->private->new_inferior = 1; + proc->priv->new_inferior = 1; if (the_low_target.new_process != NULL) - proc->private->arch_private = the_low_target.new_process (); + proc->priv->arch_private = the_low_target.new_process (); return proc; } @@ -1180,10 +1180,10 @@ linux_mourn (struct process_info *process) find_inferior (&all_threads, delete_lwp_callback, process); /* Freeing all private data. */ - priv = process->private; + priv = process->priv; free (priv->arch_private); free (priv); - process->private = NULL; + process->priv = NULL; remove_process (process); } @@ -1758,7 +1758,7 @@ linux_low_filter_event (ptid_t filter_ptid, int lwpid, int wstat) is stopped for the first time, but before we access any inferior registers. */ proc = find_process_pid (pid_of (thread)); - if (proc->private->new_inferior) + if (proc->priv->new_inferior) { struct thread_info *saved_inferior; @@ -1769,7 +1769,7 @@ linux_low_filter_event (ptid_t filter_ptid, int lwpid, int wstat) current_inferior = saved_inferior; - proc->private->new_inferior = 0; + proc->priv->new_inferior = 0; } } @@ -2769,7 +2769,7 @@ retry: && current_inferior->last_resume_kind != resume_step && ( #if defined (USE_THREAD_DB) && !defined (__ANDROID__) - (current_process ()->private->thread_db != NULL + (current_process ()->priv->thread_db != NULL && (WSTOPSIG (w) == __SIGRTMIN || WSTOPSIG (w) == __SIGRTMIN + 1)) || @@ -4798,7 +4798,7 @@ linux_look_up_symbols (void) #ifdef USE_THREAD_DB struct process_info *proc = current_process (); - if (proc->private->thread_db != NULL) + if (proc->priv->thread_db != NULL) return; /* If the kernel supports tracing clones, then we don't need to @@ -5705,7 +5705,7 @@ linux_qxfer_libraries_svr4 (const char *annex, unsigned char *readbuf, { char *document; unsigned document_len; - struct process_info_private *const priv = current_process ()->private; + struct process_info_private *const priv = current_process ()->priv; char filename[PATH_MAX]; int pid, is_elf64; diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index 1bd7b4abc95..11e2831080c 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -530,12 +530,14 @@ x86_linux_dr_get (ptid_t ptid, int regnum) { int tid; unsigned long value; + int offset; tid = ptid_get_lwp (ptid); errno = 0; - value = ptrace (PTRACE_PEEKUSER, tid, - offsetof (struct user, u_debugreg[regnum]), 0); + offset = (offsetof (struct user, u_debugreg) + + sizeof (((struct user *) 0)->u_debugreg[0]) * regnum); + value = ptrace (PTRACE_PEEKUSER, tid, offset, 0); if (errno != 0) error ("Couldn't read debug register"); @@ -546,12 +548,14 @@ static void x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) { int tid; + int offset; tid = ptid_get_lwp (ptid); errno = 0; - ptrace (PTRACE_POKEUSER, tid, - offsetof (struct user, u_debugreg[regnum]), value); + offset = (offsetof (struct user, u_debugreg) + + sizeof (((struct user *) 0)->u_debugreg[0]) * regnum); + ptrace (PTRACE_POKEUSER, tid, offset, value); if (errno != 0) error ("Couldn't write debug register"); } @@ -665,7 +669,7 @@ x86_insert_point (char type, CORE_ADDR addr, int len) { enum target_hw_bp_type hw_type = Z_packet_to_hw_type (type); struct i386_debug_reg_state *state - = &proc->private->arch_private->debug_reg_state; + = &proc->priv->arch_private->debug_reg_state; return i386_low_insert_watchpoint (state, hw_type, addr, len); } @@ -700,7 +704,7 @@ x86_remove_point (char type, CORE_ADDR addr, int len) { enum target_hw_bp_type hw_type = Z_packet_to_hw_type (type); struct i386_debug_reg_state *state - = &proc->private->arch_private->debug_reg_state; + = &proc->priv->arch_private->debug_reg_state; return i386_low_remove_watchpoint (state, hw_type, addr, len); } @@ -714,7 +718,7 @@ static int x86_stopped_by_watchpoint (void) { struct process_info *proc = current_process (); - return i386_low_stopped_by_watchpoint (&proc->private->arch_private->debug_reg_state); + return i386_low_stopped_by_watchpoint (&proc->priv->arch_private->debug_reg_state); } static CORE_ADDR @@ -722,7 +726,7 @@ x86_stopped_data_address (void) { struct process_info *proc = current_process (); CORE_ADDR addr; - if (i386_low_stopped_data_address (&proc->private->arch_private->debug_reg_state, + if (i386_low_stopped_data_address (&proc->priv->arch_private->debug_reg_state, &addr)) return addr; return 0; @@ -767,7 +771,7 @@ x86_linux_prepare_to_resume (struct lwp_info *lwp) int pid = ptid_get_pid (ptid); struct process_info *proc = find_process_pid (pid); struct i386_debug_reg_state *state - = &proc->private->arch_private->debug_reg_state; + = &proc->priv->arch_private->debug_reg_state; for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) if (state->dr_ref_count[i] > 0) diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 6eb1a16bc7a..bb8342f86c1 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -22,6 +22,14 @@ #include "config.h" #include "build-gnulib-gdbserver/config.h" +#ifdef __cplusplus +# define EXTERN_C extern "C" +# define EXTERN_CONST extern const +#else +# define EXTERN_C extern +# define EXTERN_CONST const +#endif + #ifdef __MINGW32CE__ #include "wincecompat.h" #endif diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index ae0d191aba3..a9c06260edf 100644 --- a/gdb/gdbserver/thread-db.c +++ b/gdb/gdbserver/thread-db.c @@ -188,7 +188,7 @@ thread_db_create_event (CORE_ADDR where) td_event_msg_t msg; td_err_e err; struct lwp_info *lwp; - struct thread_db *thread_db = current_process ()->private->thread_db; + struct thread_db *thread_db = current_process ()->priv->thread_db; if (thread_db->td_ta_event_getmsg_p == NULL) fatal ("unexpected thread_db->td_ta_event_getmsg_p == NULL"); @@ -225,7 +225,7 @@ thread_db_enable_reporting (void) td_thr_events_t events; td_notify_t notify; td_err_e err; - struct thread_db *thread_db = current_process ()->private->thread_db; + struct thread_db *thread_db = current_process ()->priv->thread_db; if (thread_db->td_ta_set_event_p == NULL || thread_db->td_ta_event_addr_p == NULL @@ -269,7 +269,7 @@ find_one_thread (ptid_t ptid) td_err_e err; struct thread_info *inferior; struct lwp_info *lwp; - struct thread_db *thread_db = current_process ()->private->thread_db; + struct thread_db *thread_db = current_process ()->priv->thread_db; int lwpid = ptid_get_lwp (ptid); inferior = (struct thread_info *) find_inferior_id (&all_threads, ptid); @@ -349,7 +349,7 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) if (thread_db_use_events) { td_err_e err; - struct thread_db *thread_db = proc->private->thread_db; + struct thread_db *thread_db = proc->priv->thread_db; err = thread_db->td_thr_event_enable_p (th_p, 1); if (err != TD_OK) @@ -388,7 +388,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) { td_thrinfo_t ti; td_err_e err; - struct thread_db *thread_db = current_process ()->private->thread_db; + struct thread_db *thread_db = current_process ()->priv->thread_db; err = thread_db->td_thr_get_info_p (th_p, &ti); if (err != TD_OK) @@ -413,7 +413,7 @@ thread_db_find_new_threads (void) { td_err_e err; ptid_t ptid = current_ptid; - struct thread_db *thread_db = current_process ()->private->thread_db; + struct thread_db *thread_db = current_process ()->priv->thread_db; int loop, iteration; /* This function is only called when we first initialize thread_db. @@ -459,7 +459,7 @@ thread_db_find_new_threads (void) static void thread_db_look_up_symbols (void) { - struct thread_db *thread_db = current_process ()->private->thread_db; + struct thread_db *thread_db = current_process ()->priv->thread_db; const char **sym_list; CORE_ADDR unused; @@ -474,7 +474,7 @@ thread_db_look_up_symbols (void) int thread_db_look_up_one_symbol (const char *name, CORE_ADDR *addrp) { - struct thread_db *thread_db = current_process ()->private->thread_db; + struct thread_db *thread_db = current_process ()->priv->thread_db; int may_ask_gdb = !thread_db->all_symbols_looked_up; /* If we've passed the call to thread_db_look_up_symbols, then @@ -497,7 +497,7 @@ thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset, struct thread_db *thread_db; proc = get_thread_process (thread); - thread_db = proc->private->thread_db; + thread_db = proc->priv->thread_db; /* If the thread layer is not (yet) initialized, fail. */ if (thread_db == NULL || !thread_db->all_symbols_looked_up) @@ -539,11 +539,11 @@ thread_db_load_search (void) struct thread_db *tdb; struct process_info *proc = current_process (); - if (proc->private->thread_db != NULL) - fatal ("unexpected: proc->private->thread_db != NULL"); + if (proc->priv->thread_db != NULL) + fatal ("unexpected: proc->priv->thread_db != NULL"); tdb = xcalloc (1, sizeof (*tdb)); - proc->private->thread_db = tdb; + proc->priv->thread_db = tdb; tdb->td_ta_new_p = &td_ta_new; @@ -554,7 +554,7 @@ thread_db_load_search (void) if (debug_threads) debug_printf ("td_ta_new(): %s\n", thread_db_err_str (err)); free (tdb); - proc->private->thread_db = NULL; + proc->priv->thread_db = NULL; return 0; } @@ -584,11 +584,11 @@ try_thread_db_load_1 (void *handle) struct thread_db *tdb; struct process_info *proc = current_process (); - if (proc->private->thread_db != NULL) - fatal ("unexpected: proc->private->thread_db != NULL"); + if (proc->priv->thread_db != NULL) + fatal ("unexpected: proc->priv->thread_db != NULL"); tdb = xcalloc (1, sizeof (*tdb)); - proc->private->thread_db = tdb; + proc->priv->thread_db = tdb; tdb->handle = handle; @@ -605,7 +605,7 @@ try_thread_db_load_1 (void *handle) if (required) \ { \ free (tdb); \ - proc->private->thread_db = NULL; \ + proc->priv->thread_db = NULL; \ return 0; \ } \ } \ @@ -621,7 +621,7 @@ try_thread_db_load_1 (void *handle) if (debug_threads) debug_printf ("td_ta_new(): %s\n", thread_db_err_str (err)); free (tdb); - proc->private->thread_db = NULL; + proc->priv->thread_db = NULL; return 0; } @@ -858,7 +858,7 @@ switch_to_process (struct process_info *proc) static void disable_thread_event_reporting (struct process_info *proc) { - struct thread_db *thread_db = proc->private->thread_db; + struct thread_db *thread_db = proc->priv->thread_db; if (thread_db) { td_err_e (*td_ta_clear_event_p) (const td_thragent_t *ta, @@ -890,7 +890,7 @@ disable_thread_event_reporting (struct process_info *proc) static void remove_thread_event_breakpoints (struct process_info *proc) { - struct thread_db *thread_db = proc->private->thread_db; + struct thread_db *thread_db = proc->priv->thread_db; if (thread_db->td_create_bp != NULL) { @@ -908,7 +908,7 @@ remove_thread_event_breakpoints (struct process_info *proc) void thread_db_detach (struct process_info *proc) { - struct thread_db *thread_db = proc->private->thread_db; + struct thread_db *thread_db = proc->priv->thread_db; if (thread_db) { @@ -922,7 +922,7 @@ thread_db_detach (struct process_info *proc) void thread_db_mourn (struct process_info *proc) { - struct thread_db *thread_db = proc->private->thread_db; + struct thread_db *thread_db = proc->priv->thread_db; if (thread_db) { td_err_e (*td_ta_delete_p) (td_thragent_t *); @@ -941,7 +941,7 @@ thread_db_mourn (struct process_info *proc) #endif /* USE_LIBTHREAD_DB_DIRECTLY */ free (thread_db); - proc->private->thread_db = NULL; + proc->priv->thread_db = NULL; } } diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 7c4b2911b00..19b44977e60 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -7153,7 +7153,7 @@ gdb_agent_helper_thread (void *arg) do { - fd = accept (listen_fd, &sockaddr, &tmp); + fd = accept (listen_fd, (struct sockaddr *) &sockaddr, &tmp); } /* It seems an ERESTARTSYS can escape out of accept. */ while (fd == -512 || (fd == -1 && errno == EINTR)); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 99d407da002..7b4c9fa44b4 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -288,7 +288,7 @@ gnuv3_rtti_type (struct value *value, const char *class_name; struct type *run_time_type; LONGEST offset_to_top; - char *atsign; + const char *atsign; /* We only have RTTI for class objects. */ if (TYPE_CODE (values_type) != TYPE_CODE_CLASS) diff --git a/gdb/go-lang.c b/gdb/go-lang.c index c013c810cea..f61b931056f 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -197,9 +197,9 @@ unpack_mangled_go_symbol (const char *mangled_name, /* Pointer to "N" if valid "N_" found. */ char *method_type; /* Pointer to the first '.'. */ - char *first_dot; + const char *first_dot; /* Pointer to the last '.'. */ - char *last_dot; + const char *last_dot; /* Non-zero if we saw a pointer indicator. */ int saw_pointer; diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c index 913bad5594c..9b85a57f747 100644 --- a/gdb/guile/guile.c +++ b/gdb/guile/guile.c @@ -65,7 +65,7 @@ static const struct extension_language_ops guile_extension_ops; /* The main struct describing GDB's interface to the Guile extension language. */ -const struct extension_language_defn extension_language_guile = +extern const struct extension_language_defn extension_language_guile = { EXT_LANG_GUILE, "guile", diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index 2ada2bd96dc..7360101f11a 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -198,7 +198,7 @@ struct gdbarch_tdep const struct target_desc *tdesc; /* Register group function. */ - const void *register_reggroup_p; + int (*register_reggroup_p)(struct gdbarch *, int, struct reggroup *); /* Offset of saved PC in jmp_buf. */ int jb_pc_offset; diff --git a/gdb/inferior.h b/gdb/inferior.h index f8e0473a544..0a42cd58c60 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -31,6 +31,13 @@ struct ui_out; struct terminal_info; struct target_desc_info; +/* Reverse execution. */ +enum exec_direction_kind + { + EXEC_FORWARD, + EXEC_REVERSE + }; + #include "ptid.h" /* For bpstat. */ @@ -331,13 +338,6 @@ enum stop_kind STOP_QUIETLY_NO_SIGSTOP }; -/* Reverse execution. */ -enum exec_direction_kind - { - EXEC_FORWARD, - EXEC_REVERSE - }; - /* The current execution direction. This should only be set to enum exec_direction_kind values. It is only an int to make it compatible with make_cleanup_restore_integer. */ diff --git a/gdb/inflow.c b/gdb/inflow.c index 5cf2c2dd8d8..576d71dfbfd 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -99,8 +99,8 @@ inferior_process_group (void) we save our handlers in these two variables and set SIGINT and SIGQUIT to SIG_IGN. */ -static void (*sigint_ours) (); -static void (*sigquit_ours) (); +static void (*sigint_ours) (int); +static void (*sigquit_ours) (int); /* The name of the tty (from the `tty' command) that we're giving to the inferior when starting it up. This is only (and should only @@ -305,9 +305,9 @@ child_terminal_inferior (struct target_ops *self) if (!job_control) { - sigint_ours = (void (*)()) signal (SIGINT, SIG_IGN); + sigint_ours = (void (*)(int)) signal (SIGINT, SIG_IGN); #ifdef SIGQUIT - sigquit_ours = (void (*)()) signal (SIGQUIT, SIG_IGN); + sigquit_ours = (void (*)(int)) signal (SIGQUIT, SIG_IGN); #endif } @@ -396,13 +396,13 @@ child_terminal_ours_1 (int output_only) #ifdef SIGTTOU /* Ignore this signal since it will happen when we try to set the pgrp. */ - void (*osigttou) () = NULL; + void (*osigttou) (int) = NULL; #endif int result; #ifdef SIGTTOU if (job_control) - osigttou = (void (*)()) signal (SIGTTOU, SIG_IGN); + osigttou = (void (*)(int)) signal (SIGTTOU, SIG_IGN); #endif xfree (tinfo->ttystate); @@ -690,9 +690,9 @@ new_tty (void) tty = open ("/dev/tty", O_RDWR); if (tty > 0) { - void (*osigttou) (); + void (*osigttou) (int); - osigttou = (void (*)()) signal (SIGTTOU, SIG_IGN); + osigttou = (void (*)(int)) signal (SIGTTOU, SIG_IGN); ioctl (tty, TIOCNOTTY, 0); close (tty); signal (SIGTTOU, osigttou); @@ -767,7 +767,7 @@ pass_signal (int signo) #endif } -static void (*osig) (); +static void (*osig) (int); static int osig_set; void @@ -778,7 +778,7 @@ set_sigint_trap (void) if (inf->attach_flag || tinfo->run_terminal) { - osig = (void (*)()) signal (SIGINT, pass_signal); + osig = (void (*)(int)) signal (SIGINT, pass_signal); osig_set = 1; } else diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c index fbb47849414..fcc3509e929 100644 --- a/gdb/jv-typeprint.c +++ b/gdb/jv-typeprint.c @@ -225,7 +225,8 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show, for (j = 0; j < n_overloads; j++) { const char *real_physname; - char *physname, *p; + const char *p; + char *physname; int is_full_physname_constructor; real_physname = TYPE_FN_FIELD_PHYSNAME (f, j); diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index d9aa48867e1..5d8e0e144cc 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -42,7 +42,17 @@ #include "inf-ptrace.h" #include "auxv.h" #include /* for elf_gregset etc. */ + +#ifdef __cplusplus +extern "C" { +#endif + #include "elf-bfd.h" /* for elfcore_write_* */ + +#ifdef __cplusplus +} +#endif + #include "gregset.h" /* for gregset */ #include "gdbcore.h" /* for get_exec_file */ #include /* for isdigit */ diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 4b63b9435f8..9f686039a99 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -26,8 +26,18 @@ #include "gdbcore.h" #include "regcache.h" #include "regset.h" + +#ifdef __cplusplus +extern "C" { +#endif + #include "elf/common.h" #include "elf-bfd.h" /* for elfcore_write_* */ + +#ifdef __cplusplus +} +#endif + #include "inferior.h" #include "cli/cli-utils.h" #include "arch-utils.h" diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 2994b800652..a4470fa54cd 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -814,7 +814,7 @@ try_thread_db_load_1 (struct thread_db_info *info) { const char *library; - library = dladdr_to_soname (*info->td_ta_new_p); + library = dladdr_to_soname ((const void *) *info->td_ta_new_p); if (library == NULL) library = LIBTHREAD_DB_SO; diff --git a/gdb/maint.c b/gdb/maint.c index 30a9d3bbd5e..d9b62da1970 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -698,15 +698,18 @@ extern char etext; static int profiling_state; +EXTERN_C void _mcleanup (void); + static void mcleanup_wrapper (void) { - extern void _mcleanup (void); - if (profiling_state) _mcleanup (); } +EXTERN_C void monstartup (unsigned long, unsigned long); +extern int main(); + static void maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c) @@ -720,9 +723,6 @@ maintenance_set_profile_cmd (char *args, int from_tty, { static int profiling_initialized; - extern void monstartup (unsigned long, unsigned long); - extern int main(); - if (!profiling_initialized) { atexit (mcleanup_wrapper); diff --git a/gdb/psymtab.c b/gdb/psymtab.c index bbcaeba52c8..0d2d7632062 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -980,7 +980,7 @@ dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab, " Full symtab was read (at "); gdb_print_host_address (psymtab->symtab, outfile); fprintf_filtered (outfile, " by function at "); - gdb_print_host_address (psymtab->read_symtab, outfile); + gdb_print_host_address ((const void *) psymtab->read_symtab, outfile); fprintf_filtered (outfile, ")\n"); } diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 07650f73236..38063226459 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -21,6 +21,7 @@ #define GDB_PYTHON_INTERNAL_H #include "extension.h" +#include "extension-priv.h" /* These WITH_* macros are defined by the CPython API checker that comes with the Python plugin for GCC. See: diff --git a/gdb/python/python.c b/gdb/python/python.c index 05df234322b..073d7c57b65 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -105,7 +105,7 @@ const struct extension_language_defn extension_language_python = int gdb_python_initialized; -static PyMethodDef GdbMethods[]; +static PyMethodDef *get_GdbMethods (void); #ifdef IS_PY3K static struct PyModuleDef GdbModuleDef; @@ -1684,7 +1684,7 @@ message == an error message without a stack will be printed."), /* Add _gdb module to the list of known built-in modules. */ _PyImport_FixupBuiltin (gdb_module, "_gdb"); #else - gdb_module = Py_InitModule ("_gdb", GdbMethods); + gdb_module = Py_InitModule ("_gdb", get_GdbMethods()); #endif if (gdb_module == NULL) goto fail; @@ -1997,6 +1997,12 @@ Return a tuple containing all inferiors." }, {NULL, NULL, 0, NULL} }; +static PyMethodDef * +get_GdbMethods (void) +{ + return GdbMethods; +} + #ifdef IS_PY3K static struct PyModuleDef GdbModuleDef = { diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 56000013a0e..76dbce3bf91 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -177,7 +177,7 @@ net_open (struct serial *scb, const char *name) else if (strncmp (name, "tcp:", 4) == 0) name = name + 4; - port_str = strchr (name, ':'); + port_str = strchr ((char *) name, ':'); if (!port_str) error (_("net_open: No colon in host name!")); /* Shouldn't ever diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 54417b04f26..47fbfbe23bb 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1236,7 +1236,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, { /* gcc-2.6 or later (when using -fvtable-thunks) emits a unique named type for a vtable entry. - Some gdb code depends on that specific name. */ + Some GDB code depends on that specific name. */ extern const char vtbl_ptr_name[]; if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 390900194e3..4de0391c986 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -138,7 +138,7 @@ debug_qf_map_symtabs_matching_filename (struct objfile *objfile, "qf->map_symtabs_matching_filename (%s, \"%s\", \"%s\", %s, %s)\n", debug_objfile_name (objfile), name, real_path ? real_path : NULL, - host_address_to_string (callback), + host_address_to_string ((void *) callback), host_address_to_string (data)); retval = debug_data->real_sf->qf->map_symtabs_matching_filename @@ -270,10 +270,10 @@ debug_qf_map_matching_symbols (struct objfile *objfile, "qf->map_matching_symbols (%s, \"%s\", %s, %d, %s, %s, %s, %s)\n", debug_objfile_name (objfile), name, domain_name (the_namespace), global, - host_address_to_string (callback), + host_address_to_string ((void *) callback), host_address_to_string (data), - host_address_to_string (match), - host_address_to_string (ordered_compare)); + host_address_to_string ((void *) match), + host_address_to_string ((void *) ordered_compare)); debug_data->real_sf->qf->map_matching_symbols (objfile, name, the_namespace, global, @@ -295,8 +295,8 @@ debug_qf_expand_symtabs_matching fprintf_filtered (gdb_stdlog, "qf->expand_symtabs_matching (%s, %s, %s, %s, %s)\n", debug_objfile_name (objfile), - host_address_to_string (file_matcher), - host_address_to_string (symbol_matcher), + host_address_to_string ((void *) file_matcher), + host_address_to_string ((void *) symbol_matcher), search_domain_name (kind), host_address_to_string (data)); @@ -345,7 +345,7 @@ debug_qf_map_symbol_filenames (struct objfile *objfile, fprintf_filtered (gdb_stdlog, "qf->map_symbol_filenames (%s, %s, %s, %d)\n", debug_objfile_name (objfile), - host_address_to_string (fun), + host_address_to_string ((void *) fun), host_address_to_string (data), need_fullname); diff --git a/gdb/symfile.c b/gdb/symfile.c index b0086b0ec9d..dcfd3fd1fa7 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2909,7 +2909,7 @@ enum language deduce_language_from_filename (const char *filename) { int i; - char *cp; + const char *cp; if (filename != NULL) if ((cp = strrchr (filename, '.')) != NULL) diff --git a/gdb/symtab.c b/gdb/symtab.c index c13d887c6bc..baec1061228 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -415,8 +415,8 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id) int is_constructor; int is_destructor = is_destructor_name (physname); /* Need a new type prefix. */ - char *const_prefix = method->is_const ? "C" : ""; - char *volatile_prefix = method->is_volatile ? "V" : ""; + const char *const_prefix = method->is_const ? "C" : ""; + const char *volatile_prefix = method->is_volatile ? "V" : ""; char buf[20]; int len = (newname == NULL ? 0 : strlen (newname)); diff --git a/gdb/target.h b/gdb/target.h index 492ecb515ed..c6c2c389c71 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -38,6 +38,17 @@ struct static_tracepoint_marker; struct traceframe_info; struct expression; struct dcache_struct; +struct target_section; + +/* Holds an array of target sections. Defined by [SECTIONS..SECTIONS_END[. */ + +struct target_section_table +{ + struct target_section *sections; + struct target_section *sections_end; +}; + +#include "inferior.h" /* This include file defines the interface between the main part of the debugger, and the part which is target-specific, or @@ -2084,14 +2095,6 @@ struct target_section void *owner; }; -/* Holds an array of target sections. Defined by [SECTIONS..SECTIONS_END[. */ - -struct target_section_table -{ - struct target_section *sections; - struct target_section *sections_end; -}; - /* Return the "section" containing the specified address. */ struct target_section *target_section_by_addr (struct target_ops *target, CORE_ADDR addr); diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 761d203eae5..fe8b827afde 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -44,6 +44,7 @@ /* This redefines CTRL if it is not already defined, so it must come after terminal state releated include files like and "gdb_curses.h". */ + #include "readline/readline.h" int @@ -129,9 +130,9 @@ static struct ui_file *tui_old_stderr; struct ui_out *tui_old_uiout; /* Readline previous hooks. */ -static Function *tui_old_rl_getc_function; +static rl_getc_func_t *tui_old_rl_getc_function; static VFunction *tui_old_rl_redisplay_function; -static VFunction *tui_old_rl_prep_terminal; +static rl_vintfunc_t *tui_old_rl_prep_terminal; static VFunction *tui_old_rl_deprep_terminal; static int tui_old_rl_echoing_p; @@ -207,7 +208,7 @@ tui_redisplay_readline (void) int c_line; int in; WINDOW *w; - char *prompt; + const char *prompt; int start_line; /* Detect when we temporarily left SingleKey and now the readline @@ -371,12 +372,13 @@ print_filename (const char *to_print, const char *full_pathname) return printed_len; } +EXTERN_C int _rl_abort_internal (); + /* The user must press "y" or "n". Non-zero return means "y" pressed. Comes from readline/complete.c. */ static int get_y_or_n (void) { - extern int _rl_abort_internal (); int c; for (;;) @@ -392,6 +394,11 @@ get_y_or_n (void) } } +typedef int QSFUNC (const void *, const void *); +EXTERN_C int _rl_qsort_string_compare (const void *, + const void *); +extern int _rl_print_completions_horizontally; + /* A convenience function for displaying a list of strings in columnar format on readline's output stream. MATCHES is the list of strings, in argv format, LEN is the number of strings in MATCHES, @@ -402,11 +409,6 @@ get_y_or_n (void) static void tui_rl_display_match_list (char **matches, int len, int max) { - typedef int QSFUNC (const void *, const void *); - extern int _rl_qsort_string_compare (const void *, - const void *); - extern int _rl_print_completions_horizontally; - int count, limit, printed_len; int i, j, k, l; const char *temp; diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 2c53e05aa40..6c870a194b3 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -246,7 +246,7 @@ tui_show_register_group (struct reggroup *group, { if (!refresh_values_only || allocated_here) { - TUI_DATA_WIN->generic.content = (void*) NULL; + TUI_DATA_WIN->generic.content = (void **) NULL; TUI_DATA_WIN->generic.content_size = 0; tui_add_content_elements (&TUI_DATA_WIN->generic, nr_regs); display_info->regs_content diff --git a/include/libiberty.h b/include/libiberty.h index 78c42eb88f1..6fef7dd284f 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -107,7 +107,19 @@ extern int countargv (char**); is 1, we found it so don't provide any declaration at all. */ #if !HAVE_DECL_BASENAME #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) -extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); + +/* +/usr/include/string.h:598:33: error: new declaration ‘const char* basename(const char*)’ + __THROW __asm ("basename") __nonnull ((1)); + ^ +In file included from /home/pedro/gdb/mygit/src/gdb/defs.h:97:0, + from /home/pedro/gdb/mygit/src/gdb/gdb.c:19: +/home/pedro/gdb/mygit/src/gdb/../include/libiberty.h:110:14: error: ambiguates old declaration ‘char* basename(const char*)’ + extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); + ^ +make: *** [gdb.o] Error 1 +*/ + //extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); #else /* Do not allow basename to be used if there is no prototype seen. We either need to use the above prototype or have one from -- cgit v1.2.1