[PATCH] Add gdb remote protocol handling to strace
Stan Cox
scox at redhat.com
Tue Oct 17 18:29:31 UTC 2017
This is the latest version of the gdbserver backend patch. It is
rebased to master, supports the new event dispatch scheme,and has
changes including buffer handling improvements and a rewrite of
notification queue handling. It is a large patch but much of it is
boilerplate changes due to adding the backend struct. The branch is
located at:
https://github.com/stanfordcox/strace
-configure*: configure support
-defs.h: move enum trace_event here
struct backend: backend dispatch table. All of the gdbserver
version of these routines are independent and self contained except
for get_regs which needs access to the register structures
Any change not mentioned is only a change to allow for calling via a
backend routine
-strace.c
alloctcb and droptcb are accessed from the gdbs backend.
handle_arg, end_init, final_cleanup, verify_args, start_init are
generic default versions of backend methods.
Add 'G' option to indicate how to connect to gdbs backend
start_init invokes gdbserver, startup_child, startup_attach (via
attach_tcb) start or connect to the child,
-syscall.c
invoke backend.get_regs, which needs to access the iovec. gdbserver
does not require a separate routine to get the syscall number.
-gdbrsp.test
New test
-gdbserver.c
the gdbserver of the backend methods are defined here. Communicates
with gdbserver via the gdb remote protocol and converts to the
packets that strace expects. gdbserver has a syscall mode that
returns information on syscalls via stop packets. gdbserver has two
protocol modes, all stop and non stop; both are supported.
-protocol.c
support routines: gdb remote packets are deciphered here
-protocol.h
-signals.def
-signals.h
gdb to native signal translation
-gdb_get_regs.c
Gets the register set from gdbserver and converts to strace structures.
---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdbrsp.patch
Type: text/x-patch
Size: 110764 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20171017/364ad095/attachment.bin>
More information about the Strace-devel
mailing list