Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLLDB is not able to find default source location #33674
Comments
pcwalton
added
the
A-debuginfo
label
May 16, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I see this on Linux as well. |
This comment has been minimized.
This comment has been minimized.
|
This might be a symptom of the compiler not emitting the DW_AT_main_subprogram attribute. |
This comment has been minimized.
This comment has been minimized.
|
OK, I found the problem: LLDB is looking for a function named "main" when it tries to determine the default location in the source code. Since the compiler generated main function (the one wrapping the user-defined main function) does not have debuginfo attached, LLDB won't find anything. The correct way to handle this would probably be to emit Maybe |
michaelwoerister
changed the title
(OS X) LLDB support is semi-broken
LLDB is not able to find default source location
May 23, 2016
This comment has been minimized.
This comment has been minimized.
|
I didn't find anything that |
michaelwoerister
added
the
P-low
label
May 23, 2016
This comment has been minimized.
This comment has been minimized.
|
It's low priority in that it's not a big deal, and it's easy to work around, but it does give people a negative impression, as the comment leading to the report suggests. Maybe this is something that's not a big deal, but might not be hard and lead to some perception gains? I don't know anything about generating debuginfo, so I don't know how tough it actually is... On May 23, 2016, 18:49 -0400, Michael Woeristernotifications@github.com, wrote:
|
This comment has been minimized.
This comment has been minimized.
|
I'll take at look how GDB finds the correct function and see if that can help us here in any way. However, really fixing this would mean not only extending rustc, but also LLVM and LLDB. LLVM does not currently give us a way of marking the entry function correctly (via adding the |
michaelwoerister
removed
the
P-low
label
May 24, 2016
This comment has been minimized.
This comment has been minimized.
Tobi34
commented
Jul 1, 2016
|
Is there an easy workaround for this issue ? If yes, what is it ? |
This comment has been minimized.
This comment has been minimized.
Yes, you can just manually set a breakpoint wherever you want. You just have to specify the file you want to set the breakpoint in (which you would have to do anyway if your program has more than one source file). |
This comment has been minimized.
This comment has been minimized.
Tobi34
commented
Jul 1, 2016
|
Thank You very much. I can set breakpoints, but I am not able to see the source code. settings set target.hand-written-source-paths ./src/main.rs http://main.rs/ ./src/somewhere.rs http://somewhere.rs/ ... To get the sources into rust-lldb.
|
This comment has been minimized.
This comment has been minimized.
The debuginfo in your binary should store the paths to your source files. How are you compiling your program? Maybe you don't have debuginfo enabled? |
This comment has been minimized.
This comment has been minimized.
Tobi34
commented
Jul 2, 2016
|
Debugging info should be available, look: Versions: Content Cargo.toml: Build: After running into Breakpoint in "main": |
This comment has been minimized.
This comment has been minimized.
|
Yes, that looks like debuginfo should be contained in your executables.
This is unfortunately an unsupported version of LLDB (see #32520 for more information). The next version of LLDB will not have this problem anymore (older versions didn't have it either). If you are adventurous, you can also build your own version of LLDB. |
This comment has been minimized.
This comment has been minimized.
|
This works with
|
Mark-Simulacrum
closed this
May 6, 2017
This comment has been minimized.
This comment has been minimized.
|
LLDB works fine for me when compiling a single More info: https://www.reddit.com/r/rust/comments/6b8blv/hey_rustaceans_got_an_easy_question_ask_here/dhm7842/ |
This comment has been minimized.
This comment has been minimized.
|
So, the problem is that |
This comment has been minimized.
This comment has been minimized.
|
Interesting. @alexcrichton, is Cargo moving the executable after generating it in |
This comment has been minimized.
This comment has been minimized.
|
I posted a cargo issue: rust-lang/cargo#4056 |
This comment has been minimized.
This comment has been minimized.
|
Excellent, thank you @golddranks! |
mbarnett commentedMay 16, 2016
•
edited
I tried this:
I expected LLDB to actually be able to associate an executable compiled with debugging information to be able to list source code and set breakpoints. Compare GDB's support on the same machine (gdb 7.11 built from homebrew and self-signed for debugging privileges):
LLDB seems functional otherwise, with sources compiled with Clang
If anyone's curious, the rust-lldb wrapper does nothing to alleviate this (nor is it intended to AFAIK):
Meta
This rust was installed from Homebrew. This issue also occurred with 1.7.0.