/* 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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/* This file was created with the aid of ``gdbarch.sh''.
-
- The Bourne shell script ``gdbarch.sh'' creates the files
- ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
- against the existing ``gdbarch.[hc]''. Any differences found
- being reported.
-
- If editing this file, please also run gdbarch.sh and merge any
- changes into that script. Conversely, when making sweeping changes
- to this file, modifying gdbarch.sh and using its output may prove
- easier. */
+/* This file was created with the aid of ``gdbarch.sh''. */
#include "defs.h"
*/
- int bits_big_endian;
int short_bit;
int int_bit;
int long_bit;
gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
- gdbarch_displaced_step_location_ftype *displaced_step_location;
+ gdbarch_displaced_step_prepare_ftype *displaced_step_prepare;
+ gdbarch_displaced_step_finish_ftype *displaced_step_finish;
gdbarch_relocate_instruction_ftype *relocate_instruction;
gdbarch_overlay_update_ftype *overlay_update;
gdbarch_core_read_description_ftype *core_read_description;
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;
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;
gdbarch->skip_permanent_breakpoint = default_skip_permanent_breakpoint;
gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
gdbarch->displaced_step_fixup = NULL;
- gdbarch->displaced_step_location = NULL;
+ gdbarch->displaced_step_finish = NULL;
gdbarch->relocate_instruction = NULL;
gdbarch->has_shared_address_space = default_has_shared_address_space;
gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
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;
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 */
/* Skip verify of displaced_step_copy_insn, has predicate. */
/* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
/* Skip verify of displaced_step_fixup, has predicate. */
- if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
- log.puts ("\n\tdisplaced_step_location");
+ /* Skip verify of displaced_step_prepare, has predicate. */
+ if ((! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_prepare))
+ log.puts ("\n\tdisplaced_step_finish");
/* Skip verify of relocate_instruction, has predicate. */
/* Skip verify of overlay_update, has predicate. */
/* Skip verify of core_read_description, has predicate. */
/* 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 */
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));
fprintf_unfiltered (file,
"gdbarch_dump: displaced_step_copy_insn = <%s>\n",
host_address_to_string (gdbarch->displaced_step_copy_insn));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: displaced_step_finish = <%s>\n",
+ host_address_to_string (gdbarch->displaced_step_finish));
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
gdbarch_displaced_step_fixup_p (gdbarch));
"gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
host_address_to_string (gdbarch->displaced_step_hw_singlestep));
fprintf_unfiltered (file,
- "gdbarch_dump: displaced_step_location = <%s>\n",
- host_address_to_string (gdbarch->displaced_step_location));
+ "gdbarch_dump: gdbarch_displaced_step_prepare_p() = %d\n",
+ gdbarch_displaced_step_prepare_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: displaced_step_prepare = <%s>\n",
+ host_address_to_string (gdbarch->displaced_step_prepare));
fprintf_unfiltered (file,
"gdbarch_dump: double_bit = %s\n",
plongest (gdbarch->double_bit));
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));
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)
{
return gdbarch->displaced_step_copy_insn != NULL;
}
-struct displaced_step_closure *
+displaced_step_copy_insn_closure_up
gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
{
gdb_assert (gdbarch != NULL);
}
int
-gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
+gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL);
}
void
-gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
+gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->displaced_step_fixup != NULL);
gdbarch->displaced_step_fixup = displaced_step_fixup;
}
-CORE_ADDR
-gdbarch_displaced_step_location (struct gdbarch *gdbarch)
+int
+gdbarch_displaced_step_prepare_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->displaced_step_location != NULL);
+ return gdbarch->displaced_step_prepare != NULL;
+}
+
+displaced_step_prepare_status
+gdbarch_displaced_step_prepare (struct gdbarch *gdbarch, thread_info *thread)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->displaced_step_prepare != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_prepare called\n");
+ return gdbarch->displaced_step_prepare (gdbarch, thread);
+}
+
+void
+set_gdbarch_displaced_step_prepare (struct gdbarch *gdbarch,
+ gdbarch_displaced_step_prepare_ftype displaced_step_prepare)
+{
+ gdbarch->displaced_step_prepare = displaced_step_prepare;
+}
+
+displaced_step_finish_status
+gdbarch_displaced_step_finish (struct gdbarch *gdbarch, thread_info *thread, gdb_signal sig)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->displaced_step_finish != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
- return gdbarch->displaced_step_location (gdbarch);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_finish called\n");
+ return gdbarch->displaced_step_finish (gdbarch, thread, sig);
}
void
-set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
- gdbarch_displaced_step_location_ftype displaced_step_location)
+set_gdbarch_displaced_step_finish (struct gdbarch *gdbarch,
+ gdbarch_displaced_step_finish_ftype displaced_step_finish)
{
- gdbarch->displaced_step_location = displaced_step_location;
+ gdbarch->displaced_step_finish = displaced_step_finish;
}
int
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)
{
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."), _("\