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.
This commit is contained in:
Markus Metzger 2014-03-19 13:49:58 +01:00
parent 5599c40462
commit da8c46d296
13 changed files with 311 additions and 14 deletions

View file

@ -52,6 +52,13 @@ enum btrace_insn_class
BTRACE_INSN_JUMP
};
/* Instruction flags. */
enum btrace_insn_flag
{
/* The instruction has been executed speculatively. */
BTRACE_INSN_FLAG_SPECULATIVE = (1 << 0)
};
/* A branch trace instruction.
This represents a single instruction in a branch trace. */
@ -65,6 +72,9 @@ struct btrace_insn
/* The instruction class of this instruction. */
enum btrace_insn_class iclass;
/* A bit vector of BTRACE_INSN_FLAGS. */
enum btrace_insn_flag flags;
};
/* A vector of branch trace instructions. */