Skip to content

[HIPSPV] Preserve device debug info for gdb-oneapi#6

Closed
pvelesko wants to merge 1 commit into
chipStar-llvm-22from
fix-1004-device-debug-info
Closed

[HIPSPV] Preserve device debug info for gdb-oneapi#6
pvelesko wants to merge 1 commit into
chipStar-llvm-22from
fix-1004-device-debug-info

Conversation

@pvelesko

Copy link
Copy Markdown

HIPSPVToolChain::adjustDebugInfoKind() unconditionally forced NoDebugInfo, so -g -O0 produced device SPIR-V with no debug metadata and gdb-oneapi could not resolve source lines or locals in kernels. The stated reason (SPIRV-LLVM-Translator aborting on DW_OP_LLVM_convert) no longer applies — the translator now lowers it to SPIRVDebug::Convert.

This honors the requested debug level and, when -g is given, emits the NonSemantic.Shader.DebugInfo form (--spirv-debug-info-version=nonsemantic-shader-200 + SPV_KHR_non_semantic_info) that Intel IGC/gdb-oneapi consume. Non--g output is unchanged.

Needs validation on Aurora (gdb-oneapi + PVC): build -g -O0, break in-kernel under gdb-oneapi with ZET_ENABLE_PROGRAM_DEBUGGING=1, confirm locals resolve, and confirm the translator does not abort.

Refs CHIP-SPV/chipStar#1004

HIPSPVToolChain::adjustDebugInfoKind() unconditionally forced NoDebugInfo,
so -g/-O0 produced device SPIR-V with no debug metadata at all and
gdb-oneapi could not resolve source lines or locals in kernels. The stated
reason (SPIRV-LLVM-Translator aborting on DW_OP_LLVM_convert) no longer
applies: the translator now lowers it to SPIRVDebug::Convert.

Stop clobbering the requested debug level, and when -g is given emit the
NonSemantic.Shader.DebugInfo form (--spirv-debug-info-version=
nonsemantic-shader-200 plus SPV_KHR_non_semantic_info) that Intel's IGC and
gdb-oneapi consume. The default (no -g) SPIR-V output is unchanged.

Refs: CHIP-SPV/chipStar#1004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant