Skip to content

Line-based breakpoints set dozens of unwanted ones #12886

Closed
@jdm

Description

@jdm
Contributor

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.

Activity

michaelwoerister

michaelwoerister commented on Mar 14, 2014

@michaelwoerister
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

michaelwoerister commented on Apr 10, 2014

@michaelwoerister
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

jdm commented on Apr 10, 2014

@jdm
ContributorAuthor
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

michaelwoerister commented on Apr 10, 2014

@michaelwoerister
Member

Wow, that was quick :)
Thanks a lot!

michaelwoerister

michaelwoerister commented on Apr 10, 2014

@michaelwoerister
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.

added a commit that references this issue on Apr 10, 2014

auto merge of #13443 : alexcrichton/rust/rollup, r=alexcrichton

added a commit that references this issue on Apr 16, 2014

auto merge of #13556 : michaelwoerister/rust/various-fixes, r=alexcri…

added a commit that references this issue on Aug 2, 2022

Auto merge of rust-lang#12886 - Veykril:sema-cache, r=Veykril

added a commit that references this issue on Jun 13, 2024

Auto merge of rust-lang#12886 - GuillaumeGomez:fix-needless_character…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @jdm@michaelwoerister

      Issue actions

        Line-based breakpoints set dozens of unwanted ones · Issue #12886 · rust-lang/rust