Skip to content
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

LLDB Pretty Printing #156

Draft
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

canelhasmateus
Copy link
Contributor

Inside .vscode there is lldb.py.
It contains a nim lldb pretty printer ( in the making )
It is necessary because GDB doesn't play well with windows, leaving LLDB as the remaining interactive debugger, which doesn't receive much love today.
Although it does have some ( non - oficial ) support, the instructions and printers are scattered all through the internet.

Currentely the script contains a full lldb api type hinting for python ( the first 13k or so lines ) , followed by a badly coded pretty printer. In the upcoming days, i'll hopefully code this into a more useful state.

Most of the current implementation comes from a random reddit thread , which should ( somehow ) be given credit https://www.reddit.com/r/nim/comments/lhaaa6/debugging_support_formatters_for_lldb_in_vscode/

@saem
Copy link
Collaborator

saem commented Jan 16, 2022

This is cool, @canelhasmateus.

If it helps maybe take a peek at the gdb stuff in the tools directory, it's got tests and you might be able to rig them to also work with this.

We'll have to figure out CI, but one step at a time. At least when I was working tests made it much easier. It was too easy to fix one thing and break another otherwise.

There are also some hints on the gdb one in order to call routines exposed in the compiled binary under debug, which is how we could expose a bunch of reusable (gdb, lldb, and others) work.

Not requirements, just some encouragement and inspiration. 🚀

NIM_GDB="${NIM_GDB:-gdb}"
# exec replaces the new process of bash with gdb. It is always good to
# have fewer processes.
exec "${NIM_GDB}" -eval-command="source $GDB_PYTHON_MODULE_PATH" "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file marked to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was done pretty rushed-ly - i commited whatever was in my staging area, in case my pc caught fire.
don't worry about it too much haha

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I do worry about it. This I wrote this file and it was attacked in the past from left and right. Hand to restore its functionality multiple times. Couldn't find a way to automatically test for this file to work in CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understandable. In its final form, this pr will restore your file to its former glory

@haxscramper haxscramper added enhancement New feature or request tool Improvements to non-compiler tooling labels Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tool Improvements to non-compiler tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants