On 10/17/06, James McPherson <james.c.mcpherson at gmail.com> wrote: > On 10/18/06, Fu Zhi-jun <Zhijun.Fu at sun.com> wrote: > > Hi, folks, > > I have a question about the internals of dcmd "whatis". > > The dcmds "whatis" gives the type information of an address. > > I am curious how this dcmd get that information. Does Solaris kernel > > memory system > > maintain that information for each allocation? > > >From the code which implements "whatis", it walks thread-stack, page, > > kmem_cache ... in turn, and try to locate the address within each part. > > So it seems solaris doesn't > > maintain type information for dynamic allocated objects. Is it correct? > > Some time ago a decision was taken to include DWARF-style > debugging information in each binary delivered in ON (and NWS and ...). > The current implementation is known as CTF or "Compact Type Format". > This is where mdb gets its data type information from.
But that's not the whole story, though, is it? The debugging information included in the binaries won't cover dynamically-allocated objects. Don't you need the extra work that goes along with ::typegraph, et al.? (Bryan Cantrill's paper about this work here: http://arxiv.org/abs/cs/0309037.) Or am I missing something? Chad Mynhier