|
Message-ID: <alpine.LNX.2.11.1504092038030.338@monopod.intra.ispras.ru> Date: Thu, 9 Apr 2015 20:57:57 +0300 (MSK) From: Alexander Monakov <amonakov@...ras.ru> To: musl@...ts.openwall.com Subject: Re: Execinfo.h, backtrace is needed. On Thu, 9 Apr 2015, Rich Felker wrote: > I believe there's a third-party libbacktrace that might work with > little or no modification. One specific example would be libbacktrace from GCC, which is available under a BSD-style license: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libbacktrace Building GCC's libbacktrace separately from the rest of the compiler is not straighforward; some time ago I worked on that when importing libbacktrace for use in apitrace project; you can view the result here: https://github.com/apitrace/apitrace/tree/master/thirdparty/libbacktrace (it uses cmake simply because apitrace itself is using cmake). Please note: libbacktrace may be overkill if you don't need DWARF parsing at runtime. For example, if you can perform symbol resolution separately as post-processing, and capturing only stack frame addresses at runtime suffices, libunwind may be the tool for the job. Also, libunwind provides backtrace() as a weak alias to its own unw_backtrace(), so in simple cases it's a drop-in replacement. Hope that helps. Alexander
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.