diff options
author | Tom Tromey <tromey@redhat.com> | 2014-01-16 13:00:07 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-19 07:48:49 -0700 |
commit | ac01945bf17f3699de5493da23f14ea92549617a (patch) | |
tree | 3571a0ad55eb48e0d07f9fd2b5e04f55a3162716 /gdb/target.c | |
parent | 8476dc92e4d8f8e8ebcdbaf0080b70876dfcfb27 (diff) | |
download | gdb-ac01945bf17f3699de5493da23f14ea92549617a.zip gdb-ac01945bf17f3699de5493da23f14ea92549617a.tar.gz gdb-ac01945bf17f3699de5493da23f14ea92549617a.tar.bz2 |
convert to_get_unwinder and to_get_tailcall_unwinder to methods
This converts to_get_unwinder and to_get_tailcall_unwinder to methods
and arranges for them to use the new delegation scheme.
This just lets us avoid having a differing style (neither new-style
nor INHERIT) of delegation in the tree.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.c (target_get_unwinder): Rewrite.
(target_get_tailcall_unwinder): Rewrite.
* record-btrace.c (record_btrace_to_get_unwinder): New function.
(record_btrace_to_get_tailcall_unwinder): New function.
(init_record_btrace_ops): Update.
* target.h (struct target_ops) <to_get_unwinder,
to_get_tailcall_unwinder>: Now function pointers. Use
TARGET_DEFAULT_RETURN.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/gdb/target.c b/gdb/target.c index 911c279..4adc094 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3822,13 +3822,7 @@ debug_to_prepare_to_store (struct target_ops *self, struct regcache *regcache) const struct frame_unwind * target_get_unwinder (void) { - struct target_ops *t; - - for (t = current_target.beneath; t != NULL; t = t->beneath) - if (t->to_get_unwinder != NULL) - return t->to_get_unwinder; - - return NULL; + return current_target.to_get_unwinder (¤t_target); } /* See target.h. */ @@ -3836,13 +3830,7 @@ target_get_unwinder (void) const struct frame_unwind * target_get_tailcall_unwinder (void) { - struct target_ops *t; - - for (t = current_target.beneath; t != NULL; t = t->beneath) - if (t->to_get_tailcall_unwinder != NULL) - return t->to_get_tailcall_unwinder; - - return NULL; + return current_target.to_get_tailcall_unwinder (¤t_target); } /* Default implementation of to_decr_pc_after_break. */ |