Re: Python Symbol API question/weirdness

Matt Rice <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CACTLOFokU=gBrvCM5DMvYzatpjOUkh6PWQkEGthDFAohs_P7ww@mail.gmail.com>
On Tue, Jun 27, 2017 at 3:56 AM, Pedro Alves <[email protected]> wrote:
> On 06/16/2017 09:55 PM, Evan Driscoll wrote:
>
>> Does anyone have any idea what might be going on? I think I don't
>> actually need this to work, but I am curious what is going on. Maybe
>> something with symbol aliases?
>
> I think that you're seeing this because the Python API is only aware
> of debug info symbols, while "raise" etc. above in your examples
> are minimal symbols (i.e., elf symbols), as hinted by:
>
>   $2 = (<text variable, no debug info> *) 0x7ffff7a433f0 <__GI_raise>
>                         ^^^^^^^^^^^^^
>
> Sounds like exposing minsyms to the Python layer would be useful.
> I'm actually surprised it doesn't already expose them somehow.

I think you can get some information about minsyms from decode_line
(gdb) py print(gdb.parse_and_eval("main"))
{<text variable, no debug info>} 0x4004f0 <main>
(gdb) py print('%02x' % gdb.decode_line("main")[1][0].pc)
4004f0
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.