Skip to content

Full debug: preserve pointee types for supported thin pointers and references #1119

Closed

Description

@nihalpasham

Description

Full debug metadata records only a pointer display name and emits
DW_TAG_pointer_type with baseType: null. cuda-gdb consequently renders
valid typed pointers/references as void-like *mut () values and cannot apply
typed dereference semantics.

This child of #226 covers the safe first increment: one-word raw pointers and
references whose pointees are primitives, supported fixed arrays, or finite
thin pointer/reference chains.

Minimal reproducer

Under cuda-gdb, inspect raw-pointer/reference locals in the cuda-devtools T06
and T19 kernels, including their types, addresses, and dereferenced values.

Expected behavior

Supported thin pointers have a non-null DWARF pointee type, retain their
original GPU address, and can be dereferenced with the correct element type.

Actual behavior

T06 reports pointer/reference locals as *mut (). T19 confirms that their
runtime values are already correct full GPU addresses; this is a type-metadata
defect, not a value-location defect.

Recent dereference-projection, multi-value-location, and fragment commits do
not add pointee DIType nodes and do not fix this report.

Acceptance criteria

  • Supported thin pointer/reference nodes have a non-null DWARF baseType.
  • Exact metadata tests cover primitive, nested-pointer, and fixed-array
    pointees.
  • cuda-gdb reports correct types and evaluates *ptr / *fptr correctly.
  • Pointer values/addresses remain unchanged.
  • Fat pointers and composite/cyclic or otherwise unsupported pointees retain
    their existing opaque/null-base metadata so their variables do not
    disappear.
  • A typed tree cannot contain an opaque/null-base descendant.
  • Existing slice/function-frame argument visibility does not regress.
  • Debug-off and line-table-only behavior are unchanged; LLVM verification and
    PTX generation pass.

Out of scope / follow-ups

  • Multi-word slices, trait objects, and other fat pointers.
  • Identity-bearing/cyclic composite pointee graphs.

Environment

  • Baseline: 6c5458fe991bbde32c5bee74d87822aef1b5a691
  • CUDA/cuda-gdb: 13.3
  • GPU: RTX 5090 (sm_120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcodegenDevice code-generation pipeline (Rust MIR to IR to PTX)debug infoDebug information in generated PTX/IR (line/source maps)llvm-exportTextual LLVM/NVVM IR exporter (llvm-export crate)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions