[FEA]: Debugger pretty-printers: cuda::annotated_ptr #10100#10232
[FEA]: Debugger pretty-printers: cuda::annotated_ptr #10100#10232iakshayubale wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdded GDB and LLDB pretty-printers for Changesannotated_ptr debugging support
Assessment against linked issues
Possibly related PRs
Suggested reviewers: Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
libcudacxx/test/debugging/annotated_ptr/source.cu (2)
42-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winsuggestion: Resolve the constness of the test storage. These locals are never assigned after initialization; if the
cuda::annotated_ptr<int/float>constructors accept const pointees, declare themconst. Otherwise, document why mutable storage is required rather than silently violating the repository rule.As per coding guidelines, all variables that are not modified must be declared
const.Source: Coding guidelines
41-56: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winsuggestion: Add a null-pointer case to this debugger test matrix. Both printers have a dedicated
nullptrpath, but the current source only constructs non-null pointers, so regressions there will not be caught. Add the corresponding case inlibcudacxx/test/debugging/annotated_ptr/CMakeLists.txtand both expected fixtures.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 16d578af-bd9e-450c-bb12-40cc5a546ad6
📒 Files selected for processing (9)
libcudacxx/share/libcudacxx/gdb/__init__.pylibcudacxx/share/libcudacxx/gdb/annotated_ptr.pylibcudacxx/share/libcudacxx/lldb/__init__.pylibcudacxx/share/libcudacxx/lldb/annotated_ptr.pylibcudacxx/test/debugging/CMakeLists.txtlibcudacxx/test/debugging/annotated_ptr/CMakeLists.txtlibcudacxx/test/debugging/annotated_ptr/gdb.expectedlibcudacxx/test/debugging/annotated_ptr/lldb.expectedlibcudacxx/test/debugging/annotated_ptr/source.cu
4c689b3 to
4e126e5
Compare
> Add GDB pretty-printer for cuda::annotated_ptr<_Tp, _Property> * Detects annotated_ptr types with 2 template arguments * Extracts pointee type and access property information * Displays dereferenced pointer value * Formats output as: cuda::annotated_ptr<PointeeType, PropertyType> -> 0xaddress > Add LLDB pretty-printer with equivalent functionality * Uses LLDB SBValue API for safe member and pointer access * Regex pattern matching for robust type detection * Handles edge cases (nullptr, invalid pointers) > Add comprehensive test suite * Test source with three access property scenarios (streaming, persisting, global) * Two inspection points for each property type * Expected output validation files for both GDB and LLDB * CMake integration with test discovery and execution Fixes NVIDIA#10100
4e126e5 to
b3f7119
Compare
|
pre-commit.ci autofix |
Description
This PR adds comprehensive debugger pretty-printer support for
cuda::annotated_ptr<_Tp, _Property>types to libcudacxx, enabling developers to inspect pointer values and access properties in both GDB and LLDB debuggers with enhanced readability.Changes
GDB Pretty-Printer (
libcudacxx/share/libcudacxx/gdb/annotated_ptr.py)cuda::annotated_ptrtypes by examining template arguments__reprmember containing the wrapped pointer valuecuda::annotated_ptr<Type, Property> -> 0xaddressLLDB Pretty-Printer (
libcudacxx/share/libcudacxx/lldb/annotated_ptr.py)Test Suite (
libcudacxx/test/debugging/annotated_ptr/)streaming_annotated_intwithcuda::access_property::streamingpersisting_annotated_intwithcuda::access_property::persistingglobal_annotated_floatwithcuda::access_property::globalstreaming_annotated_intwithnullptrto validate null pointer handlinglibcudacxx_add_pretty_printer_testmacroRegistrations
libcudacxx/share/libcudacxx/gdb/__init__.pyto import and register the new pretty-printerlibcudacxx/share/libcudacxx/lldb/__init__.pyto import and register the new formatterlibcudacxx/test/debugging/CMakeLists.txtto include annotated_ptr tests in the test suiteCloses #10100
Checklist