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
Debugger (fixes #25) #588
Debugger (fixes #25) #588
Conversation
I think I've broke something in some of the commits today. If you run the code as it is now, from the debugger branch, can you please tell me the output from the console? There should be a bunch of lines starting with Also, which GDB version are you running on? Thanks! |
I am running with GDB 7.6.1 and Go 1.2
Thanks you. |
@josehsantos seems that for some reason it couldn't load the Go GDB Runtime. Also, it looks like there's no I'll continue to investigate this further. Thanks for helping out! |
@josehsantos I've made some changes and it should now work for you again. Please let me know the outcome of this. Thanks! |
It looks like even with Go 1.1.2, gdb itself is not able to read pointer vars. Unfortunately I'm on Ubuntu 13.10 which means Python 3 for me and the Go team has the gdb helper script for Python 2.7 (oh joy). At least I'm happy to say it works as good as gdb works. |
@dlsniper, breakpoints are ok 👍 but for some reason the "step(s)" are not working, seems like the python helper scripts is not being loaded.
|
i tried debugging manually with gdb to see if this is a problem with the gdb + Go, seems to be working. |
@josehsantos cool. Lets try this:
When you now run debugger it should work / load the runtime stuff now. |
@dlsniper the runtime has loaded, but this continue to failing to step, i also had noted that the variable a := "qwertyuiop[asdfghjkl;'zxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM:Hello world!!@#$%^&*()_+}|\"??><>~,./'\\]=-0987654321`<"; is receiving |
@josehsantos this should work better now :) |
And also the plugin forces the source thing automatically now since there's no issue with it. |
@mtoader if everything goes ok and there are no complaints about it anymore, I'd like to have this merged into master so I can allow others to play around with it, do some other cleanup and have 0.9.16 released soonish :) Thanks! |
@dlsniper cool :), the issue with the string is fixed, but step(ing) is not working. |
Which type of stepping doesn't work? And where do you have the breakpoints? |
i have breakpoints in function calls, and variables operations. all step types are not working, even when i type
to step in the GDB Console is not working.
|
Can you please paste the file go file as well? I don't have the same lines as you for some reason based on the output. Thanks! |
Also, did you run
|
sure, i am using the code from previous PR 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
demo()
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();
} |
Cool. As a note, at least for me, GDB doesn't stop either on lines like |
i have python 2.7.5 |
@mtoader afaik, there shouldn't be any issues with GDB now. I guess we need more testers now :) Thanks! |
hi @dlsniper, i am receiving a ClassNotFoundException on class
|
That's strange. I was sure we are building the plugin for the CI against IDEA IC yet Travis seems to be ok... Maybe there's something wrong in the scripts. I'll check against PHPStorm and IDEA IC when I get home to see what's up but the latest changes should not bring any changes that could cause that. |
@dlsniper sorry was my fault, is all ok, i messed up with my local branch :( because of that i was getting the exception. |
@dlsniper is it hard to add support for remote debug? |
I guess it shouldn't be that hard. I was already thinking about adding debugging support for an already existing process so I guess remote debugging would be a good next step. I do however want this merged to master first since it's quite big as it is and doing 10k changes PRs is something I usually don't do :D |
I've tested the debugger against the example provided in here: https://github.com/Unknwon/build-web-application-with-golang_EN/blob/master/eBook/11.2.md using full workflow described and everything went well. |
I tried using it today (built master) with a fresh project and couldn't get it to work. (linux, idea 13, go 1.2). Are there any special instructions on configuration? hitting the debug button didn't do anything . |
Which gdb version are you using? Also, at the moment you need to create a separate runner from the run configuration, called Go Debug. I know it's not that intuitive but I couldn't figure out how to make it run with the other existing runner. Sorry. |
Also, the debugger will only be as good as gdb + go is, which in case of 1.2.. well it's not that good unfortunately. |
I tried it again now on an existing project, I dunno what I did differently but it works now :) This is super fucking awesome, thanks to whoever worked on this, it's going to take mainstream Go development in general to the next level IMHO :) |
Cool, I'll send a PR to change the supported gdb versions tonight. Thanks for helping out :) |
I have to say that this build from master solved a lot of the issues that bugged me last time I tried using the plugin. I hope it will be an official build soon. |
Yes, we are aware of it, we had some great contributions that fixed a lot of problems ^^. I'll push for adding better support for GOPATH by the end of this (or next week) but unfortunately I can't promise a deadline on this as my job drains most of the resources I have these days. With GOPATH issue enhanced we should have better support for new users as well as an easier to use IDE. If you do find something that's not covered by a issue, feel free to open a new one. Thanks for helping us testing this! |
I came across this little issue, tell me if it's reported: I create my own embedding wrapper around http.ServeMux that had its own |
Hmm, it doesn't look familiar. If you can submit a new issue with a sample of code that reproduces it that would be great. Thanks. |
sure thing, I'll try to create a contained example. |
that's odd, I can't recreate it in an isolated project, and sadly the project I'm working on is not opened so I can't just have you clone it :( it muse be some edge case of namespaces etc |
@dlsniper when using this plugin the "Go Debug" run config is greyed out and displays the following error. Is there any log that I can check to see what is going wrong? There's nothing displayed in the IntelliJ Event Log. |
@twoolie thanks for helping out with testing this. Can you please share more details for it? Which IDEA version (or other IDE) you are using, how did you installed it and what steps have you took to have that appear? Also, what's your gdb version and on which OS are you on? Please feel free to open a separate issue for this. Thank you! |
I'm running To install, I unpacked Idea, installed the latest I will certainly submit a bug if this is a new error, and not simply an unsupported combination. |
@dlsniper I've managed to get past the error by deleting the run configuration that was automatically created, and creating a new "Go Application" configuration, however I've hit another issue. When trying to run the debugger the following commands are issued to GDB.
The problem is that command 4 incorrectly specifies the file to run. Is there any extra configuration I'm missing, or is this just a failure to compute the correct binary output directory? I'm running with the same system as the previous comment, but with the newest version of |
I managed to get past the previous error by setting the "Build before run" option under the run tab. Rest of report moved to: #639 |
@twoolie thanks for reporting that. But could yo please open new issues in the future so that I can keep track of them better? I'll create a new one out of your report now but it's nicer that way. Thanks. |
@dlsniper yes, I will open a new report in the future. |
The previous error happened, because when "Build before run" is disabled, there is no OutputDir and gdb wont find the executable. Fixed by #644 |
The unicorn. At last.
gdb
instead of full pathEarly access preview download here: https://www.dropbox.com/sh/kzcmavr2cmqqdqw/j8wjp8SdNH (the debugger-.. jar). Please understand this is a beta :)