On Thu, 6 Jun 2002 16:06:57 -0500 (CDT), Dean Roe <[EMAIL PROTECTED]> wrote: >Keith Owens wrote >> To get line numbers you have to compile the kernel with -g and use >> objdump. You will have to exit kdb or put the kernel image and source >> on a different machine from the one you are debugging in order to run >> objdump. Given a failing function, identify the object it lives in. >> Example: xlog_state_do_callback which is in fs/xfs/xfs_log.o >> >> cd linux >> rm fs/xfs/xfs_log.o >> make CFLAGS_xfs_log.o=-g vmlinux >> s=$(sed -ne '/xlog_state_do_callback/s/ .*//p' System.map | tr '[a-z]' '[A-Z]') >> e=$(echo -e "obase=16\nibase=16\n$s+500" | bc) >> objdump -S --start-address=0x$s --stop-address=0x$e vmlinux > >Any idea how to get this to work with kernel modules? I haven't >been able to get any source intermixed with the instructions of any >kernel modules (built with -g of course).
You need the start address of the section in the module, which is why bt prints it. Add --adjust-vma=<section-start> to objdump. See Documentation/kdb/kdb_bt.man, "MATCHING TRACE TO KERNEL CODE".
