From f09e210795cb9e182feb2d02d97a6c9b22a46f53 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Dec 2013 20:26:34 -0700 Subject: [PATCH] convert to_save_record 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. * target.c (target_save_record): Unconditionally delegate. * target.h (struct target_ops) : Use TARGET_DEFAULT_NORETURN. --- gdb/ChangeLog | 7 +++++++ gdb/target-delegates.c | 16 ++++++++++++++++ gdb/target.c | 11 +---------- gdb/target.h | 3 ++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3e54272be4f..4dc1725f86a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2014-02-19 Tom Tromey + + * target-delegates.c: Rebuild. + * target.c (target_save_record): Unconditionally delegate. + * target.h (struct target_ops) : Use + TARGET_DEFAULT_NORETURN. + 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 4e5fd1ae416..62f68cc1ecd 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -1260,6 +1260,19 @@ tdefault_supports_btrace (struct target_ops *self) return 0; } +static void +delegate_save_record (struct target_ops *self, const char *arg1) +{ + self = self->beneath; + self->to_save_record (self, arg1); +} + +static void +tdefault_save_record (struct target_ops *self, const char *arg1) +{ + tcomplain (); +} + static void delegate_delete_record (struct target_ops *self) { @@ -1631,6 +1644,8 @@ install_delegators (struct target_ops *ops) ops->to_can_use_agent = delegate_can_use_agent; if (ops->to_supports_btrace == NULL) ops->to_supports_btrace = delegate_supports_btrace; + if (ops->to_save_record == NULL) + ops->to_save_record = delegate_save_record; if (ops->to_delete_record == NULL) ops->to_delete_record = delegate_delete_record; if (ops->to_record_is_replaying == NULL) @@ -1766,6 +1781,7 @@ install_dummy_methods (struct target_ops *ops) ops->to_use_agent = tdefault_use_agent; ops->to_can_use_agent = tdefault_can_use_agent; ops->to_supports_btrace = tdefault_supports_btrace; + ops->to_save_record = tdefault_save_record; ops->to_delete_record = tdefault_delete_record; ops->to_record_is_replaying = tdefault_record_is_replaying; ops->to_goto_record_begin = tdefault_goto_record_begin; diff --git a/gdb/target.c b/gdb/target.c index 5b8c591b1ce..17077aabba3 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3899,16 +3899,7 @@ target_info_record (void) void target_save_record (const char *filename) { - struct target_ops *t; - - for (t = current_target.beneath; t != NULL; t = t->beneath) - if (t->to_save_record != NULL) - { - t->to_save_record (t, filename); - return; - } - - tcomplain (); + current_target.to_save_record (¤t_target, filename); } /* See target.h. */ diff --git a/gdb/target.h b/gdb/target.h index 0bce110866f..e3d7ed80b5d 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1026,7 +1026,8 @@ struct target_ops void (*to_info_record) (struct target_ops *); /* Save the recorded execution trace into a file. */ - void (*to_save_record) (struct target_ops *, const char *filename); + void (*to_save_record) (struct target_ops *, const char *filename) + TARGET_DEFAULT_NORETURN (tcomplain ()); /* Delete the recorded execution trace from the current position onwards. */ void (*to_delete_record) (struct target_ops *) -- 2.30.2