On Fri, Dec 9, 2011 at 10:59 PM, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
So I normally do out of tree builds, but I always run make from the source tree and specify the O= option.
I'm using 3.0.1, and in menuconfig, I went into "Kernel hacking", enabled "Kernel debugging" and then "Compile the kernel with debug info".
The "Compile the kernel with debug info" option enables CONFIG_DEBUG_INFO which cause the kernel source to be compiled with the -g option which adds the debugging information needed to find the source from the objects.
I normally cross compile for the ARM, so I then cd'd into my build tree and tried arm-linux-gnueabi-objdump -S on a few object files and they all gave intermingled C and assembler listings.
I tried it using your method and it seemed to work fine for me as well.
-- hi folks,
out of habit, I build my kernels to a build tree
ie use make O=../build-foo just once,
then cd ../build-foo, and thereafter run make there
this doesnt play nice with objdump -S
--source
Display source code intermixed with disassembly, if
possible. Implies -d.
it seems its not possible unless the source and obj are in the same file.
GDB manages to find the source, whats missing in objdump ?
FWIW, Id love a micro-tutorial on this,
anyone know how to display, dissect the obj file, debuginfo etc ?
or can recommend some on-line tome that gets into it at some breadth and depth ?
many many search hits are for quick Q&A that doesnt get deeper than a puddle.
So I normally do out of tree builds, but I always run make from the source tree and specify the O= option.
I'm using 3.0.1, and in menuconfig, I went into "Kernel hacking", enabled "Kernel debugging" and then "Compile the kernel with debug info".
The "Compile the kernel with debug info" option enables CONFIG_DEBUG_INFO which cause the kernel source to be compiled with the -g option which adds the debugging information needed to find the source from the objects.
I normally cross compile for the ARM, so I then cd'd into my build tree and tried arm-linux-gnueabi-objdump -S on a few object files and they all gave intermingled C and assembler listings.
I tried it using your method and it seemed to work fine for me as well.
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies