Joachim Worringen writes:
> when my kernel module crashes, I get this nice backtrace from mdb after 
> rebooting. To relate the shown offset within the function to the actual 
> line in my source, I currently use a combination of 'cc -S' (for the 
> relation assembly instr. -> source code line) and /usr/ccs/bin/dis (for 
> the relation function offset -> assembly instr.).

I usually skip "cc -S" and just read the assembly.  It's usually
fairly straightforward.  One useful trick is doing this to view the
functions called from within a given function:

        functionname::dis ! grep call

In a large or complicated function, the addresses on these calls
should give you a better idea of where a given address is located.

> Is there a more convenient way? Skimmed through the mdb manual, but 
> found nothing related.
> 
> Using snv_84 DEBUG, cc 5.8 for the kernel and 5.9 for my modules.

I know of no other way.  I think it'd be nice to have line number
extensions for CTF and these tools, but I don't know what it would
cost (in terms of kernel memory).

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
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
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to