You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debug info: keep #[kernel] prologue instructions off the attribute line #1117
Breaking on a kernel by name can present the #[kernel] attribute as the first
executable source line. The exact visible stop is debugger/environment
dependent, but the underlying compiler defect remains on current main: emitted
PTX maps executable macro-injected entry work to the attribute line.
This is a related follow-up to the line-table work in #224/#225. It should not
be a native child of #226 because that tracker explicitly excludes line-table
source mapping.
Minimal reproducer
Compile a #[kernel] function with full device debug information, set a
cuda-gdb breakpoint on its source/export name, and inspect the first stop and
the entry .loc directives. The cuda-devtools T01 assessment is the current
integration reproducer.
Expected behavior
Synthetic entry/prologue work must not claim the attribute as an executable
user line. Rewritten thread-index expressions should retain their original
source spans, and the first user-visible stop should be a real body expression.
Actual behavior
On baseline 6c5458fe, the local cuda-gdb run happened to select the first body
statement rather than the attribute, but PTX still contains an attribute-line .loc on the injected make_kernel_scope / thread-index prologue. The old T01
stop is therefore not reliably reproduced, but the bad line mapping is not
fixed.
The proc macro currently gives the synthetic scope binding an ordinary
call-site span chosen for diagnostics, and parse_quote! rebuilding of index
calls loses the original expression span.
Acceptance criteria
Kernel-name breakpoints never present #[kernel] as an executable user line.
LLVM/PTX regression coverage proves the entry prologue has no executable
location for the attribute line.
Rewritten thread-index expressions retain their original source spans.
Tests cover doc comments and multiple attributes rather than relying on a
fixed line offset.
Existing macro diagnostics remain useful.
Full-debug, line-table-only, and debug-off output remain valid.
Activity