5 ms·
What about debugging? This is the major pain point for me. I've tried using GDB, but... > GDB does not understand Go programs well. The stack management, threa
by tokenizerrr 10y ago
What about debugging? This is the major pain point for me. I've tried using GDB, but...
> GDB does not understand Go programs well. The stack management, threading, and runtime contain aspects that differ enough from the execution model GDB expects that they can confuse the debugger, even when the program is compiled with gccgo. As a consequence, although GDB can be useful in some situations, it is not a reliable debugger for Go programs, particularly heavily concurrent ones. Moreover, it is not a priority for the Go project to address these issues, which are difficult. In short, the instructions below should be taken only as a guide to how to use GDB when it works, not as a guarantee of success.
https://golang.org/doc/gdb https://golang.org/doc/gdb
- woah 10y agoVisual Studio Code has a visual debugger that is close to being on-par with Chrome's JavaScript debugger, at least for me.
- bboreham 10y agoAnd it works with Go, resolving some or all of the issues mentioned?
- tokenizerrr 10y agoI just looked it up, and it integrates with Delve. So it looks promising.
- inglor 10y agoI tried to get it to work the other day (with delve) for a few minutes and I could not. So even if it does it does not do so cleanly.
- muraiki 10y agoHave you tried out Delve? https://github.com/derekparker/delve https://github.com/derekparker/delve I've only used it for simple cases, so I don't know if it helps with your criticisms, but it was designed for Go. I mention this because it seems like many gophers aren't aware of Delve.
- tokenizerrr 10y agoI certainly wasn't aware of Delve. But I also haven't Go'd in a while now. Looks promising.
- arethuza 10y agoI've used Delve from the go plugin in PyCharm and it seems to work pretty well.
- zer00eyz 10y agoIt is strange you ask this, cause it was one of my major issues with diving into golang. The reality is that I don't miss it any more, for two reasons. 1. I have been forced to write solid comprehensive testing. Its a pain, but the pay off has made it worth while. 2. Because you never find all the bugs anyway, instrumentation and logging has become part of everything I do. A framework like go kit can do this out of the box for you or function as a guide for you.
- nameless912 10y agoThere's actually a couple of native go debuggers these days. I don't remember what they're called off the top of my head, but the couple I've played with are very good, bordering on awesome. There's also a go frontend to GDB that's okay, but going native is going to be a better choice in the long run I think.
- rom16384 10y agoI've found godebug [1] useful. It's pretty basic, but has 90% of what I need. [1] https://github.com/mailgun/godebug https://github.com/mailgun/godebug