[Novalug] gdb tidbit - objcopy
Doug Toppin
dougtoppin at gmail.com
Tue Jun 12 13:15:18 EDT 2007
A ways back I did a couple of presentations on using the gdb debugger.
I just ran across something I didn't know about called 'objcopy'
(copy and translate object files). It can be used to manupulate
object files (binaries) in various ways. One of the options it
supports is '--only-keep-debug'. Using that on an executable with
symbol data will create a new file containing only the debug symbol
data. This would allow you to build a fully debuggable binary, output
the debug symbols to another file and then strip the original. You
can then load the debug symbols later in a gdb session with the gdb
'symbol' command. The reasons for doing this might include space
savings or not wanting to provide a debug capability in your delivery.
I'm sure that there are other useful situations for doing that.
I thought I'd pass along a mention of 'objcopy' in case anyone else
might find some benefit with it. Anyone else used it in the past?
Doug
More information about the Novalug
mailing list