-
Ell authored
GimpBacktrace provides an interface for creating and traversing multi-threaded backtraces, as well as querying symbol information. While we already have some backtrace functionality, it relies on external tools for the most part, and as such is rather expensive, and is only meant for producing opaque backtraces. GimpBacktrace, on the other hand, is meant to be relatively cheap (we're going to use it for profiling,) and allow inspection of the backtrace data. In the future, it might make sense to replace some, or all, of the other backtrace functions with GimpBacktrace. GimpBacktrace currently only supports Linux. By default, it uses dladdr() to query symbol information, which is somewhat limited (in particular, it doesn't work for static functions.) When libunwind is installed, GimpBacktrace uses it to get more complete symbol information. libunwind is currently an optional dependency, but it might make sense to promote it to a mandatory, or opt-out, dependency, as it's lightweight and widely available. On other platforms, the GimpBacktrace interface can still be used, but it always returns NULL backtraces. (cherry picked from commit 80bf686c)
536fc332