-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
runtime: runtime.closure's returned exectuable data confuses gdb #3738
Labels
Milestone
Comments
To add a bit more color -- there are two separate-but-related issues here: stepping *into* a call-through-function-pointer, and stepping *out* of a function so invoked. With normal compiler flags (none, or just -N) stepping in actually works fine. Stepping out is what confuses gdb in this case, and the only solution is to use "bt" to figure out how you got where you are, then you need to set a breakpoint in the caller and "c"ontinue. Compiling with -l (disable inlining) breaks stepping in as well. In this case, gdb takes you directly into the thunk rather than into the callee. From here you can only "stepi" your way into the callee. Stepping out is broken as before. |
one way to solve that is to use gdb's jit interface http://sourceware.org/gdb/current/onlinedocs/gdb/Registering-Code.html#Registering-Code but i'm afraid it's much too heavy weight for our use case, maybe we just change closure repr. into a pointer pair (code_ptr, env_ptr) and then this will no longer be a problem (additional benefit would be more secure Go binaries with no writable&executable sections). just a side note, misc/cgo/test has code that assumes the current presentation of closures. |
Owner changed to @rsc. |
This issue was closed by revision b1b67a3. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: