Open
Description
I tried this code, from the gdb testsuite:
fn empty () {
}
fn main () {
let array = [1,2,3,4];
let slice = &array[1..2];
let hello = "hello";
empty(); // STOP
}
I compiled with -g
.
Examining the resulting DWARF, I see:
<1><2a>: Abbrev Number: 2 (DW_TAG_variable)
<2b> DW_AT_name : (indirect string, offset: 0xf3): <std::rt::lang_start::{closure_env#0}<()> as core::ops::function::Fn<()>>::{vtable}
<2f> DW_AT_type : <0x3d>
<33> DW_AT_location : 9 byte block: 3 80 24 5 0 0 0 0 0 (DW_OP_addr: 52480)
I think this should be marked with DW_AT_artificial
, as it does not correspond to any user-written code in the CU. This will let gdb filter out these variables when displaying globals from a CU.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Debugging information in compiled programs (DWARF, PDB, etc.)Category: This is a bug.Relevant to the compiler team, which will review and decide on the PR/issue.Working group: Bad Rust debugging experiences