-
Notifications
You must be signed in to change notification settings - Fork 542
Section 7.2. (mis)Optimization : Can not play the debug session as described in the tutorial #320
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
Comments
I've run into the same problem. |
I see the individual string movements are there, try using stepi (or si) to step by machine instruction rather than line. Lights should then individually switch on and off. |
I am also working on the same chapter and facing the same issue in mis(optimization). Nothing comes after this |
I think this is an artefact of optimisation, which can create a bit of a discontinuity between your source and the assembly. The debugger attempts to step through your source, but the source no longer sufficiently corresponds with the assembly and it gets a bit lost (this is the extent to which I understand how debugging and debugging symbols work... it's not a very deep understanding!). It still executes the program. The simple solution, as @benschneider points out, is to just step through the assembly one instruction at a time with @japaric: I'm happy to submit a PR, but there appear to be several stale issues and PRs associated with this section already (#238, #245, and #237 are the obvious ones). Also, it looks like the most recent commit to discovery/src/07-registers/optimization.md (cdf6be) actually changed from stepping through the assembly to stepping through the source, so maybe we in this thread are simply doing something wrong... |
Hi everyone,
I have some troubles at running this section correctly.
First, here are my version of rustup and rustc :
The problem is that I can not execute step by step (using the gdb
next
instruction) the binary launched withcargo run --release
. Here after is my session :after the second
next
instruction, I enter in the loop rather to go to the nextwrite_volatile
...If I disassemble, I get :
I have noticed that the file mod.rs is not found. Could it be the problem ?
I have searched also in the directory that we can see in the tutorial (~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs) but it is not. May anyone explain me what I have missed ?
Many thanks for your responses :-)
The text was updated successfully, but these errors were encountered: