Debugging Go Programs with GoClipse: Assembler Code Instead of Go Code Issue
When debugging Go programs using GoClipse, you may encounter situations where the debugger steps through assembly code instead of Go code, even when breakpoints are set on Go program lines. This issue can arise if you have not installed the required GNU Debugger (gdb).
To resolve this, you can follow the instructions to install gdb through HomeBrew, as you mentioned. However, after installing gdb, you may still encounter the same issue.
Investigating the Debug View
When this issue occurs, check the Debug view. If it displays a stack trace that begins with the "main" function, followed by a line number in rt0_darwin_amd64.s for macOS systems (rt0_windows_amd64.s for Windows systems), it indicates that the debugger has stopped automatically on the internal runtime "main" function, which is written in C.
Adjusting Launch Configuration Options
To resolve this issue, go to the launch configuration options. The first option controls whether the program should stop on this internal "main" function. You can change this to "main.main" to stop at the Go main function, or uncheck the option altogether to disable automatic stopping on the runtime "main" function.
Once you have adjusted the launch configuration options, you should be able to debug your Go programs without stepping through assembly code. Click Run / Resume (F8) to continue debugging.
The above is the detailed content of Why Am I Seeing Assembly Code Instead of Go Code When Debugging with GoClipse?. For more information, please follow other related articles on the PHP Chinese website!