-
Notifications
You must be signed in to change notification settings - Fork 208
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
Add gdb
pretty-printers for rmm types
#1088
Add gdb
pretty-printers for rmm types
#1088
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts on Python clarity -- I haven't used GDB pretty printers before so forgive me if I'm not aware of some limitations. Does GDB run the Python interpreter from the user environment, or a recent version like 3.8+?
scripts/gdb-pretty-printers.py
Outdated
if char == '>': | ||
depth -= 1 | ||
if depth == 0: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to understand the logic here -- if you only care if the <
brackets are balanced, you can just count those. What's the "not alias" part mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess an example is easiest: std::vector<std::optional<std::pair<int, std::optional<double>>>>
should pass, but std::vector<std::optional<std::pair<int, std::optional<double>>>>::some_templated_type_alias<int>
should fail. gdb
sometimes doesn't resolve type aliases, so the pretty-printer might erroneously be called for such a some_templated_type_alias<int>
, and would fail at accessing the expected members.
gdb runs in the user environment, so I wouldn't bet on recent Python being available unfortunately |
@@ -0,0 +1,2 @@ | |||
source @Thrust_SOURCE_DIR@/scripts/gdb-pretty-printers.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a .in file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is a general convention, but in the projects I worked in, we use it for template files that will be expanded into an actual file by CMake - config headers, pkg-config files etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CMake convention is <file>.suffix.in
for the input to configure_file
. ( .cpp.in
=> .cpp
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a handful of Python improvements. The general approach is much clearer now, with load-pretty-printers.in
and the like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @upsj!
@gpucibot merge |
This applies rmm's configured pre-commit hooks to format the gdb pretty printer script that was recently added (#1088). I would like to move rmm to use pre-commit for all style checks (as was recently done for cudf) and this is a prerequisite step. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) - Mark Harris (https://github.com/harrism) URL: #1127
Description
This PR adds a pretty-printer for
device_uvector
and pulls in Thrust pretty-printers that were added in NVIDIA/thrust#1631. CMake provides a convenience script to load all of the pretty-printers, to resolve the duplication concerns raised in rapidsai/cudf#11499.Example output:
Checklist