Skip to content
Snippets Groups Projects
  1. Jun 12, 2024
    • Marc-Olivier Andrez's avatar
      build: disable optimizations when building `go` code in Debug mode · 1bf376ad
      Marc-Olivier Andrez authored
      Debugging Go code built without optimizations is easier, as mentioned on
      https://go.dev/doc/gdb#Introduction:
      
      > When you compile and link your Go programs with the gc toolchain on
      > Linux, macOS, FreeBSD or NetBSD, the resulting binaries contain DWARFv4
      > debugging information that recent versions (≥7.5) of the GDB debugger
      > can use to inspect a live process or a core dump.
      >
      > Pass the '-w' flag to the linker to omit the debug information (for
      > example, go build -ldflags=-w prog.go).
      >
      > The code generated by the gc compiler includes inlining of function
      > invocations and registerization of variables. These optimizations can
      > sometimes make debugging with gdb harder. If you find that you need to
      > disable these optimizations, build your program using go build
      > -gcflags=all="-N -l".
      >
      > If you want to use gdb to inspect a core dump, you can trigger a dump
      > on a program crash, on systems that permit it, by setting
      > GOTRACEBACK=crash in the environment (see the runtime package
      > documentation for more info).
      1bf376ad
  2. Jun 04, 2024
  3. May 27, 2024
  4. Feb 11, 2022
  5. Dec 06, 2021
  6. Dec 03, 2021
  7. Nov 16, 2021
  8. Oct 20, 2021
  9. Sep 28, 2021
  10. Sep 08, 2021
  11. Aug 16, 2021
  12. Aug 04, 2021
  13. Jul 15, 2021
  14. Jul 06, 2021
  15. Jun 30, 2021
  16. Jun 22, 2021
  17. Jun 11, 2021
  18. Jun 09, 2021
  19. Jun 08, 2021
  20. May 28, 2021
  21. May 25, 2021
  22. May 17, 2021
  23. May 05, 2021
  24. Apr 01, 2021
  25. Mar 28, 2021
  26. Mar 24, 2021
  27. Mar 23, 2021
  28. Jan 05, 2021
  29. Dec 16, 2020
Loading