* objdump -S for a different dir.
@ 2011-12-10 6:59 Jim Cromie
2011-12-10 7:46 ` Dave Hylands
0 siblings, 1 reply; 3+ messages in thread
From: Jim Cromie @ 2011-12-10 6:59 UTC (permalink / raw)
To: kernelnewbies
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.
thanks
^ permalink raw reply [flat|nested] 3+ messages in thread* objdump -S for a different dir. 2011-12-10 6:59 objdump -S for a different dir Jim Cromie @ 2011-12-10 7:46 ` Dave Hylands 2011-12-13 4:28 ` Jim Cromie 0 siblings, 1 reply; 3+ messages in thread From: Dave Hylands @ 2011-12-10 7:46 UTC (permalink / raw) To: kernelnewbies Hi Jim, On Fri, Dec 9, 2011 at 10:59 PM, Jim Cromie <jim.cromie@gmail.com> wrote: > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111209/8a76be69/attachment.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* objdump -S for a different dir. 2011-12-10 7:46 ` Dave Hylands @ 2011-12-13 4:28 ` Jim Cromie 0 siblings, 0 replies; 3+ messages in thread From: Jim Cromie @ 2011-12-13 4:28 UTC (permalink / raw) To: kernelnewbies On Sat, Dec 10, 2011 at 12:46 AM, Dave Hylands <dhylands@gmail.com> wrote: > Hi Jim, > > On Fri, Dec 9, 2011 at 10:59 PM, Jim Cromie <jim.cromie@gmail.com> wrote: >> >> 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 Thanks Dave, Id have sworn that after I found -S to not work out-of-tree, I built in-tree using same .config and -S did work. But of course that in-tree build is gone and I cant verify. (it interferes with continued out-of-tree builds, which end with 'run make mrproper') Anyway, its certainly working now. It was probably a different config on a different box, built for a small CF. thanks again ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-13 4:28 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-12-10 6:59 objdump -S for a different dir Jim Cromie 2011-12-10 7:46 ` Dave Hylands 2011-12-13 4:28 ` Jim Cromie
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).