-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
no_mangle static symbols have improper debug info #33172
Copy link
Copy link
Closed
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Repro
cargo new --bin staticcd staticadd the following code to
main.rs:cargo buildgdb target/debug/staticbreak static::mainrwhatis TESToutput:
type = <data variable, no debug info>frown
When
TESTis arepr(C)struct, etc., this makes debugging extraordinarily difficult and laborious.Actual Use Case
I'm implementing the gdb debugger interface specified in
/usr/include/link.h, which requires a single symbol,_r_debugto be present in the_DYNAMICarray.(The symbol is actually not exported either, roughly GLOBAL and in the
_DYNAMICarray, which I get around by using a--dynamic-listflag to the linker.)I don't get around the lack of debug symbols at all, which vexes me.