-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve debugger parser #565
Improve debugger parser #565
Conversation
Currently I'm testing this against this app: package main
import (
"fmt"
)
type demostr struct {
A int
B string
}
func demo() {
for i:=0; i<10; i++ {
fmt.Printf("demo(%d)\n", i)
}
}
func main() {
a := "qwertyuiop[asdfghjkl;'zxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM:Hello world!!@#$%^&*()_+}|\"??><>~,./'\\]=-0987654321`<";
b := 1.12
c := false
var d [12]demostr
e := 2.21
f := b + e
/**/
if c {
fmt.Printf("a: %s \n", a)
fmt.Printf("f: %v \n", f)
} else {
fmt.Printf("f: %v \n", f)
fmt.Printf("a: %s \n", a)
}
/**/
_ = a
_ = c
_ = f
/**/
_ = d
demo();
} |
@josehsantos can you please have a quick look at it and see if it's working for you? I'm compiling against go 1.1.2 right now with the plugin doing all the compilation stuff. The only thing that doesn't work for me is displaying the value of If you don't want to do the whole new upstream + change branches and stuff you can get the build from here: https://www.dropbox.com/sh/kzcmavr2cmqqdqw/fNqiNeKopr/debugger-google-go-language.jar (it contains the latest master as well). Thanks a bunch! |
@dlsniper sorry for the delay, i did downloads of the dropbox version, and almost every things is working, i'm getting an NullPointerException when read the children values,
and watches on global variables is not working, but i think this is gdb bug, i am testing with go 1.2 on mac. |
No worries ;) Thanks! Florin Patan / @dlsniper https://twitter.com/dlsniper On Thu, Jan 30, 2014 at 2:28 PM, José Santos notifications@github.comwrote:
|
Great news everyone! :D I've finished implementing all the tokens that are needed in order to make the program in this example: #565 (comment) work and as far as I can tell... it works! 💃 I've got a bit of cleanup to do and see how I can fix the remaining points but if this takes too long I'll merge this into the debugger branch. Time will tell. |
I've started testing with a new program which revealed a couple of more unhandled cases (shocker :D). package main
import (
"fmt"
)
func foo(i *int) {
fmt.Println(*i)
}
func test() (err error) {
defer func() {
if recover() != nil {
fmt.Println("exception occured")
}
}()
for i := 0; i <= 10; i++ {
foo(&i)
}
foo(nil) // Should be panic
return
}
func main() {
test()
} It was taken from here: https://github.com/golang-samples/basic |
I've finished testing with the above code sample and it seems to be fine. |
We will use our users to do this ;). |
Yes, indeed! The best kind of testing :D Jokes aside, I'm not sure how to add support for breakpoint hit count and conditional stop (which would be nice to have) but I've opened a ticket on the forum to ask for some advice / help. Other then this, I think I've covered all the stuff needed to run this properly. The code is not the state of art, and I think I've broke some sort of record of regular expression usage in a single file, but things can be improved later on :) |
Bummer... Seems GDB doesn't like pointer variables like I'm passing them now... I've added the item to the list for the moment. |
It's with some embarrassment (as someone who had some commits in the early history of this plugin) that I'll admit to having spent the last year or so using GoSublime (to GoSublime's credit, it is quite nice) to write my Go code. However, I've been watching all the recent activity and I'm pretty excited to see where this is going and trying it again. Anyway, I just wanted to say here that you guys might want to close issue #25 since this seems like this PR has the same goal but going miles further than the original plan was for #25. |
#25 will be closed when debugger lands in master. Until then, since it's only an issue without commits, I'll consider that the anchor for this task. |
So.. as it stands, I'll merge this into the debugger branch as it's stable enough (tm). I could spend more time to work on adding a breakpoint hit-count and a conditional breakpoint but I think for the moment it's enough. Also, what's not supported (haven't tested) is how this behaves with goroutines and if it's easy to debug them (or even possible at all). As for debugging the program itself, right now it's a bit of a unnatural way to do it, configure a different runner type, but I have no clue how to change it for now. @mtoader if you think I should add those two things and further investigate the goroutines I'll try and do it. I will definitely spend time to see if I can make the debugging launching simpler. After this, I plan to work on gcc compiler support, as I want to use it in my day to day work and I'm too lazy to do it until I have an automated tool to do it. |
@dlsniper: I think you might be right. I think I stopped using the plugin when I started using Go on the Google App Engine and it really didn't work well. All the recent work has me really excited. |
This aims to improve the debugger parser (it's actually a rewrite of it).
Progress so far: