On Wed, Jul 17, 2024 at 5:40 PM Ian Lance Taylor <i...@golang.org> wrote: > > This libbacktrace patch improves backtrace_print when there is no > debug info. It falls back to calling backtrace_syminfo, and uses that > to print an offset from a symbol if it can. This is a partial fix for > https://github.com/ianlancetaylor/libbacktrace/issues/59. > Bootstrapped and ran libbacktrace testsuite on x86_64-pc-linux-gnu. > Committed to mainline.
And this patch corrects a bug in that patch. Ian
c7c8bcdbb412c71c9522f7874d43a3bd9319b940 diff --git a/libbacktrace/print.c b/libbacktrace/print.c index 70f5a93c49d..d4637af9a4f 100644 --- a/libbacktrace/print.c +++ b/libbacktrace/print.c @@ -77,7 +77,7 @@ static void print_syminfo_callback (void *data, uintptr_t pc, fprintf (pdata->f, "0x%lx ???\n\t%s+0x%lx:0\n", (unsigned long) pc, symname, - pc - symval); + (unsigned long) (pc - symval)); } /* Print one level of a backtrace. */