-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
How to debug in vscode? #1206
Comments
Hey, @SmallHuaZi |
@SmallHuaZi If you use rust-analyzer, make sure you follow the instructions of this issue reply. It prevents rust-analyzer from screaming at you whenever you are working in a |
Keep in mind this isn't a standard rust app you are writing with this project, It's an Operating System Kernel. So the code is running in an isolated environment provided by QEMU just as it would run on a dedicated PC. You might be able to do it using something like the link here: If you get it working, it might be interesting to write up a blog post and share with the community how you got it working. |
Sorry brothers, I didn't follow github during this time. I know how to use qemu debugging, I've written operating systems in C++ before, but I find this project a bit too large. This is all off topic, when I use gdb or rgdb, breakpoints don't seem to work, and there seems to be some problem with the positioning of the source code, I have not been able to solve this problem, I hope you can give me some help |
Hi @SmallHuaZi, I hope this helps. I have experimented with remote debugging my hobby Rust OS a bit. Strangely enough, although the rustc dev guide suggests the opposite, in my experience, LLDB seems to work better than GDB. This might have something to do with the fact that the relevant information in the guide is 4 years old. Another thing to keep in mind: compared to more established languages like C or C++, Rust still has plenty room for improvement when it comes to debugging. As previous commenters suggested, running a Fortunately, the CodeLLDB extension supports the I suggest you take a look at my scripts plus the debugging (and task) configurations they generate. Assuming you are following along the current (second edition) blog (
At risk of stating the obvious, the |
Thank you @SPuntte. Your instructions were helpful. Maybe a quirk of my setup, but I had to launch the debug target in VSCode before doing the "cargo run -- -s -S" |
Hello author, I'm a new rust developer. I use vscode for rust development on linux . When writing this project, I want to debug but don't know how! This is very painful for me to learn this project. Of course, before asking this question, I used gdb and rust-gdb for remote debugging, but there are always problems in the debugging process, such as the inability to jump to the location of the source code normally, and it seems that the location of lib.rs cannot be located. can you please give me some advice, thank you!
The text was updated successfully, but these errors were encountered: