On Wed, 12 Dec 2007, J Duff wrote: > How do I convert the following information in the messages log to a line > number in the source code? > >> BAD TRAP: type=e (#pf Page fault) rp=ffffff0008d0d610 addr=50 occurred in >> module "module" due to a NULL pointer dereference >> . >> . >> . >> Dec 11 14:27:31 machine genunix: [ID 655072 kern.notice] ffffff0008d0d800 >> module:method+792 () > > In other words, how can I convert the 792 to a source code line number? I > know its in the method of module, but the 792 (assembler line number) doesn't > help me.
There are multiple methods of doing this: a) modify the makefiles for "module" so that they pass the 'save temporary files' compiler option. After building, you'll have *.S files laying around that have the sourcecode in comments. Match from there. b) compile "module" with full debugging stabs, don't strip them out. You can then load the object into a source-level capable debugger and ask the debugger what sourceline that offset is c) The classical "kernel reverse engineering" approach - disassemble around the area above, and compare function calls, arithmetic ops, accesses to global vars etc. with your sourcecode and match from there. Generically, in solaris kernel debugging we tend to do c); it takes a bit to learn but is, for people with a little experience, not generically the time-consuming part in performing kernel crashdump analysis ... FrankH. > > Duff > > > This message posted from opensolaris.org > _______________________________________________ > opensolaris-code mailing list > opensolaris-code@opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/opensolaris-code > ------------------------------------------------------------------------------ No good can come from selling your freedom, not for all the gold in the world, for the value of this heavenly gift far exceeds that of any fortune on earth. ------------------------------------------------------------------------------ _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code