~/talk

Debugging Code Generation in Go

Talkat GopherCon 2020 · 2020-11-09..11-13· [compilers-and-language-design, go]
links:none on file
slides:none on file

Shows exactly which toolchain steps run with go build -x, keeps the temporary work directory with go build -work, and prints compiler intermediate assembly with go build -gcflags "-S". Demonstrates SSA debugging pages via GOSSAFUNC, escape and liveness diagnostics with -gcflags "-m" and -gcflags "-live", object inspection with go tool objdump and nm, benchmark/profile outputs (bench.out, memprofile, traceprofile), and that the race-enabled compile can surface surprising crashes during the demo. Small reproducible programs make all outputs readable.

AI-written summary · about

  1. 0:00Start
  2. 3:19talk a little bit about the internals of the compiler
  3. 3:31transformations are applied directly on the ast
  4. 5:20build packages
  5. 6:53print out all the actual tooling invocations their inputs
  6. 8:42bring in the final artifacts to the current directory
  7. 8:52investigate the work in directory
  8. 12:56pass some arguments the underlying compiler
  9. 13:31pass flags to the compiler
  10. 18:38disabling optimizations and inlining your final binary
  11. 19:18disable the optimizations
  12. 20:45generate this binary
  13. 23:20supports highlighting of multiple lines
  14. 25:52build gc flag
  15. 27:22the liveness analysis
  16. 30:28take a look at bench dot out
  17. 31:51use dash rays to enable the race detector
  18. 33:22build gc flags
  19. 36:17prints out all the invocations
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.