--- a/target.h +++ b/target.h @@ -536,6 +536,9 @@ struct target_ops /* Can target execute in reverse? */ int (*to_can_execute_reverse) (); + /* Can target adjust pc after break with itself? */ + int (*to_adjust_pc_with_itself) (ptid_t ptid); + /* Does this target support debugging multiple processes simultaneously? */ int (*to_supports_multi_process) (void); @@ -1155,6 +1158,11 @@ extern int target_stopped_data_address_p (current_target.to_can_execute_reverse ? \ current_target.to_can_execute_reverse () : 0) +/* Can target adjust pc after break with itself? */ +#define target_adjust_pc_with_itself(ptid) \ + (current_target.to_adjust_pc_with_itself ? \ + current_target.to_adjust_pc_with_itself (ptid) : 0) + extern const struct target_desc *target_read_description (struct target_ops *); #define target_get_ada_task_ptid(lwp, tid) \ --- a/target.c +++ b/target.c @@ -468,6 +468,7 @@ update_current_target (void) INHERIT (to_make_corefile_notes, t); INHERIT (to_get_thread_local_address, t); INHERIT (to_can_execute_reverse, t); + INHERIT (to_adjust_pc_with_itself, t); /* Do not inherit to_read_description. */ INHERIT (to_get_ada_task_ptid, t); /* Do not inherit to_search_memory. */ --- a/infrun.c +++ b/infrun.c @@ -1944,6 +1944,9 @@ adjust_pc_after_break (struct execution_ target with both of these set in GDB history, and it seems unlikely to be correct, so gdbarch_have_nonsteppable_watchpoint is not checked here. */ + if (target_adjust_pc_with_itself (ecs->ptid)) + return; + if (ecs->ws.kind != TARGET_WAITKIND_STOPPED) return;