This project is intended to provide enhanced functionality for debugging
user-space processes from a system crash-dump with MDB.
Currently, within MDB, the mdb_kproc target provides some basic
functionality for switching to the process context and reading from
its address space. However, dcmds like ::stack are less than useful.
has a decent chunk of support code for dealing with user-space
core dumps. If we can make it so that mdb_kproc uses libproc, we get
a number of features almost 'for free':
- less code doing the same thing in mdb_kproc.c
- decent ::stack, etc. implementations
- enables ::gcore command
By providing a ::gcore command, we can extract as much of a userspace
process as we can from a crash-dump and provide a standard core file,
which can then be fed into MDB etc. as usual, with all the standard
user-space dcmds available.
Of course, for this to work at all requires that the crash-dump contain
pages from the process (so at the very least dumpadm must be set up in curproc mode). It's worth noting that stack pages are likely to still be in
the image as they're recently used. If we fake up missing pages with
all-zeroes, we can actually get a pretty reasonable core dump image.
The current state of the code is very early on. It's based on changes
originally written by John Levon a couple of years ago, and assiduously
updated by Rich Lowe. We encourage interested parties to help continue
with the cleanup and fixes necessary to get this feature on its feet.
You can check out the current tree:
hg clone ssh://anon@hg.opensolaris.org/hg/gcore/gcore
Discussion of the gcore project is currently happening on the
mdb-discuss
list
(subscribe).
Commits to the repository go to the gcore-notify list
(subscribe).