Re: GDB Incorrectly Reads & Resolves Shared Library Symbols [MinGW-w64]
Andrew Dinn via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
On 31/10/2020 23:26, William Adair via Gdb wrote: > Can anyone recommend a way to start debugging GDB? I've found that when I > compile a 32-bit shared library that GDB is unable to correctly resolve the > symbols in the image and set breakpoints. Even when I reach a segfault and > print the backtrace, the symbols are incorrect or flat out missing. I > already verified that the image has .debug_* sections as would be required > for DWARF debugging, so I'm perplexed as to why GDB cannot correctly > resolve it and am looking for guidance. Well you can, of course, use your currently installed gdb to debug gdb. Build gdb from a downloaded src tree using make install PREFIX=/path/to/install/dir CFLAGS=-g CXXFLAGS=-g. Then run gdb --fullname /path/to/my/newly/built/gdb. When you type run you will enter a nested gdb that you can debug. Hint: before typing run type (gdb) set prompt (outer) That way you can distinguish prompts in the outer gdb from prompts in the inner gdb. n.b.b. make sure to type a space after (outer) or your typing will start right next to the closing bracket regards, After that all you need to do is familiarize wiht the gdb source! Andrew Dinn -----------