How to track the call stack of gcc (libbacktrace)

Ian Lance Taylor iant@golang.org
Fri Mar 14 18:51:30 GMT 2025


On Fri, Mar 14, 2025 at 10:51 AM Saifi Khan <
saifi@softwarefreedomproject.org> wrote:

> On Fri, 14 Mar 2025, Basile Starynkevitch wrote:
>
> >
> > The GCC compiler is containing Ian Lance Taylor's libbacktrace.
> > a possibility is to use that library to print your call stack from
> inside your
> > C++ code inside GCC.
> >
>
> When i pass the option `--enable-languages=c,c++` to the `configure`
> script, it appears to me that libbacktrace is not built.
>
> What option do I pass in order to build this library ?
>

It is built and linked into the GCC programs. You can see it being used in
gcc/diagnostic.cc: search for "backtrace" in that file.

Ian


More information about the Gcc-help mailing list