-
Notifications
You must be signed in to change notification settings - Fork 261
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
Debugger switches to disassembly when stepping into function even though debug information should be available #251
Comments
Assuming you are not compiling in --release mode, there's probably some problem with debug info emitted by the compiler. For example, it might be missing line number info for some code range in the function prologue. It's also possible, though less likely, that debug info is ok, but LLDB is not interpreting it correctly. |
Thanks any way for the clarification! Do you maybe have an idea how to narrow down the problem, for instance:
Maybe I can also find a minimal reproducing example. The debug experience with vscode-lldb would be really awesome, but switching into disassembly on almost every call totally spoils the process. |
Deciding line number debug info is not an easy task. Which rust version are you using? Can you try upgrading/downgrading? Does this happen with all finctions? |
I was on So far I have actually only once stepped into a function successfully (this |
I second this. I cant debug any of my unit tests because every "step into" turns into disassembly :/ |
I also had this problem. What was causing it was that in the launch config file the executable specified for debugging used a symbolic link in the path. When I changed it from using the symbolic link to the absolute path of the executable then I could step into methods and functions again. Hope that helps. |
I'm having this problem too, with debugging tests for a library. But I can't work out how to make use of the comment by @NickJAllen, because Why did @vadimcn close this as completed? I don't see what was completed. |
Sorry, probably closed this by mistake. But I'll need a solid repro case in order to investigate this. |
Here's what I've been doing. I get the same results whether I'm using Ubuntu 20.04.4 LTS or Windows 10. VS Code 1.68.0 on Ubuntu; 1.65.2 on Windows.
If I put the breakpoint within the |
@cmcqueen You are directing lldb to step into functions implemented by the standard library, for which lldb doesn't know how to locate the source*. This may not be obvious in the first case because of macro expansion. To get into test_pair, you'll need to do step-out (Shift-F11), step-in, repeat several times till you get to the point of interest. * If you wish to step into std, you'll need to set up a source map. |
Okay, that makes sense for the first case, because I guess it would need to construct the vectors that are the function parameters, before stepping into the function itself. But, it doesn't make sense (to me) in the second case—being in |
Yes, it's stepping into std::ops::Index::index. I'll note that normally lldb would skip code without debug info, however since std bundled with the compiler does have debug info (it's just that the source cannot be found without a source mapping), this does not happen. |
Thanks for explaining; that does make sense.
That sounds a little unexpected to people like me, not an expert in these finer points of lldb. Is it possible to change lldb so that it would skip code that has debug info but no source mapping? (I don't know how to set up source mapping for Rust std in VS Code) |
Should be mostly fixed in 1.7.1. CodeLLDB will now set |
OS: Linux, Ubuntu 18.04
VSCode version: 1.14.1
Extension version: 1.4.5
Python version: 3.6.9
LLDB version: none
I still have problems with dropping into disassembly, although I think I shouldn't. According to the user manual:
When I step into a function I almost always end up with the disassembly view, only in rare cases the debugger can follow the Rust source, which makes debugging very hard. For instance, I have a module with the structure:
When I set a break point in function C, I can successfully step into the call to A, but stepping into the call to B drops to disassembly. According to manual this suggests that debug info is available for A, but not for B. At first I was wondering according to which patterns debug info is available, but then I noticed that putting a break point into B actually allows to debug it. So I would guess debug info is available.
Currently I don't see a pattern when stepping into a function succeeds and when it doesn't, except for maybe that it never works for any function outside the same module.
I have tried several ways to define my entries in
launch.json
, but the behavior is the same with both:Any ideas what could be causing this?
Currently I don't have a minimal reproducing example, but if it helps I can try to build one.
The text was updated successfully, but these errors were encountered: