forked from Imagelibrary/binutils-gdb
Determine the kind of single step breakpoint
This patch adds a new gdbarch method breakpoint_kind_from_current_state for single step breakpoint, and uses it in breakpoint_kind. gdb: 2016-11-03 Yao Qi <yao.qi@linaro.org> * arch-utils.c (default_breakpoint_kind_from_current_state): New function. * arch-utils.h (default_breakpoint_kind_from_current_state): Declare. * arm-tdep.c (arm_breakpoint_kind_from_current_state): New function. (arm_gdbarch_init): Call set_gdbarch_breakpoint_kind_from_current_state. * breakpoint.c (breakpoint_kind): Call gdbarch_breakpoint_kind_from_current_state for single step breakpoint. Update comments. * gdbarch.sh (breakpoint_kind_from_current_state): New. * gdbarch.c, gdbarch.h: Regenerate.
This commit is contained in:
@@ -232,6 +232,7 @@ struct gdbarch
|
||||
gdbarch_breakpoint_from_pc_ftype *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;
|
||||
@@ -406,6 +407,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
|
||||
gdbarch->return_in_first_hidden_param_p = default_return_in_first_hidden_param_p;
|
||||
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;
|
||||
@@ -587,6 +589,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
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 */
|
||||
@@ -795,6 +798,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
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));
|
||||
@@ -2822,6 +2828,23 @@ set_gdbarch_sw_breakpoint_from_kind (struct gdbarch *gdbarch,
|
||||
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->breakpoint_kind_from_current_state != NULL);
|
||||
if (gdbarch_debug >= 2)
|
||||
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_breakpoint_kind_from_current_state (struct gdbarch *gdbarch,
|
||||
gdbarch_breakpoint_kind_from_current_state_ftype breakpoint_kind_from_current_state)
|
||||
{
|
||||
gdbarch->breakpoint_kind_from_current_state = breakpoint_kind_from_current_state;
|
||||
}
|
||||
|
||||
int
|
||||
gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user