From: Ian Lance Taylor Date: Thu, 11 Jul 2024 22:39:07 +0000 (-0700) Subject: libbacktrace: suggest how to fix missing debug info X-Git-Tag: basepoints/gcc-16~7574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b96789abf8a51e8f70309799b5dfee36d4fb3da6;p=thirdparty%2Fgcc.git libbacktrace: suggest how to fix missing debug info * elf.c (elf_nodebug): Suggest -g. * macho.c (macho_nodebug): Suggest -g and dsymutil. * pecoff.c (coff_nodebug): Suggest -g. --- diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c index 735f8752500..e6a66c0db90 100644 --- a/libbacktrace/elf.c +++ b/libbacktrace/elf.c @@ -589,7 +589,7 @@ elf_nodebug (struct backtrace_state *state, uintptr_t pc, return bdata.ret; } - error_callback (data, "no debug info in ELF executable", -1); + error_callback (data, "no debug info in ELF executable (make sure to compile with -g)", -1); return 0; } diff --git a/libbacktrace/macho.c b/libbacktrace/macho.c index 42f24721e6a..5ceff05b29a 100644 --- a/libbacktrace/macho.c +++ b/libbacktrace/macho.c @@ -324,7 +324,7 @@ macho_nodebug (struct backtrace_state *state ATTRIBUTE_UNUSED, backtrace_full_callback callback ATTRIBUTE_UNUSED, backtrace_error_callback error_callback, void *data) { - error_callback (data, "no debug info in Mach-O executable", -1); + error_callback (data, "no debug info in Mach-O executable (make sure to compile with -g; may need to run dsymutil)", -1); return 0; } diff --git a/libbacktrace/pecoff.c b/libbacktrace/pecoff.c index bbb59e26d7a..e88e4d2b038 100644 --- a/libbacktrace/pecoff.c +++ b/libbacktrace/pecoff.c @@ -240,7 +240,7 @@ coff_nodebug (struct backtrace_state *state ATTRIBUTE_UNUSED, backtrace_full_callback callback ATTRIBUTE_UNUSED, backtrace_error_callback error_callback, void *data) { - error_callback (data, "no debug info in PE/COFF executable", -1); + error_callback (data, "no debug info in PE/COFF executable (make sure to compile with -g)", -1); return 0; }