How to debug Go programs using GoClipse?

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

Debugger failed to start (after setting breakpoints), so I looked at Stack Overflow as well as the rest of the Internet and found that I needed to install gdb.

The following are the instructions (for T) (by installing gdb via HomeBrew):

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

Now, when I put a breakpoint and run the go program through the Eclipse debugger, it executes the build code instead of the Go code:

eg.

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

responses := [] *HttpResponse{}

When I started the debugger, it opened a file with the name:

rt0_darwin_amd64.s

and the line of code on which it was installed was:

MOVQ    $_rt0_go(SB), AX

"" , ...

( , )... Go Eclipse?

+4
2

Debug Go? ( Debug - , ). , :

Thread [1] 0 (Suspended : Breakpoint)   
    main() at rt0_windows_amd64.s:15 0x42a400   
    KERNEL32!BaseThreadInitThunk() at 0x773259ed    
    0x0 

( : OSX main() at rt0_darwin_amd64.s)

, : , "" . , "" , C ( , ). , : Debug options

"main.main", Go main . , , Run/Resume (F8), .

+5

, , .

, -gcflags "-N -l", http://golang.org/doc/gdb

, gc, . gdb . , , -gcflags -N -l go, .

+1

Source: https://habr.com/ru/post/1547063/


All Articles