X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fgdbarch.c;h=e7d4ccca9e7d6ebaa0a4dc37add2929ad2026613;hb=a4425a57c7ad127b30cdfe271c870d5c8ebcfad7;hp=7b93d003a7293a4273c58b6ff31e4932a8cd42f5;hpb=aa7ca1bb443e8c2baad17392f395d1556fecfafa;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 7b93d003a7..e7d4ccca9e 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -3,7 +3,7 @@ /* Dynamic architecture support for GDB, the GNU debugger. - Copyright (C) 1998-2019 Free Software Foundation, Inc. + Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -172,7 +172,6 @@ struct gdbarch */ - int bits_big_endian; int short_bit; int int_bit; int long_bit; @@ -346,6 +345,7 @@ struct gdbarch gdbarch_insn_is_call_ftype *insn_is_call; gdbarch_insn_is_ret_ftype *insn_is_ret; gdbarch_insn_is_jump_ftype *insn_is_jump; + gdbarch_program_breakpoint_here_p_ftype *program_breakpoint_here_p; gdbarch_auxv_parse_ftype *auxv_parse; gdbarch_print_auxv_entry_ftype *print_auxv_entry; gdbarch_vsyscall_range_ftype *vsyscall_range; @@ -389,7 +389,6 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->target_desc = info->target_desc; /* Force the explicit initialization of these. */ - gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG); gdbarch->short_bit = 2*TARGET_CHAR_BIT; gdbarch->int_bit = 4*TARGET_CHAR_BIT; gdbarch->long_bit = 4*TARGET_CHAR_BIT; @@ -466,6 +465,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->insn_is_call = default_insn_is_call; gdbarch->insn_is_ret = default_insn_is_ret; gdbarch->insn_is_jump = default_insn_is_jump; + gdbarch->program_breakpoint_here_p = default_program_breakpoint_here_p; gdbarch->print_auxv_entry = default_print_auxv_entry; gdbarch->vsyscall_range = default_vsyscall_range; gdbarch->infcall_mmap = default_infcall_mmap; @@ -528,7 +528,6 @@ verify_gdbarch (struct gdbarch *gdbarch) if (gdbarch->bfd_arch_info == NULL) log.puts ("\n\tbfd_arch_info"); /* Check those that need to be defined for the given multi-arch level. */ - /* Skip verify of bits_big_endian, invalid_p == 0 */ /* Skip verify of short_bit, invalid_p == 0 */ /* Skip verify of int_bit, invalid_p == 0 */ /* Skip verify of long_bit, invalid_p == 0 */ @@ -711,6 +710,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of insn_is_call, invalid_p == 0 */ /* Skip verify of insn_is_ret, invalid_p == 0 */ /* Skip verify of insn_is_jump, invalid_p == 0 */ + /* Skip verify of program_breakpoint_here_p, invalid_p == 0 */ /* Skip verify of auxv_parse, has predicate. */ /* Skip verify of print_auxv_entry, invalid_p == 0 */ /* Skip verify of vsyscall_range, invalid_p == 0 */ @@ -816,9 +816,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: bfd_arch_info = %s\n", gdbarch_bfd_arch_info (gdbarch)->printable_name); - fprintf_unfiltered (file, - "gdbarch_dump: bits_big_endian = %s\n", - plongest (gdbarch->bits_big_endian)); fprintf_unfiltered (file, "gdbarch_dump: breakpoint_from_pc = <%s>\n", host_address_to_string (gdbarch->breakpoint_from_pc)); @@ -1254,6 +1251,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: process_record_signal = <%s>\n", host_address_to_string (gdbarch->process_record_signal)); + fprintf_unfiltered (file, + "gdbarch_dump: program_breakpoint_here_p = <%s>\n", + host_address_to_string (gdbarch->program_breakpoint_here_p)); fprintf_unfiltered (file, "gdbarch_dump: ps_regnum = %s\n", plongest (gdbarch->ps_regnum)); @@ -1564,23 +1564,6 @@ gdbarch_target_desc (struct gdbarch *gdbarch) return gdbarch->target_desc; } -int -gdbarch_bits_big_endian (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - /* Skip verify of bits_big_endian, invalid_p == 0 */ - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n"); - return gdbarch->bits_big_endian; -} - -void -set_gdbarch_bits_big_endian (struct gdbarch *gdbarch, - int bits_big_endian) -{ - gdbarch->bits_big_endian = bits_big_endian; -} - int gdbarch_short_bit (struct gdbarch *gdbarch) { @@ -3953,7 +3936,7 @@ gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch) return gdbarch->displaced_step_copy_insn != NULL; } -struct displaced_step_closure * +displaced_step_closure_up gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs) { gdb_assert (gdbarch != NULL); @@ -4951,6 +4934,23 @@ set_gdbarch_insn_is_jump (struct gdbarch *gdbarch, gdbarch->insn_is_jump = insn_is_jump; } +bool +gdbarch_program_breakpoint_here_p (struct gdbarch *gdbarch, CORE_ADDR address) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->program_breakpoint_here_p != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_program_breakpoint_here_p called\n"); + return gdbarch->program_breakpoint_here_p (gdbarch, address); +} + +void +set_gdbarch_program_breakpoint_here_p (struct gdbarch *gdbarch, + gdbarch_program_breakpoint_here_p_ftype program_breakpoint_here_p) +{ + gdbarch->program_breakpoint_here_p = program_breakpoint_here_p; +} + int gdbarch_auxv_parse_p (struct gdbarch *gdbarch) { @@ -5043,7 +5043,7 @@ set_gdbarch_infcall_munmap (struct gdbarch *gdbarch, gdbarch->infcall_munmap = infcall_munmap; } -char * +std::string gdbarch_gcc_target_options (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); @@ -5571,8 +5571,9 @@ target_gdbarch (void) return current_inferior ()->gdbarch; } +void _initialize_gdbarch (); void -_initialize_gdbarch (void) +_initialize_gdbarch () { add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\ Set architecture debugging."), _("\