Skip to content

extra-debug-info does not appear to work on OSX with lldb #11352

Closed
@alexcrichton

Description

@alexcrichton

Here's a recent session of mine

$ cat foo.rs                     
fn main() {
    let x = 3;
}
$ rustc -Z extra-debug-info foo.rs                
foo.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] on by default
foo.rs:2     let x = 3;
                 ^
$ lldb ./foo                   
2014-01-06 11:28:25.244 lldb[88932:212f] Metadata.framework [Error]: couldn't get the client port
Current executable set to './foo' (x86_64).
(lldb) b main
Breakpoint 1: where = foo`main, address = 0x0000000100001170
(lldb) c
error: invalid process
(lldb) r
Process 88933 launched: './foo' (x86_64)
Process 88933 stopped
* thread #1: tid = 0x76a58e, 0x0000000100001170 foo`main, queue = 'com.apple.main-thread, stop reason = breakpoint 1.1
    frame #0: 0x0000000100001170 foo`main
foo`main:
-> 0x100001170:  cmpq   %gs:816, %rsp
   0x100001179:  ja     0x100001195               ; main + 37
   0x10000117b:  movabsq $24, %r10
   0x100001185:  movabsq $0, %r11

Even if I continue into my own main function (actually the symbol main::largehashher), I'm not getting any source level debugging.

Is there an extra option that I should be passing or should this be "just working"?

I compiled a C executable with gcc -g and I got nice debug-info without doing anything extra in lldb.

cc @michaelwoerister

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions