Re: Interactively add symbols

Lars Brinkhoff <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Simon Marchi wrote:
> Lars Brinkhoff wrote:
>> As far as I have seen, there's no way for a user to interactively add
>> a symbol to a running GDB session, other than specifying an object
>> file from which to load symbols.  I suggest there should be a simple
>> way to do this from the command line.
>
> As you mentioned, this is a feature that has been often requested.  It
> pops up once in a while on IRC.  The best way to get some progress on
> this would be to make it work for you, and the submit what you have.

Thank you.

I have posted something which works, with some limitations and warts:
https://sourceware.org/ml/gdb/2017-08/msg00022.html

As far as I understand, all symbols must be associated with an objfile.
So I couln't find a way to add a symbol without a file having been
loaded first.  I arbitrarily pick the first objfile in the current
program.  Maybe that's ok.

Next, to record a new symbol, I used the minimal symbol reader.  I found
that it won't do its job unless the "minsyms_read" flag is reset.
Normally it will be set after a file has been loaded, so I kinda hacked
around that.

Am I on the right track, or barking up the wrong tree?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.