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

@@ -1283,7 +1283,7 @@ record_full_wait_1 (struct target_ops *ops,
struct gdbarch *gdbarch
= get_regcache_arch (regcache);
CORE_ADDR decr_pc_after_break
= gdbarch_decr_pc_after_break (gdbarch);
= target_decr_pc_after_break (gdbarch);
if (decr_pc_after_break)
regcache_write_pc (regcache,
tmp_pc + decr_pc_after_break);
@@ -1356,7 +1356,7 @@ record_full_wait_1 (struct target_ops *ops,
tmp_pc = regcache_read_pc (regcache);
if (breakpoint_inserted_here_p (aspace, tmp_pc))
{
int decr_pc_after_break = gdbarch_decr_pc_after_break (gdbarch);
int decr_pc_after_break = target_decr_pc_after_break (gdbarch);
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
@@ -1438,7 +1438,7 @@ record_full_wait_1 (struct target_ops *ops,
if (breakpoint_inserted_here_p (aspace, tmp_pc))
{
int decr_pc_after_break
= gdbarch_decr_pc_after_break (gdbarch);
= target_decr_pc_after_break (gdbarch);
if (record_debug)
fprintf_unfiltered (gdb_stdlog,