Debug Golang compiler

I am trying to find a way to debug the go compiler so I can investigate how the AST is transformed into SSA and then into machine code.

I have the source loaded into GoLand but I cannot build and debug from inside the IDE. I have attempted to run the compiler through the command line and attach the IDE to the process, but no debug information is found and I cannot stop at any breakpoints.

I have built the compiler from source using the ./make.bash script and I can’t see any options to build with debug information. Does anyone have any idea how I could make this work? I have also posted this question here:

Thanks!

sorry I not see you want debug in goland

use goland debug compile is easy (I try it with osx system, use it you need install lldb-server first, install it with xcode-select --install)

  1. configure the compile package build

  1. set break point in compile

  1. click debug button you if you view this page be success

1 Like

Works perfect, thanks so much!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.