Live data from Hacker News

A cross-platform debugger for Go

blog.mailgun.com

51–60 of 65 posts

Re: A cross-platform debugger for Go

#52
post #51

Curious.. I used debugging in LiteIDE a while back and it seemed to work well. Anyone else using it successfully?

LiteIDE was probably using gdb as a backend. gdb is not a very reliable debugger as of the last few Go releases. Here's a demo of a common failure mode of gdb on Go: occasionally running the entire program when you try to take a single step https://youtu.be/qo4RAPxCTa0?t=351

This failure mode is a large part of why I decided to write godebug.

Re: A cross-platform debugger for Go

#53
post #26

Earlier quoted context omitted.

I'd like to be able to completely pause all goroutines and slowly analyze the state of each one. You can probably just add some mutex or waitgroup to your line() method and just lock it when a goroutine pauses, no?

Yeah, that should be relatively easy to do. We would just skip the "am I the goroutine under the debugger" check here [1] and add some kind of channel communication here [2]. The hardest thing is probably just the UI. How should that functionality work? I'm imagining something like this: >>> pause all All goroutines paused >>> show goroutines 1: foo.go:16 2: foo.go:24 3. bar.go:10 [current] >>> next -> // some code f…

Yep, something like gdb's threads interface.

Re: A cross-platform debugger for Go

#56
post #37
post #3

There's a more, er... traditional, debugger for Golang in the works: https://github.com/derekparker/delve

Comparing the Linux and OSX instructions is fun: https://github.com/derekparker/delve#building

If I remember correctly I had to follow the same instructions for installing gdb too :/

Re: A cross-platform debugger for Go

#57
post #56
post #37

Earlier quoted context omitted.

Comparing the Linux and OSX instructions is fun: https://github.com/derekparker/delve#building

If I remember correctly I had to follow the same instructions for installing gdb too :/

Really? I just did brew install gdb

Re: A cross-platform debugger for Go

#59
post #48
post #12

Earlier quoted context omitted.

http://golang.org/cmd/gc/

I tried using this facility a few months ago based on this very short documentation but couldn't get it working, nor could I search out any further doco on it, so because it wasn't really important I gave up. Can I ask... have any of you ever successfully used this?

Yes, me. It works. :) Also it's used by "go test -cover".

Re: A cross-platform debugger for Go

#60
post #2

This demonstrates the power of Go generators. We're seeing what are typically language features such as generics and debugging being implemented before runtime using code generation. The result is more functionality without an overall increase in runtime size or decrease in runtime performance. It's unusual and it's opinionated, but it works.

What is the difference between the generators in Python vs Go?

They're not the same thing. This is about code generators (https://blog.golang.org/generate) while in Python context you're most likely talking about iteration.
Post reply on HN