GoLand 2021.1 missing symbols - can't view some variables in debugger

Completed

 

I pulled the beta to make sure that wasn't the problem but for whatever reason GoLand is only showing *some* of the variables in the debugger:

If I try to evaluate expression to find them it gives:

This is how I'm setting up my debugger. Is there something else I'm missing?

0
3 comments

I figured it out. I'm not sure if there's a good way to tell the user this but you have to compile with

-gcflags="all=-N -l"

Otherwise the compiler will do a bunch of optimizations that remove these kinds of variables.

0

How do you launch the debug session?

When launching a debug configuration from the IDE, it automatically adds those flags.

And when using the Go Remote configuration they are present in the example text.

2

@... - ah I see it now. I had followed a different tutorial for coming up with the compiler flags required for debugging Terraform and honestly hadn't looked at the build suggestion from GoLang

0

Please sign in to leave a comment.