RFC strace via gdbserver
Dmitry V. Levin
ldv at altlinux.org
Mon Apr 18 02:25:55 UTC 2016
Hi,
On Fri, Apr 15, 2016 at 05:30:12PM -0700, Josh Stone wrote:
> Hi folks,
>
> Just wanted to give an update on this project, running strace over the
> gdbserver protocol. I've quoted my original message below, in case you
> missed it the first time, and source is here:
> https://github.com/cuviper/strace/
>
> The code has been rebased onto a much newer development branch, as of a
> couple weeks ago. I'll push new rebases occasionally to keep up.
> There's still plenty of hacky/prototype hooks in place, so this isn't
> ready for integration yet. I need to address testing too.
>
> Feature-wise, I've added file and piped-command support for gdbserver
> communication, so you can connect in three ways:
>
> - tcp: strace -G host:port
> - file: strace -G /dev/ttyS0
> - piped-command: strace -G '|vgdb'
>
> That last is how you can connect to a valgrind process. Support for
> QCatchSyscalls is now in valgrind trunk. With this, you can strace a
> process under valgrind without seeing the activity of valgrind itself!
>
> GDB 7.11 was release in February, with support for QCatchSyscalls, so
> new gdbserver builds will now have everything "strace -G" needs.
>
> Stan Cox has started to get this working in gdbserver's non-stop mode.
> Right now it runs all-stop, which means a multithreaded target will stop
> every thread when any event is reported. That's usually what you want
> for an interactive debugger, but in strace it may cause a lot of
> interrupted syscalls -- full of EINTR/EAGAIN/ERESTARTSYS. So non-stop
> will let other threads keep running freely while we process any event.
>
> Dmitry pointed out -P and -y path-based options before, which I haven't
> found a solution for. Technically /proc/pid/fd access will work just
> fine if the gdbserver is local anyway, but that's cheating, and can't be
> assumed in general. It may just be that some strace features won't be
> able to mix with this -G gdbserver mode.
Fair enough.
> Anyway, work continues, and I hope people find this interesting.
Josh, thanks for keeping us posted.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160418/a6271b1a/attachment.bin>
More information about the Strace-devel
mailing list