-
Notifications
You must be signed in to change notification settings - Fork 509
problems integrating Nim pretty printers #210
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
Comments
Hi thanks for reporting this. gdbgui sends commands "behind the scenes" to try to make the experience as good as possible. Sometimes they need some fine tuning. This might be the case here since it looks like you're using nim, which I did not know could be used with gdb (or even existed 😄 ). Regarding I suggest going to settings (gear icon in top right) and unchecking I suspect this breakpoint is added to the address of the main function in a way that gdb could not determine the associated source file, so it puts you in some weird low-level stack at that address and maybe is the source of the "unable to read memory" errors. See if that helps. If not, go back to settings and check |
Thank you for the support. I will try your suggestion as soon as I am back to work. A bit of information about Nim. It is a language that compiles to C with source mapping so that gdb actually sees the Nim files and not the C files. But the underlying data structures are all generated C data structures. That is why pretty printers are so important. |
So I did try it out now here at home. So setting the breakpoint for main does not do the effect. But thank you for pointing out that I can disable it. The breakpoint in main isn't very usable becaues that is where the nim runtime is setup. And normally you don't want to debug that. I did find a workaround though. When I do not have a local .gdbinit, then everything works. But then I also don't have my python script loaded, so I have to type manually 'source nim-gdb.py' inside of gdbgui. I can also hit restart in gdbgui, but then for some reason my python module is unloaded and I have to do 'source nim-gdb.py' as well. Another issue I have right now. I don't see the string representation of 'NCSTRING'. It just pretends it's a pointer to a single character. But I wrote a pretty printer with the correct output. you can see it in the gdb window. And the last thing, on the call stack, the arguments to the functions are not listed. This is also gdbgui only, because bt on the terminal works nicely. |
There is also an issue I have for types where I have the pretty printer overloaded. All of a sudden I can't expand those types anymore. Before I could inspect all the members, now I just can't they are gone. In the screenshot you see on the console that |
You asked me to send you an e-mail. I just wanted to post that content here as well. Here is the transcript. I inserted some whitespace in the output of
This is how the exact same variables looks like in gdbgui. |
cool, thank you for working on this. |
Sure, let me know if you get a chance to test it out. |
Sure I will. But it could take a while, because I don't have any active Nim projects right now. |
Describe the bug
I have written gdp pretty printers in python for the programming language Nim. When I run gdb from the console, everything runs fine. But when I run gdbgui instead of gdb, my gdbinit is executed. I can see that my pretty printers work. But after the output that was caused by my gdbinit, there are also some error messages.
this is my
.gdbinit
in the screenshot you see the output. As you can see, my breakpoint has been reached successfully, but the the line
set breakpoint pending on
that I marked, does not come from me. And all the error messages later are also not coming from me. Also the stack trace on the right is not from me.To Reproduce
Screenshots
Please complete the following information:
Additional context
The text was updated successfully, but these errors were encountered: