Eric Schrock wrote: > > The power of debugging, in general, is lost on most developers. Thanks > to the work we've done in OpenSolaris (DTrace, MDB, CTF, ptools, etc), > the average OpenSolaris developer is vastly more engaged than your > typical developer. But as we've time and time again, you need to build > the tools first before developers can get excited about it. Just the > other day I found myself wanting ::loadctf, because I had used ::context > to examine a userland process from a crash dump, but I had no CTF data > available to print structures. It was sitting on disk, but there was no > way to tell MDB to load it. There are definitely some powerful things > you are doing that will be useful to developers. The mdb fanatics > among us are definitely hoping you'll continue your work. > Hi Eric, I started to look at adding ctf for use with userland processes on a complete memory dump. So, the first thing I did was try using ::context. However, I ran into bug: http://bugs.opensolaris.org/view_bug.do?bug_id=6610226
mdb gets a segv when using ::context from mdb on a kernel core (as well as mdb -k). I have a fix for this. However... The fix allows one to look at the address space of a userland process with no problem. But... not everything works. I can not use "$c" for instance. I would like to see what works when this is fully functional. I am not sure if this was ever functional on solaris 10 and newer. You mention that you are using ::context. What version of solaris are you running? Can you use "$c"? (I think so, but I don't have access to a machine running a version of solaris where ::context works). The reason ::context causes a core dump is that it indirects through the mdb_tgt_ops_t structure and calls a routine that has apparently been added (*...t_auxv)(). I have added this routine for mdb_kproc.c and kvm_ia32dep.c, as well as added the entry to the mdb_tgt_ops_t in those 2 files. I suspect the same must be done for sparc and amd64. There is a call to rd_new() in mdb_kproc.c This is being passed an argument to an mdb_tgt_t. The source shows that rd_new should get a ps_prochandle as the argument. A comment in the code says that the ps_prochandle (t_pshandle) is pointed at by kp_cookie. However, kp_cookie is a kvm_t, not a ps_prochandle. Currently, I changed the call to rd_new() to take the kp_cookie as an argument, but that is not correct and causes rd_new to fail. I suspect this is why "$c" does not work. Any ideas here? If "$c" never worked, then I guess I have a fix. And, one more thing. It would be nice to know if someone is already working on a fix for this bug (or any bug, for that matter). The bug database just says: *State* 1-Dispatched (Default State) Dispatched implies, to me, that this has been assigned to someone. Any chance of finding out who? thanks, max > - Eric > > -- > Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock > >