Skip to main content

Module debug_source

Module debug_source 

Source
Expand description

The source directory of the kernel debug data. The compile directory of the kernel debug data, found when a kernel compiles.

file!() gives a path relative to the rustc working directory, usually the workspace root. A debugger or a profiler finds such a file only when it runs in that directory. The binary keeps the relative path, so --remap-path-prefix and trim-paths apply to it. When a kernel compiles, cubecl looks for the file, and gives the directory that contains it to the debug data. Thus only the debug data of the kernel has the absolute path, on the computer that has the source.

If no directory has the files, and the kernel has their text (Full), cubecl can write the text into the source cache (CUBECL_SOURCE_CACHE) and give that directory.

The search occurs one time for each file in each process, not for each kernel.

Constants§

SOURCE_ROOT_VAR
The variable that names the root, for a binary that does not run in its source tree.

Functions§

kernel_source_root
The directory for the relative source paths of a kernel with the debug data debug. md5s are the MD5s of the texts that the kernel has (source_md5s). A file with an MD5 matches only a file with the same text.
md5_hex
The MD5 of text, in lowercase hexadecimal.
source_md5s
The MD5 of the source text of each file of a kernel at level, by the path of the file. Empty below DebugInfo::Full, as the macro records the texts only at Full.