From 7c1687a9661c460fac39e57a451a90c5f48213d9 Mon Sep 17 00:00:00 2001 From: Markus Metzger Date: Mon, 11 Mar 2013 08:47:10 +0000 Subject: Provide default target methods for record targets that are likely to be shared between different record targets. gdb/ * record.h (record_disconnect): New. (record_detach): New. (record_mourn_inferior): New. (record_kill): New. * record-full.c (record_disconnect, record_detach, record_mourn_inferior, record_kill): Move to... * record.c: ...here. (DEBUG): New. (record_stop): New. (record_unpush): New. (cmd_record_stop): Call record_stop. Replace unpush_target call with record_unpush call. (record_disconnect, record_detach): Assert that the target is of record stratum. Call record_unpush, record_stop, and DEBUG. (record_mourn_inferior, record_kill): Assert that the target is of record stratum. Call record_unpush and DEBUG. --- gdb/target.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gdb/target.c') diff --git a/gdb/target.c b/gdb/target.c index efd5f63..e41f074 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -4244,6 +4244,23 @@ target_read_btrace (struct btrace_target_info *btinfo, /* See target.h. */ void +target_stop_recording (void) +{ + struct target_ops *t; + + for (t = current_target.beneath; t != NULL; t = t->beneath) + if (t->to_stop_recording != NULL) + { + t->to_stop_recording (); + return; + } + + /* This is optional. */ +} + +/* See target.h. */ + +void target_info_record (void) { struct target_ops *t; -- cgit v1.1