Debugging rust code with async functions

Using Rust-GDB

please help to debug rust code with async functions, next command seems to always enter async functions. For example, if I have a breakpoint on the line below, I would expect next jumps to the next line but it will always jump into the file and break on the line with the =>

next on the line below jumps to

let password = password_hash(format!("{}:{}", password, &get_nonce(client).await.unwrap())).to_string();

jumps into


            // Resume the generator, turning the `&mut Context` into a `NonNull` raw pointer. The
            // `.await` lowering will safely cast that back to a `&mut Context`.
            match gen.resume(ResumeTy(NonNull::from(cx).cast::<Context<'static>>())) {
=>              GeneratorState::Yielded(()) => Poll::Pending,
                GeneratorState::Complete(x) => Poll::Ready(x),

this happens for any function with async and getting back out to the next line on my code takes a lot of next typing or step-over buttons when using IDEs

just want to know how other Rustaceans do this

1 Like

You can mark files to be skipped while stepping:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.