> > For the time being, I've put the PDF file only onto my old student > > account at http://cip.physik.uni-wuerzburg.de/~hofmann/docs/book.pdf > > where I'll keep it until the editable material on mediacast.sun.com > > is publically reachable. > > > > mdb usage examples are Chapter 7. > > These are really nice. One minor comment is that the ::print > usage doesn't take advantage of some of the enhancements to ::print > in Solaris 10. Two tricks:
Thanks for the feedback. The "follow pointers" was new to me. Not quoting on the other hand is so familiar by now that I get confused when I work on a Solaris 8/9 crashdump ... Actually, I'm aware it's not completely current on either mdb's facilities nor the state of AMD64 crashdump analysis in the latest OpenSolaris builds (I need to write something about the use of "-save_args", and definitely more about ::whattype). I've been wanting to do something about that :) Btw, is there an existing RFE against mdb asking to be able to use "::offsetof" and "::sizeof" in arithmetic expressions, to get better array handling support ? I.e. I'd like to look at specific elements of arrays, something like: *devnamesp+(20*::sizeof(struct devnames))::print struct devnames Or better: "*devnamesp[20]::print struct devnames", with typegraph help :) Thanks, FrankH. > > 1. quoting is no longer required for "struct foo" > > 2. you can print structure members and dereference pointers using > '.', '->', and '[]'. (in particular, putting '[]' at the end > of a chain of things will dereference pointer elements) > > Combined, these make: > > ffffffff8126fdc8::print "struct modctl" mod_linkage | > ::print "struct modlinkage" > { > ml_rev = 0x1 > ml_linkage = [ 0xffffffffc00aaeb0, 0, 0, 0, 0, 0, 0 ] > } > > modldrv1::print "struct modldrv" > { > drv_modops = mod_driverops > drv_linkinfo = 0xffffffff5196e72 "AMD Powernow! 1.15 (ACPICA)" > drv_dev_ops = powernow_dev_ops > } > > powernow_dev_ops::print "struct dev_ops" devo_cb_ops | > ::print "struct cb_ops" cb_ioctl > cb_ioctl = powernow_ioctl > > > > just be: > > > ffffffff8126fdc8::print struct modctl struct modctl[] > { > mod_linkage->ml_rev = 0x1 > mod_linkage->ml_linkage = [ 0xffffffffc00aaeb0, 0, 0, 0, 0, 0, 0 ] > } > > modldrv1::print struct modldrv drv_dev_ops->devo_cb_ops->cb_ioctl > drv_dev_ops->devo_cb_ops->cb_ioctl = powernow_ioctl > > > > Note that we can't make this shorter, since ml_linkage is typed as "void *". > > Cheers, > - jonathan