Is there any way to make Rust generate debug line number attributes for assembly code inside `global_asm`?

gdb cannot follow assembly code in my global_asm!(include_str!(...))

Is there any way to make Rust generate debug line number attributes for assembly code inside global_asm?

Rustc keeps line numbers for asm!() and global_asm!(). It seems LLVM doesn't have a way to accept them though. It accepts arbitrary metadata, which rustc uses this to store the information necessary to map back from inline asm errors to the original rust source code. LLVM entirely ignores it however. It doesn't generate any debuginfo from it.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.