How to debug Go programs using GoClipse?

1,353 views
Skip to first unread message

james....@gmail.com

unread,
Jul 3, 2014, 7:53:30 PM7/3/14
to gocl...@googlegroups.com

Am using Go (go1.3 darwin/amd6) and GoClipse 0.8 on OS X Mavericks...

Was having trouble running the Debugger (after setting breakpoints) so I scoured Stack Overflow and also the rest of the Internet and discovered that I needed to install gdb.

Followed the following instructions (to a T) (by installing gdb via HomeBrew):

http://ntraft.com/installing-gdb-on-os-x-mavericks/

Now, when I place a breakpoint and Run my go program through Eclipse's debugger, it steps through assembly code instead of Go code:

e.g.

A breakpoint was set that this line inside my go program:

responses := [] *HttpResponse{}

When I ran the debugger, it opened up a file called:

rt0_darwin_amd64.s

and the line of code that it was set on was:

MOVQ    $_rt0_go(SB), AX

And when I tried to "Step Over" my code, it kept doing so through these assembly files...

I don't know assembly (and don't think I have the time to learn it)... Is there a simple way of debugging Go program using the Eclipse debugger?

brunomedeiros

unread,
Jul 8, 2014, 8:49:28 AM7/8/14
to gocl...@googlegroups.com
Answered on stack overflow: http://stackoverflow.com/questions/24561329/how-to-debug-go-programs-using-goclipse/24632275

Usually I prefer answering here, but I would be up for getting that rep bounty. :)

greg.w...@gmail.com

unread,
May 15, 2015, 2:56:52 PM5/15/15
to gocl...@googlegroups.com
I don't see how the answer on Stack Overflow answered this question.

The answer does explain how to stop GoClipse from halting at the start of a debugging session instead of going straight to the first breakpoint, but doesn't explain why the debugger won't "step over". 

I'm still having this issue with GoClipse: "step over" is functioning exactly like "step into", making debugging within GoClipse useless. 

Help?

brunomedeiros

unread,
May 19, 2015, 8:57:06 AM5/19/15
to gocl...@googlegroups.com, greg.w...@gmail.com, greg.w...@gmail.com
This is essential information too: https://github.com/GoClipse/goclipse/blob/master/CONTRIBUTING.md#debugger-issues

Particularly:

"Try to reproduce the problem outside of Eclipse, using just the command-line GDB interface. If the problem also occurs there, then it's an issue in either GDB or the Go compiler tools, not GoClipse. For more info on how to use command-line GDB, see http://golang.org/doc/gdb."

Unfortunately if the problem also occurs when running GDB directly, it's likely a bug or limitation with the Go toolchain's debugging support, so there is not much I can do.
Reply all
Reply to author
Forward
0 new messages