This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: adding comments/labels?
On Thu, Aug 30, 2007 at 04:50:40AM +0000, jf wrote:
> >
> > Not really. I think you should do it with objcopy, instead. Haven't
> > I suggested this to someone else recently on this list... ?
>
> Why would I want to do it with objcopy? I'm reversing a binary and I'd
> like a label so I don't single step into the same function every time, its
> that or try to remember the address of every function I've looked at.
>
> I'll just have to do it the hardway and cludge through the source and
> figure out where symbol resolution occurs. Thanks for the typical OSS/FS
> help ('no do it my way instead')
If you're going to be insulting when offered advice, please don't
expect to get help again.
I recommended using objcopy because objcopy supports modifying symbol
tables and GDB does not. You can write a GDB macro to use objcopy to
add the symbol, replace the original binary, and reload it into GDB.
It'll be about five lines. This will be about a million times easier
than trying to add a new GDB command to modify the symbol table.
--
Daniel Jacobowitz
CodeSourcery