This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
prototyping linux kernel-side gdbstub for userspace
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- To: utrace-devel at redhat dot com
- Cc: systemtap at sources dot redhat dot com, archer at sources dot redhat dot com
- Date: Fri, 19 Jun 2009 12:59:00 -0400
- Subject: prototyping linux kernel-side gdbstub for userspace
Hi -
I'm slowly assembling a prototype gdb stub for debugging user-space
programs, based on utrace, for possible eventual inclusion in the
linux kernel. For the moment, it is a toy alternative to ptrace() for
targeting existing processes, and it's not done even for that. But
before too long though it should be able to use uprobes (q.v.) as a
kernel-side breakpointing facility using the Z packets, and maybe even
support agent expressions, multithreaded processes, and multiprocess
debugging.
Only very basic parts work right now:
% gdb foobar
(gdb) target remote /proc/<pid>/gdb
(due to suspected utrace bug, must currently manually interrupt the <pid> to get its attention)
#0 ... (backtrace works) ...
#1 ...
(gdb) p expression
# works
(gdb) set expression=value
# appears to work
(gdb) info regs
# appears to work - x86 and x86-64 only
(gdb) continue
# appears to work
But several things don't:
* signal injection
* other architectures
* proper fork/exec handling
Logistically, this is a patch added onto Roland McGrath's utrace git
tree over at git.kernel.org.
git-clone http://elastic.org/~fche/git/linux-2.6-utrace/
and build enabling CONFIG_UTRACE and CONFIG_UTRACE_GDB. I'm planning
to continue working on it until the "several things don't" list above
is done. I'd appreciate any help such as advising, porting, or code
such as on the future extensions listed way above.
- FChE