]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libbacktrace: suggest how to fix missing debug info
authorIan Lance Taylor <iant@golang.org>
Thu, 11 Jul 2024 22:39:07 +0000 (15:39 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 11 Jul 2024 22:39:07 +0000 (15:39 -0700)
* elf.c (elf_nodebug): Suggest -g.
* macho.c (macho_nodebug): Suggest -g and dsymutil.
* pecoff.c (coff_nodebug): Suggest -g.

libbacktrace/elf.c
libbacktrace/macho.c
libbacktrace/pecoff.c

index 735f8752500897e39dfd8ab37c04cfc3237f9da2..e6a66c0db905df7f456cd74396a21f50a96ddee2 100644 (file)
@@ -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;
 }
 
index 42f24721e6aca882d407f65531ab88566b8be3f8..5ceff05b29a5037c9c7c423cd90168883070fdc2 100644 (file)
@@ -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;
 }
 
index bbb59e26d7a643b16cb318fff09f1c993eb20cd1..e88e4d2b0383cb6ea77943d457219eaf7c3f2ad3 100644 (file)
@@ -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;
 }