diff options
author | Tom Tromey <tromey@redhat.com> | 2014-01-16 11:39:32 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-19 07:48:47 -0700 |
commit | c0eca49f4e3382163153a1cdbb090a25b4a32e31 (patch) | |
tree | 925e767f99b1ffb1cff3c7d3bdaff7272efb14cc /gdb/target.c | |
parent | 596b6b39ab5f26a86980bc9aa6cf348d32d244b4 (diff) | |
download | gdb-c0eca49f4e3382163153a1cdbb090a25b4a32e31.zip gdb-c0eca49f4e3382163153a1cdbb090a25b4a32e31.tar.gz gdb-c0eca49f4e3382163153a1cdbb090a25b4a32e31.tar.bz2 |
convert to_decr_pc_after_break
This converts to_decr_pc_after_break to the new style of delegation,
removing forward_target_decr_pc_after_break.
2014-02-19 Tom Tromey <tromey@redhat.com>
* record-btrace.c (record_btrace_decr_pc_after_break): Delegate
directly.
* target-delegates.c: Rebuild.
* target.h (struct target_ops) <to_decr_pc_after_break>: Use
TARGET_DEFAULT_FUNC.
* target.c (default_target_decr_pc_after_break): Rename from
forward_target_decr_pc_after_break. Simplify.
(target_decr_pc_after_break): Rely on delegation.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/target.c b/gdb/target.c index e816f71..911c279 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -108,6 +108,9 @@ static int find_default_is_async_p (struct target_ops *ignore); static enum exec_direction_kind default_execution_direction (struct target_ops *self); +static CORE_ADDR default_target_decr_pc_after_break (struct target_ops *ops, + struct gdbarch *gdbarch); + #include "target-delegates.c" static void init_dummy_target (void); @@ -3842,16 +3845,12 @@ target_get_tailcall_unwinder (void) return NULL; } -/* See target.h. */ +/* Default implementation of to_decr_pc_after_break. */ -CORE_ADDR -forward_target_decr_pc_after_break (struct target_ops *ops, +static CORE_ADDR +default_target_decr_pc_after_break (struct target_ops *ops, struct gdbarch *gdbarch) { - for (; ops != NULL; ops = ops->beneath) - if (ops->to_decr_pc_after_break != NULL) - return ops->to_decr_pc_after_break (ops, gdbarch); - return gdbarch_decr_pc_after_break (gdbarch); } @@ -3860,7 +3859,7 @@ forward_target_decr_pc_after_break (struct target_ops *ops, CORE_ADDR target_decr_pc_after_break (struct gdbarch *gdbarch) { - return forward_target_decr_pc_after_break (current_target.beneath, gdbarch); + return current_target.to_decr_pc_after_break (¤t_target, gdbarch); } static int |