Make gdb look for symbol files again


My distribution (Debian) ships debug files in separate packages. So what happens often is that I run a program in gdb until it crashes, in order to obtain a usable backtrace for a bug report. But bt is rather useless, missing the symbol information – because I did not install the corresponding -dbg package.

If I install the package now, is there a way to make gdb search for the symbol files again, without losing my current backtrace?

There is a trick you can use to make gdb try to read symbol files again:

(gdb) nosharedlibrary
(gdb) sharedlibrary

The first command tells it to forget all the symbol information it has, and the second command tells it to re-read it.