Re: Disambiguating symbols by module
Matt Rice via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CACTLOFqS-4zt==+UXLm7VSm8mWfrwaT+KoYgNBzG3gao+LZvCw@mail.gmail.com> |
On Thu, Sep 2, 2021 at 8:48 PM Alexander Miloslavskiy via Gdb <[email protected]> wrote:0x00007ffff6d7a3b0 > > Hello, >0x00007ffff6d7a3b0 > I spend much time debugging Java with GDB. > > In order to obtain current Java callstack, I do this: > (gdb) call (void)ps() > > The problem is, the function's name is too short and gdb confuses it > with a variable in a different library: > > (gdb) info var ^ps$ > File ../../cipher/blowfish.c: > 256: static const u32 ps[18]; > > (gdb) info function ^ps$ > Non-debugging symbols: > 0x00007ffff6d7a3b0 ps > > Here, the symbol I want is a non-debugging symbol. This also means that > I can't disambiguate it by the source file name. > > Is there a syntax to disambiguate the symbol? Been a while since I've needed to do this, but IIRC you can just set a breakpoint using the symbol address too, like: (gdb) break *0x00007ffff6d7a3b0 I don't know of or believe there is any nicer syntax like object_file.o:symbol_name, which one could imagine might be possible.