While I totally applaud this effort, how does it not lie? It inserts code into the actual source claiming it is on a line in the original file, but it is in a different line in the compiled version. That seems like it could be a problem at some point, and despite the serious utility in this, I'm not 100% convinced it is the right tool for the job.
Go has special comments for that: "//line filename:line"
A cross-platform debugger for Go
11–20 of 65 posts
Re: A cross-platform debugger for Go
#12Earlier quoted context omitted.
Go has special comments for that: "//line filename:line"
Thanks, I didn't know that. The go/token docs don't say much about it. Do you know if there is better documentation somewhere?
Re: A cross-platform debugger for Go
#13While I totally applaud this effort, how does it not lie? It inserts code into the actual source claiming it is on a line in the original file, but it is in a different line in the compiled version. That seems like it could be a problem at some point, and despite the serious utility in this, I'm not 100% convinced it is the right tool for the job.
Author here. I agree that this could cause surprises. Are there specific cases you have in mind? Two cases I have thought of are stack traces and logging that inspects the stack. In the former case, if you get a stack trace while debugging it will not mean much because the lines do not match those of your code. In the latter case, logging statements may print the wrong things if they depend on being called a certain…
Re: A cross-platform debugger for Go
#14There's a more, er... traditional, debugger for Golang in the works: https://github.com/derekparker/delve
Does Delve only allow you set breakpoints while running the program in Delve?
Re: A cross-platform debugger for Go
#15Re: A cross-platform debugger for Go
#16Re: A cross-platform debugger for Go
#17At one point even I implemented the V8 debugger protocol so you could use the Web Inspector, and an HTTP proxy that would automatically instrument JavaScript files (using synchronous XMLHttpRequests to block execution...), but I don't think I ever posted that code :(
Re: A cross-platform debugger for Go
#18Earlier quoted context omitted.
Author here. I agree that this could cause surprises. Are there specific cases you have in mind? Two cases I have thought of are stack traces and logging that inspects the stack. In the former case, if you get a stack trace while debugging it will not mean much because the lines do not match those of your code. In the latter case, logging statements may print the wrong things if they depend on being called a certain…
[deleted]
I'm concerned about this, too. One of my next high priorities for godebug is to download many open source projects and search for behavior differences caused by the debugger. I would also like to generate new programs and test them as well.
> But, you get the easy 80% with this for sure. I'm just prodding you to work on the other 20%.
I will. I'm excited about the project and want to make it as useful as I can.
Re: A cross-platform debugger for Go
#19Re: A cross-platform debugger for Go
#20Earlier quoted context omitted.
Author here. I agree that this could cause surprises. Are there specific cases you have in mind? Two cases I have thought of are stack traces and logging that inspects the stack. In the former case, if you get a stack trace while debugging it will not mean much because the lines do not match those of your code. In the latter case, logging statements may print the wrong things if they depend on being called a certain…
[deleted]