numba-dpex icon indicating copy to clipboard operation
numba-dpex copied to clipboard

DWARF symbol generation failure at -00

Open diptorupd opened this issue 3 years ago • 1 comments

Currently, for every kernel Numba-dpex generates two functions: a wrapper spir_kernel and a spir_func. All the kernel code is inside the spir_kernel.

Enabling debug metadata only adds DWARF symbols to the spir_kernel and not the outer spir_function. At O1 compilation levels the spir_func gents inlined into the spir_kernel and GDB is able to set break points. But, at -O0 inlining is turned off and GDB fails to register any breakpoint as the wrapper spir_function has no debug metadata.

The wrapper function is generated at target.py:generate_kernel_wrapper

diptorupd avatar Mar 11 '21 20:03 diptorupd

@akharche I am thinking of a design where we do not need a wrapper function and generate a single spir_kernel. Till that happens, can you see if we can add debug metadata to the wrapper function that we generate inside target.py:generate_kernel_wrapper?

diptorupd avatar Mar 12 '21 03:03 diptorupd