You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Associate source file position with closures #10350
externmod foo;fnmain(){letmut y = 2;let x = || {42*7 + y
};
y = 5;
foo::bar(x);}
Compiling with rustc -Z extra-debug-info --lib foo.rs; rustc -L . -Z extra-debug-info bar.rs, and breaking on foo::bar, I do get file/line numbers in the stack trace for the closure.
My bad, I followed up on the thread not realizing -Z debug-info solves the problem. Now, if there was a flag to get stack trace outside GDB... but that's another issue.
Thanks and apologies for needlessly opening the issue.
Activity
jdm commentedon Nov 8, 2013
Are you building with -Z debug-info ? That should make source files and line numbers show up.
emberian commentedon Nov 8, 2013
This shouldn't be that hard, I don't think. gdb would just need to know to dereference the fn pointer and look for debuginfo where it points to.
emberian commentedon Nov 8, 2013
Given:
foo.rs:
bar.rs:
Compiling with
rustc -Z extra-debug-info --lib foo.rs; rustc -L . -Z extra-debug-info bar.rs, and breaking onfoo::bar, I do get file/line numbers in the stack trace for the closure.sanxiyn commentedon Nov 8, 2013
Does someone have a non-working case?
orenbenkiki commentedon Nov 8, 2013
My bad, I followed up on the thread not realizing -Z debug-info solves the problem. Now, if there was a flag to get stack trace outside GDB... but that's another issue.
Thanks and apologies for needlessly opening the issue.
Auto merge of rust-lang#10350 - J-ZhengLi:issue_10272, r=xFrednet
Merge rust-lang#10350