LiteIDE GDB with Golang

I have installed LiteIDE and GDB. I opened a Go project in LiteIDE and added a breakpoint at some point in the code. Then I switched to terminal and ran the project binary which was supposed to trigger a breakpoint and nothing happened. What am I doing wrong?

+3


source to share


2 answers


You have to run the executable from the IDE for the breakpoints to mean something.

Also keep in mind that gdb is mostly pointless since Go 1.3.x and even more so since 1.4 (dev).



From https://golang.org/doc/gdb :

GDB doesn't understand Go programs very well. Stack management, streaming, and the runtime contain aspects that are quite different from the runtime model. GDB expects them to confuse the debugger, even if the program is compiled with gccgo. As a consequence, while GDB can be useful in some situations, it is not a reliable debugger for Go programs, especially those that are highly parallel. Moreover, for the Go project it is not a priority to solve these problems, which is difficult. In short, the instructions below should only be taken as a guide to using GDB when it works, not as a guarantee of success.

More Go-enabled debugging architecture may be needed over time.

+1


source


I am using this package https://github.com/gostart/debug/ and so far this is the best solution I have found. Hope this helps.



0


source







All Articles