diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2013-04-26 08:37:06 +0200 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2014-01-16 13:06:09 +0100 |
commit | 07bbe694e779f4953911a50751abdc00117be7d3 (patch) | |
tree | a8da63d6506d00e24eb7cab38fa734a33a46c971 /gdb/btrace.c | |
parent | 0688d04e19c0e6305c1034eb5e97a66458fd805a (diff) | |
download | gdb-07bbe694e779f4953911a50751abdc00117be7d3.zip gdb-07bbe694e779f4953911a50751abdc00117be7d3.tar.gz gdb-07bbe694e779f4953911a50751abdc00117be7d3.tar.bz2 |
btrace: add replay position to btrace thread info
Add a branch trace instruction iterator pointing to the current replay position
to the branch trace thread info struct.
Free the iterator when btrace is cleared.
Start at the replay position for the instruction and function-call histories.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* btrace.h (replay) <replay>: New.
(btrace_is_replaying): New.
* btrace.c (btrace_clear): Free replay iterator.
(btrace_is_replaying): New.
* record-btrace.c (record_btrace_is_replaying): New.
(record_btrace_info): Print insn number if replaying.
(record_btrace_insn_history): Start at replay position.
(record_btrace_call_history): Start at replay position.
(init_record_btrace_ops): Init to_record_is_replaying.
Diffstat (limited to 'gdb/btrace.c')
-rw-r--r-- | gdb/btrace.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/btrace.c b/gdb/btrace.c index 1d060d3e..632ebe1 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -781,9 +781,11 @@ btrace_clear (struct thread_info *tp) xfree (btinfo->insn_history); xfree (btinfo->call_history); + xfree (btinfo->replay); btinfo->insn_history = NULL; btinfo->call_history = NULL; + btinfo->replay = NULL; } /* See btrace.h. */ @@ -1339,3 +1341,11 @@ btrace_set_call_history (struct btrace_thread_info *btinfo, btinfo->call_history->begin = *begin; btinfo->call_history->end = *end; } + +/* See btrace.h. */ + +int +btrace_is_replaying (struct thread_info *tp) +{ + return tp->btrace.replay != NULL; +} |