-
Notifications
You must be signed in to change notification settings - Fork 8
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
boot-qemu.sh: Add the ability to debug with GDB #5
Conversation
Adding '-s -S' stops the CPU and allows us to connect with GDB via 'target remote :1234'. This implies '-i' so that the machine does not get killed in the middle of debugging. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to:
- print a helpful message like "starting qemu debugging on port XYX\nUse:\ntarget remote :XYZ\nto connect`
- move boot-qemu-help.txt to a README.md file, so that we show info in the github, too. All we do otherwise is cat it. Doesn't need to actually contain markdown.
thanks for the patch!
Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Thanks for the suggestion, done! Let me know if it looks good to you before I merge it.
I will do this in a follow up PR once this has been merged since it is a good idea. |
I wonder if it's good idea to actually start gdb from the script with appropriate commandline like
GitHub renders |
Yeah, as it currently stands the script will just "hang" after printing that message and the QEMU command via
Good to know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Oh! Yeah, that's great! I would love if it prompted me to restart if I quit gdb, too, since you can't restart a kernel image withing gdb AFAIK. |
echo "to connect" | ||
echo | ||
printf '\033[0m' | ||
QEMU=( "${QEMU[@]}" -s -S ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm playing with this now; does this just fallthrough and execute qemu below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see, it sets the arg, then executes below. got it.
Adding '-s -S' stops the CPU and allows us to connect with GDB via
'target remote :1234'.
This implies '-i' so that the machine does not get killed in the middle
of debugging.