/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
This file is part of GDB.
gdbarch_skip_entrypoint_ftype *skip_entrypoint;
gdbarch_inner_than_ftype *inner_than;
gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
- gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
+ gdbarch_breakpoint_kind_from_pc_ftype *breakpoint_kind_from_pc;
+ gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind;
+ gdbarch_breakpoint_kind_from_current_state_ftype *breakpoint_kind_from_current_state;
gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
gdbarch->pointer_to_address = unsigned_pointer_to_address;
gdbarch->address_to_pointer = unsigned_address_to_pointer;
gdbarch->return_in_first_hidden_param_p = default_return_in_first_hidden_param_p;
- gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
+ gdbarch->breakpoint_from_pc = default_breakpoint_from_pc;
+ gdbarch->sw_breakpoint_from_kind = NULL;
+ gdbarch->breakpoint_kind_from_current_state = default_breakpoint_kind_from_current_state;
gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
gdbarch->remote_register_number = default_remote_register_number;
struct ui_file *log;
struct cleanup *cleanups;
long length;
- char *buf;
log = mem_fileopen ();
cleanups = make_cleanup_ui_file_delete (log);
/* Skip verify of skip_entrypoint, has predicate. */
if (gdbarch->inner_than == 0)
fprintf_unfiltered (log, "\n\tinner_than");
- if (gdbarch->breakpoint_from_pc == 0)
- fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
- /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
+ /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
+ if (gdbarch->breakpoint_kind_from_pc == 0)
+ fprintf_unfiltered (log, "\n\tbreakpoint_kind_from_pc");
+ /* Skip verify of sw_breakpoint_from_kind, invalid_p == 0 */
+ /* Skip verify of breakpoint_kind_from_current_state, invalid_p == 0 */
/* Skip verify of adjust_breakpoint_address, has predicate. */
/* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
/* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
/* Skip verify of gcc_target_options, invalid_p == 0 */
/* Skip verify of gnu_triplet_regexp, invalid_p == 0 */
/* Skip verify of addressable_memory_unit_size, invalid_p == 0 */
- buf = ui_file_xstrdup (log, &length);
- make_cleanup (xfree, buf);
- if (length > 0)
+ std::string buf = ui_file_as_string (log);
+ if (!buf.empty ())
internal_error (__FILE__, __LINE__,
_("verify_gdbarch: the following are invalid ...%s"),
- buf);
+ buf.c_str ());
do_cleanups (cleanups);
}
fprintf_unfiltered (file,
"gdbarch_dump: breakpoint_from_pc = <%s>\n",
host_address_to_string (gdbarch->breakpoint_from_pc));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: breakpoint_kind_from_current_state = <%s>\n",
+ host_address_to_string (gdbarch->breakpoint_kind_from_current_state));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: breakpoint_kind_from_pc = <%s>\n",
+ host_address_to_string (gdbarch->breakpoint_kind_from_pc));
fprintf_unfiltered (file,
"gdbarch_dump: byte_order = %s\n",
plongest (gdbarch->byte_order));
fprintf_unfiltered (file,
"gdbarch_dump: relocate_instruction = <%s>\n",
host_address_to_string (gdbarch->relocate_instruction));
- fprintf_unfiltered (file,
- "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
- host_address_to_string (gdbarch->remote_breakpoint_from_pc));
fprintf_unfiltered (file,
"gdbarch_dump: remote_register_number = <%s>\n",
host_address_to_string (gdbarch->remote_register_number));
fprintf_unfiltered (file,
"gdbarch_dump: static_transform_name = <%s>\n",
host_address_to_string (gdbarch->static_transform_name));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: sw_breakpoint_from_kind = <%s>\n",
+ host_address_to_string (gdbarch->sw_breakpoint_from_kind));
fprintf_unfiltered (file,
"gdbarch_dump: syscalls_info = %s\n",
host_address_to_string (gdbarch->syscalls_info));
gdbarch->breakpoint_from_pc = breakpoint_from_pc;
}
+int
+gdbarch_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->breakpoint_kind_from_pc != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_kind_from_pc called\n");
+ return gdbarch->breakpoint_kind_from_pc (gdbarch, pcptr);
+}
+
void
-gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
+set_gdbarch_breakpoint_kind_from_pc (struct gdbarch *gdbarch,
+ gdbarch_breakpoint_kind_from_pc_ftype breakpoint_kind_from_pc)
+{
+ gdbarch->breakpoint_kind_from_pc = breakpoint_kind_from_pc;
+}
+
+const gdb_byte *
+gdbarch_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->sw_breakpoint_from_kind != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_sw_breakpoint_from_kind called\n");
+ return gdbarch->sw_breakpoint_from_kind (gdbarch, kind, size);
+}
+
+void
+set_gdbarch_sw_breakpoint_from_kind (struct gdbarch *gdbarch,
+ gdbarch_sw_breakpoint_from_kind_ftype sw_breakpoint_from_kind)
+{
+ gdbarch->sw_breakpoint_from_kind = sw_breakpoint_from_kind;
+}
+
+int
+gdbarch_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR *pcptr)
{
gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
+ gdb_assert (gdbarch->breakpoint_kind_from_current_state != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
- gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_kind_from_current_state called\n");
+ return gdbarch->breakpoint_kind_from_current_state (gdbarch, regcache, pcptr);
}
void
-set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
- gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
+set_gdbarch_breakpoint_kind_from_current_state (struct gdbarch *gdbarch,
+ gdbarch_breakpoint_kind_from_current_state_ftype breakpoint_kind_from_current_state)
{
- gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
+ gdbarch->breakpoint_kind_from_current_state = breakpoint_kind_from_current_state;
}
int
return gdbarch->software_single_step != NULL;
}
-int
-gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
+VEC (CORE_ADDR) *
+gdbarch_software_single_step (struct gdbarch *gdbarch, struct regcache *regcache)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->software_single_step != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
- return gdbarch->software_single_step (frame);
+ return gdbarch->software_single_step (regcache);
}
void