aboutsummaryrefslogtreecommitdiff
path: root/gdb/record-btrace.c
diff options
context:
space:
mode:
authorTim Wiederhake <tim.wiederhake@intel.com>2016-12-13 11:24:56 +0100
committerTim Wiederhake <tim.wiederhake@intel.com>2017-02-14 10:57:56 +0100
commitb158a20f26f1d226088122e8c4fa5a23bb893a48 (patch)
tree8a7d017304027dce8495465ab478e9effb499d23 /gdb/record-btrace.c
parent45b196c59065cd2c5b750b78a0329d42f6e924b1 (diff)
downloadfsf-binutils-gdb-b158a20f26f1d226088122e8c4fa5a23bb893a48.zip
fsf-binutils-gdb-b158a20f26f1d226088122e8c4fa5a23bb893a48.tar.gz
fsf-binutils-gdb-b158a20f26f1d226088122e8c4fa5a23bb893a48.tar.bz2
Add method to query current recording method to target_ops.
Signed-off-by: Tim Wiederhake <tim.wiederhake@intel.com> gdb/ChangeLog * record-btrace.c (record_btrace_record_method): New function. (init_record_btrace_ops): Initialize to_record_method. * record-full.c (record_full_record_method): New function. (init_record_full_ops, init_record_full_core_ops): Add record_full_record_method. * record.h (enum record_method): New enum. * target-debug.h (target_debug_print_enum_record_method: New define. * target-delegates.c: Regenerate. * target.c (target_record_method): New function. * target.h: Include record.h. (struct target_ops) <to_record_method>: New field. (target_record_method): New export. Change-Id: I05daa70e4e08a19901e848c731bb7d60cd87cc5a
Diffstat (limited to 'gdb/record-btrace.c')
-rw-r--r--gdb/record-btrace.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 19b9222..f7683f2 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -1258,6 +1258,23 @@ record_btrace_call_history_from (struct target_ops *self,
record_btrace_call_history_range (self, begin, end, flags);
}
+/* The to_record_method method of target record-btrace. */
+
+static enum record_method
+record_btrace_record_method (struct target_ops *self, ptid_t ptid)
+{
+ const struct btrace_config *config;
+ struct thread_info * const tp = find_thread_ptid (ptid);
+
+ if (tp == NULL)
+ error (_("No thread."));
+
+ if (tp->btrace.target == NULL)
+ return RECORD_METHOD_NONE;
+
+ return RECORD_METHOD_BTRACE;
+}
+
/* The to_record_is_replaying method of target record-btrace. */
static int
@@ -2833,6 +2850,7 @@ init_record_btrace_ops (void)
ops->to_call_history = record_btrace_call_history;
ops->to_call_history_from = record_btrace_call_history_from;
ops->to_call_history_range = record_btrace_call_history_range;
+ ops->to_record_method = record_btrace_record_method;
ops->to_record_is_replaying = record_btrace_is_replaying;
ops->to_record_will_replay = record_btrace_will_replay;
ops->to_record_stop_replaying = record_btrace_stop_replaying_all;