Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line-based breakpoints set dozens of unwanted ones #12886

Closed
jdm opened this issue Mar 14, 2014 · 5 comments · Fixed by #13556
Closed

Line-based breakpoints set dozens of unwanted ones #12886

jdm opened this issue Mar 14, 2014 · 5 comments · Fixed by #13556
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@jdm
Copy link
Contributor

jdm commented Mar 14, 2014

Debugging code from https://github.com/mozilla-servo/rust-mozjs/, if I set a breakpoint in gdb inside gc_callback in rust.rs I see messages like Breakpoint 2 at 0x408fad: rust.rs:70. (26 locations). This correctly breaks on the line, but trying to advance continues to break on the line each time in inlined code like transmute and borrow.

@michaelwoerister
Copy link
Member

Good catch! I think I had a patch once that would turn off emitting source locations for inlined functions but it will probably be bit-rotted by now. I'll look into it next!

michaelwoerister added a commit to michaelwoerister/rust that referenced this issue Apr 10, 2014
…ons.

This commit makes sure that code inlined from other functions isn't assigned the source position of the call site, since this leads to undesired behavior when setting line breakpoints (issue rust-lang#12886)
@michaelwoerister
Copy link
Member

Can we try to come up with some minimal code to reproduce this behavior reliably? As @alexcrichton pointed out, it would be great to have an autotest before closing the issue.

@jdm
Copy link
Contributor Author

jdm commented Apr 10, 2014

fn bar() -> int {
    let s = Some(5).unwrap();
    s
}

fn main() {
    let _ = bar();
}
(gdb) b inline.rs:2
Breakpoint 1 at 0x404ebb: inline.rs:2. (2 locations)
(gdb) r
Starting program: /tmp/inline 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, inline::bar () at inline.rs:2
2       let s = Some(5).unwrap();
(gdb) n

Breakpoint 1, option::Option$LT$T$GT$::unwrap::he0fbfb416e1da23bIaa::v0.0 () at inline.rs:2
2       let s = Some(5).unwrap();
(gdb) n
inline::bar () at inline.rs:3
3       s
(gdb) q

@michaelwoerister
Copy link
Member

Wow, that was quick :)
Thanks a lot!

@michaelwoerister
Copy link
Member

At least for this example the issue seems to be fixed after PR #13441 has landed. I'll add this to the autotests next week and then, I think, we can close this issue.

alexcrichton pushed a commit to alexcrichton/rust that referenced this issue Apr 10, 2014
…ons.

This commit makes sure that code inlined from other functions isn't assigned the source position of the call site, since this leads to undesired behavior when setting line breakpoints (issue rust-lang#12886)
bors added a commit that referenced this issue Apr 10, 2014
Closes #13441 (debuginfo: Fixes and improvements for #12840, #12886, and #13213)
Closes #13433 (Remove references to @trait from a compiler error message)
Closes #13430 (Fix outdated lint warning about inner attribute)
Closes #13425 (Remove a pile of (mainly) internal `~[]` uses)
Closes #13419 (Stop using transmute_mut in RefCell)
Closes #13417 (Remove an unnecessary file `src/libnative/io/p`.)
Closes #13409 (Closing assorted resolve bugs)
Closes #13406 (Generalized the pretty-print entry points to support `-o <file>`.)
Closes #13403 (test: Add a test for #7663)
Closes #13402 (rustdoc: Prune the paths that do not appear in the index.)
Closes #13396 (rustc: Remove absolute rpaths)
Closes #13371 (Rename ast::Purity and ast::Impure Function. Closes #7287)
Closes #13350 (collections: replace all ~[T] with Vec<T>.)
michaelwoerister added a commit to michaelwoerister/rust that referenced this issue Apr 16, 2014
bors added a commit that referenced this issue Apr 16, 2014
…chton

This is a test case verifying that issue #12886 was indeed fixed by PR #13441 from last week.
Fixes #12886.
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Aug 2, 2022
fix: Fix Semantics::original_ast_node not caching the resulting file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants