numba_dpex.core.debuginfo¶
Implements a custom debug metadata generator class for numba-dpex kernels.
Overview¶
Classes¶
- class DIBuilder(module, filepath, cgctx, directives_only)¶
Bases:
numba.core.debuginfo.DIBuilder
Overrides Numba’s default DIBuilder with numba-dpex-specific customizations.
Overview
¶ mark_subprogram
(function, qualname, argnames, argtypes, line)Sets DW_AT_name and DW_AT_linkagename tags for a kernel decorated function.
Members
- mark_subprogram(function, qualname, argnames, argtypes, line)¶
Sets DW_AT_name and DW_AT_linkagename tags for a kernel decorated function.
Numba generates a unique name for every function it compiles, but in upstream Numba the unique name is not used as the “qualified” name of the function. The behavior leads to a bug discovered in Numba-dpex when a compiled function uses closure variables. Refer (https://github.com/IntelPython/numba-dpex/issues/898). To resolve the issue numba-dpex uses the unique_name as the qualified name. Refer to
numba_dpex.core.passes.passes.QualNameDisambiguationLowering
. However, doing so breaks setting GDB breakpoints based on function name as the function name is no longer what is in the source, but what is the unique name generated by Numba. To fix it, numba-dpex uses a modified DISubprogram metadata generator. The name (DW_AT_name) tag is set to the base function name, discarding the unique qualifier and linkagename is set to an empty string.