btrace: indicate speculative execution
authorMarkus Metzger <markus.t.metzger@intel.com>
Wed, 19 Mar 2014 12:49:58 +0000 (13:49 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 7 Aug 2015 08:22:39 +0000 (10:22 +0200)
commitda8c46d2967b6325dcd2cc72eca26d807964c93c
treecb49a304435ae9f3ce94f7214b3c8aa2e95ee38d
parent5599c404621b2d8ac021c1427aee6e8974572042
btrace: indicate speculative execution

Indicate speculatively executed instructions with a leading '?'.  We use the
space that is normally used for the PC prefix.  In the case where the
instruction at the current PC had been executed speculatively before, the PC
prefix will be partially overwritten resulting in "?> ".

As a side-effect, the /p modifier to omit the PC prefix in the "record
instruction-history" command now uses a 3-space PC prefix "   " in order to
have enough space for the speculative execution indication.

gdb/
* btrace.c (btrace_compute_ftrace_bts): Clear insn flags.
(pt_btrace_insn_flags): New.
(ftrace_add_pt): Call pt_btrace_insn_flags.
* btrace.h (btrace_insn_flag): New.
(btrace_insn) <flags>: New.
* record-btrace.c (btrace_insn_history): Print insn prefix.
* NEWS: Announce it.

doc/
* gdb.texinfo (Process Record and Replay): Document prefixing of
speculatively executed instructions in the "record instruction-history"
command.

testsuite/
* gdb.btrace/instruction_history.exp: Update.
* gdb.btrace/tsx.exp: New.
* gdb.btrace/tsx.c: New.
* lib/gdb.exp (skip_tsx_tests, skip_btrace_pt_tests): New.
13 files changed:
gdb/ChangeLog
gdb/NEWS
gdb/btrace.c
gdb/btrace.h
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/record-btrace.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.btrace/instruction_history.exp
gdb/testsuite/gdb.btrace/tsx.c [new file with mode: 0644]
gdb/testsuite/gdb.btrace/tsx.exp [new file with mode: 0644]
gdb/testsuite/gdb.btrace/x86-tsx.S [new file with mode: 0644]
gdb/testsuite/lib/gdb.exp