[patch v6 00/21] record-btrace: reverse

Markus Metzger
2013-09-20T11:30:45Z

This is a small update of v5 that fixes the test fail when using "finish"
in a tail call frame. The fix only changes "record-btrace: extend unwinder"
and resolves a resulting conflict in "record-btrace: add (reverse-)stepping
support".

Here's the v5 text again (without mentioning the fail):

This is an update of the record-btrace series to add reverse support
incorporating Jan's feedback.

The series can be split roughly in two parts. The first half
improves the existing record btrace commands and fixes PR/15240.
The "record function-call-history" command can now show the
call relationship like this:

(gdb) record function-call-history /cli
12 fib inst 101,111 at src/fib.c:3,7
13 fib inst 112,124 at src/fib.c:3,8
14 fib inst 125,129 at src/fib.c:7
15 fib inst 130,142 at src/fib.c:3,8
16 fib inst 143,147 at src/fib.c:7,8
17 fib inst 148,152 at src/fib.c:7,8
18 fib inst 153,157 at src/fib.c:7
19 fib inst 158,168 at src/fib.c:3,7
20 fib inst 169,179 at src/fib.c:3,7
21 fib inst 180,185 at src/fib.c:3,4

The second half adds support for reverse execution.

Markus Metzger (21):
btrace, linux: fix memory leak when reading branch trace
gdbarch: add instruction predicate methods
btrace: change branch trace data structure
record-btrace: fix insn range in function call history
record-btrace: start counting at one
btrace: increase buffer size
record-btrace: optionally indent function call history
record-btrace: make ranges include begin and end
btrace: add replay position to btrace thread info
target: add ops parameter to to_prepare_to_store method
record-btrace: supply register target methods
frame, backtrace: allow targets to supply a frame unwinder
record-btrace, frame: supply target-specific unwinder
record-btrace: provide xfer_partial target method
record-btrace: add to_wait and to_resume target methods.
record-btrace: provide target_find_new_threads method
record-btrace: add record goto target methods
record-btrace: extend unwinder
btrace, gdbserver: read branch trace incrementally
record-btrace: show trace from enable location
record-btrace: add (reverse-)stepping support

gdb/NEWS | 18 +
gdb/amd64-tdep.c | 67 +
gdb/arch-utils.c | 15 +
gdb/arch-utils.h | 4 +
gdb/btrace.c | 1338 ++++++++++++++++---
gdb/btrace.h | 269 ++++-
gdb/common/btrace-common.h | 10 +-
gdb/common/linux-btrace.c | 115 ++-
gdb/common/linux-btrace.h | 10 +-
gdb/doc/gdb.texinfo | 30 +-
gdb/dwarf2-frame-tailcall.c | 4 +-
gdb/dwarf2-frame.c | 8 +-
gdb/frame-unwind.c | 86 +-
gdb/frame.c | 54 +-
gdb/frame.h | 21 +-
gdb/gdbarch.c | 75 +
gdb/gdbarch.h | 18 +
gdb/gdbarch.sh | 9 +
gdb/gdbserver/linux-low.c | 22 +-
gdb/gdbserver/server.c | 11 +-
gdb/gdbserver/target.h | 6 +-
gdb/i386-tdep.c | 59 +
gdb/inf-child.c | 2 +-
gdb/infcmd.c | 2 +-
gdb/monitor.c | 2 +-
gdb/ravenscar-thread.c | 7 +-
gdb/record-btrace.c | 1454 +++++++++++++++++---
gdb/record-full.c | 3 +-
gdb/record.c | 4 +
gdb/record.h | 3 +
gdb/remote-m32r-sdi.c | 2 +-
gdb/remote-mips.c | 5 +-
gdb/remote.c | 28 +-
gdb/stack.c | 2 +-
gdb/target.c | 65 +-
gdb/target.h | 34 +-
gdb/testsuite/gdb.btrace/Makefile.in | 3 +-
gdb/testsuite/gdb.btrace/delta.exp | 76 +
gdb/testsuite/gdb.btrace/exception.cc | 56 +
gdb/testsuite/gdb.btrace/exception.exp | 67 +
gdb/testsuite/gdb.btrace/finish.exp | 70 +
gdb/testsuite/gdb.btrace/function_call_history.exp | 329 +++--
gdb/testsuite/gdb.btrace/instruction_history.exp | 77 +-
gdb/testsuite/gdb.btrace/multi-thread-step.c | 53 +
gdb/testsuite/gdb.btrace/multi-thread-step.exp | 99 ++
gdb/testsuite/gdb.btrace/next.exp | 89 ++
gdb/testsuite/gdb.btrace/nexti.exp | 89 ++
gdb/testsuite/gdb.btrace/record_goto.c | 51 +
gdb/testsuite/gdb.btrace/record_goto.exp | 177 +++
gdb/testsuite/gdb.btrace/rn-dl-bind.c | 37 +
gdb/testsuite/gdb.btrace/rn-dl-bind.exp | 48 +
gdb/testsuite/gdb.btrace/step.exp | 113 ++
gdb/testsuite/gdb.btrace/stepi.exp | 114 ++
gdb/testsuite/gdb.btrace/tailcall.exp | 103 ++
gdb/testsuite/gdb.btrace/unknown_functions.c | 45 +
gdb/testsuite/gdb.btrace/unknown_functions.exp | 60 +
gdb/testsuite/gdb.btrace/x86-record_goto.S | 355 +++++
gdb/testsuite/gdb.btrace/x86-tailcall.S | 279 ++++
gdb/testsuite/gdb.btrace/x86-tailcall.c | 39 +
59 files changed, 5566 insertions(+), 725 deletions(-)
create mode 100644 gdb/testsuite/gdb.btrace/delta.exp
create mode 100644 gdb/testsuite/gdb.btrace/exception.cc
create mode 100755 gdb/testsuite/gdb.btrace/exception.exp
create mode 100644 gdb/testsuite/gdb.btrace/finish.exp
create mode 100644 gdb/testsuite/gdb.btrace/multi-thread-step.c
create mode 100644 gdb/testsuite/gdb.btrace/multi-thread-step.exp
create mode 100644 gdb/testsuite/gdb.btrace/next.exp
create mode 100644 gdb/testsuite/gdb.btrace/nexti.exp
create mode 100644 gdb/testsuite/gdb.btrace/record_goto.c
create mode 100644 gdb/testsuite/gdb.btrace/record_goto.exp
create mode 100644 gdb/testsuite/gdb.btrace/rn-dl-bind.c
create mode 100644 gdb/testsuite/gdb.btrace/rn-dl-bind.exp
create mode 100644 gdb/testsuite/gdb.btrace/step.exp
create mode 100644 gdb/testsuite/gdb.btrace/stepi.exp
create mode 100644 gdb/testsuite/gdb.btrace/tailcall.exp
create mode 100644 gdb/testsuite/gdb.btrace/unknown_functions.c
create mode 100644 gdb/testsuite/gdb.btrace/unknown_functions.exp
create mode 100644 gdb/testsuite/gdb.btrace/x86-record_goto.S
create mode 100644 gdb/testsuite/gdb.btrace/x86-tailcall.S
create mode 100644 gdb/testsuite/gdb.btrace/x86-tailcall.c