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.
This commit is contained in:
Tom Tromey
2014-01-16 13:00:07 -07:00
parent 8476dc92e4
commit ac01945bf1
5 changed files with 71 additions and 20 deletions

View File

@ -1108,10 +1108,14 @@ struct target_ops
int (*to_augmented_libraries_svr4_read) (struct target_ops *)
TARGET_DEFAULT_RETURN (0);
/* Those unwinders are tried before any other arch unwinders. Use NULL if
it is not used. */
const struct frame_unwind *to_get_unwinder;
const struct frame_unwind *to_get_tailcall_unwinder;
/* Those unwinders are tried before any other arch unwinders. If
SELF doesn't have unwinders, it should delegate to the
"beneath" target. */
const struct frame_unwind *(*to_get_unwinder) (struct target_ops *self)
TARGET_DEFAULT_RETURN (NULL);
const struct frame_unwind *(*to_get_tailcall_unwinder) (struct target_ops *self)
TARGET_DEFAULT_RETURN (NULL);
/* Return the number of bytes by which the PC needs to be decremented
after executing a breakpoint instruction.