target: allow decr_pc_after_break to be defined by the target

Allow the target to define which value to use in decr_pc_after_break.
It defaults to gdbarch_decr_pc_after_break (GDBARCH).

2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>

	* target.h (struct target_ops) <to_decr_pc_after_break>: New.
	(forward_target_decr_pc_after_break)
	(target_decr_pc_after_break): New.
	* target.c (forward_target_decr_pc_after_break)
	(target_decr_pc_after_break): New.
	* aix-thread.c (aix_thread_wait): Call target_decr_pc_after_break
	instead of gdbarch_decr_pc_after_break.
	* darwin-nat.c (cancel_breakpoint): Call target_decr_pc_after_break
	instead of gdbarch_decr_pc_after_break.
	* infrun.c (adjust_pc_after_break): Call target_decr_pc_after_break
	instead of gdbarch_decr_pc_after_break.
	* linux-nat.c (cancel_breakpoint): Call target_decr_pc_after_break
	instead of gdbarch_decr_pc_after_break.
	* linux-thread-db.c (check_event): Call target_decr_pc_after_break
	instead of gdbarch_decr_pc_after_break.
	* record-full.c (record_full_wait_1): Call target_decr_pc_after_break
	instead of gdbarch_decr_pc_after_break.
This commit is contained in:
Markus Metzger 2013-12-18 11:09:34 +01:00
parent 6e07b1d27e
commit 118e6252ca
9 changed files with 68 additions and 13 deletions

View file

@ -911,6 +911,12 @@ struct target_ops
const struct frame_unwind *to_get_unwinder;
const struct frame_unwind *to_get_tailcall_unwinder;
/* Return the number of bytes by which the PC needs to be decremented
after executing a breakpoint instruction.
Defaults to gdbarch_decr_pc_after_break (GDBARCH). */
CORE_ADDR (*to_decr_pc_after_break) (struct target_ops *ops,
struct gdbarch *gdbarch);
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@ -2051,4 +2057,11 @@ extern void target_call_history_from (ULONGEST begin, int size, int flags);
/* See to_call_history_range. */
extern void target_call_history_range (ULONGEST begin, ULONGEST end, int flags);
/* See to_decr_pc_after_break. Start searching for the target at OPS. */
extern CORE_ADDR forward_target_decr_pc_after_break (struct target_ops *ops,
struct gdbarch *gdbarch);
/* See to_decr_pc_after_break. */
extern CORE_ADDR target_decr_pc_after_break (struct gdbarch *gdbarch);
#endif /* !defined (TARGET_H) */