btrace: Resume recording after disconnect.
authorTim Wiederhake <tim.wiederhake@intel.com>
Mon, 25 Jul 2016 08:57:06 +0000 (10:57 +0200)
committerTim Wiederhake <tim.wiederhake@intel.com>
Mon, 25 Jul 2016 09:03:43 +0000 (11:03 +0200)
commitc0272db5854a799a9f3bb3803c3d03d1a62b9ac2
treeebd295aa3734c916316b96ed8a1481e5d13c6c39
parent95804507f2645c1cce29f2e1a33031accaa6aa24
btrace: Resume recording after disconnect.

This patch allows gdbserver to continue recording after disconnect.  On
reconnect, the recorded data is accessible to gdb as if no disconnect happened.

A possible application for this feature is remotely examine bugs that occur
at irregular intervals, where maintaining a gdb connection is inconvenient.

This also fixes the issue mentioned here:
https://sourceware.org/ml/gdb-patches/2015-11/msg00424.html

Signed-off-by: Tim Wiederhake <tim.wiederhake@intel.com>
gdb/ChangeLog:
* NEWS: Resume btrace on reconnect.
* record-btrace.c: Added record-btrace.h include.
(record_btrace_open): Split into this and ...
(record_btrace_push_target): ... this.
(record_btrace_disconnect): New function.
(init_record_btrace_ops): Use record_btrace_disconnect.
* record-btrace.h: New file.
* remote.c: Added record-btrace.h include.
(remote_start_remote): Check recording status.
(remote_btrace_maybe_reopen): New function.

gdb/doc/ChangeLog:
* gdb.texinfo: Resume btrace on reconnect.

gdb/testsuite/ChangeLog:

* gdb.btrace/reconnect.c: New file.
* gdb.btrace/reconnect.exp: New file.

Change-Id: I95e8b0ab8a89e58591aba0e63818cee82fd211bc
gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/record-btrace.c
gdb/record-btrace.h [new file with mode: 0644]
gdb/remote.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.btrace/reconnect.c [new file with mode: 0644]
gdb/testsuite/gdb.btrace/reconnect.exp [new file with mode: 0644]