[PATCH v2] Add gdb remote protocol backend to strace
Stan Cox
scox at redhat.com
Wed Dec 2 19:30:27 UTC 2020
Repost of
https://lists.strace.io/pipermail/strace-devel/2020-December/010283.html
with CI "coverage" fixes. Hopefully all CI issues are addressed now.
Add gdbserver backend
Add gdbserver backend as an alternate backend, which uses the GDB
remote system protocol to communicate with the gdbserver. The
main loop gets a packet from gdbserver, massages packet into
struct tcb_wait_data, registers into ARCH_IOVEC_FOR_GETREGSET,
returns to dispatch_event, which continues gdbsserver.
Usage gdbserver --multi :54321 & strace --gdbserver 54321 program
The protocol is described in: info gdb 'Remote Protocol' Packets
* (configure.ac, Makefile.am, tests/Makefile.am): Support gdbserver
* defs.h (trace_syscall, update_personality)
(arch_iovec_for_getreset): Allow access by gdbserver
* gdbserver/(gdbserver.c, protocol.c, gdbserver.h, protocol.h)
(signals.def, signals.h, x86_64/gdb_arch_defs.h)
(x86_64/gdb_get_regs.c): New gdbserver backend.
* strace.1.in: Document --gdbserver option.
* strace.c (detach, startup_attach, startup_child, init, cleanup)
(next_event, dispatch_event): Support gdbserver
* syscall.c (+arch_iovec_for_getregset, get_regs, get_scno): Support
gdbserver
* ucopy (umoven): Likewise.
* upeek.c (upeek): Likewise.
* upoke (upoke): Likewise
* (tests/gdbrsp.test, tests/gdbrsp.c): New gdbserver test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-Add-gdbserver-backend.patch
Type: text/x-patch
Size: 104723 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20201202/63e3ba6a/attachment.bin>
More information about the Strace-devel
mailing list