On Thu, Apr 12, 2007 at 06:55:12AM -0700, Thomas De Schampheleire wrote: > My question is: how fixed are these offsets? Will they always be the > same within a same kernel version? Does it depend on the structure > instance as well? I noticed there are unions inside the structure I am > interested in, does this make a difference? (How is union memory > allocated?)
They're C data structures so -- for a given -- they won't change. > Is there a way to verify that the numbers mdb will give are correct? > Can I for example calculate the actual offset of a field by counting > the sizeof()s of the preceding fields from the source? The data that mdb uses is derived from the information generated by the compiler. The compiler uses some ISA-specific rules when laying out a structure (e.g. it will pad and align fields of certain types). Adam -- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl _______________________________________________ opensolaris-code mailing list [EMAIL PROTECTED] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
