Let’s assume you have a coredump from an embedded device and you want to analyse it on your local machine. The issue is that on the embedded device are only the release build artifacts (without any debug symbols).
The precondition
It depends if you have build …
- … one version with debug symbols and then stipped them.
–> Not a problem. Everything is at the same address. Use the build containing the debug symbols. - … two versions, one with debug symbols and one without.
–> Difficult to say. They are two different builds. Everything can be at a different address.
Adding the debug symbols
1. For the application
$ gdb <path/to/debug_build> <path/to/core_dump>
2. For the shared libraries …
- … with an absolute path. (Should point to the toolchain build, containing the debug files.)
(gdb) set sysroot <path>
- … with a relative path. (Should point to the application build, containing the debug files.)
(gdb) set solib-search-path <path>