I'm writing an mdb dcmd using mdb_pwalk to march over embedded list and avl objects, and I've found an area where I don't understand the design.
It seems that the genunix/list.c and genunix/avl.c walkers copy out the "list_size" and "avl_size" values from the target, and then allocate a buffer sized with these values. That's then used to determine how much to read for each element during the walk, and thus the size of the buffer returned to the callback function. The questions I have revolve around how those sizes (read from the target) are known to be correct (what if the target is corrupt?) and how they're known to be related to the size of the structure that the callback function _thinks_ it will get (what if they differ?). It seems to me that we should either have some way of telling mdb_pread that the objects in the walk are known to have some minimum size, or that the callback function should be given the size of the object that's been read in so that it can verify the value. -- James Carlson, Solaris Networking <james.d.carl...@sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677 _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code