binutils-gdb/gdb/testsuite/gdb.btrace
Markus Metzger cd4007e434 btrace: allow recording to be started (and stopped) for running threads
When recording is started for a running thread, GDB was able to start tracing
but then failed to read registers to insert the initial entry for the current
PC.  We don't really need that initial entry if we don't know where exactly we
started recording.  Skip that step to allow recording to be started while
threads are running.

If we do run into errors, we need to undo the tracing enable to not leak this
thread.  The operation did not complete so our caller won't clean up this
thread.

For the BTRACE_FORMAT_PT btrace format, we don't need that initial entry since
it will be recorded in the trace.  We can omit the call to btrace_add_pc.

gdb/
	* btrace.c (btrace_enable): Do not call btrace_add_pc for
	BTRACE_FORMAT_PT or if can_access_registers_ptid returns false.
	(btrace_fetch): Assert can_access_registers_ptid.
	* record-btrace.c (require_btrace_thread, record_btrace_info): Call
	validate_registers_access.

testsuite/
	* gdb.btrace/enable-running.c: New.
	* gdb.btrace/enable-running.exp: New.
2017-02-01 14:37:07 +01:00
..
buffer-size.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
data.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
data.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
delta.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
dlopen-dso.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
dlopen.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
dlopen.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
enable-running.c btrace: allow recording to be started (and stopped) for running threads 2017-02-01 14:37:07 +01:00
enable-running.exp btrace: allow recording to be started (and stopped) for running threads 2017-02-01 14:37:07 +01:00
enable.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
enable.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
exception.cc update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
exception.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
function_call_history.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
function_call_history.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gcore.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
i686-record_goto.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
i686-tailcall-only.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
i686-tailcall.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
instruction_history.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
instruction_history.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
instruction_history.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
multi-thread-step.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
multi-thread-step.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
nohist.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-stop.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-stop.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
reconnect.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
reconnect.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
record_goto-step.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
record_goto.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
record_goto.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
rn-dl-bind.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
rn-dl-bind.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
segv.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
segv.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
step.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
stepi.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tailcall-only.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tailcall-only.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tailcall.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tailcall.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tsx.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tsx.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
unknown_functions.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
unknown_functions.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
vdso.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
vdso.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-tsx.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86_64-record_goto.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86_64-tailcall-only.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86_64-tailcall.S update copyright year range in GDB files 2017-01-01 10:52:34 +04:00