run: pass Ctrl+C to GDB when using -D

This commit is contained in:
Ciro Santilli
2018-04-26 14:47:40 +01:00
parent 4da17d0816
commit 7c16eb6ec1
2 changed files with 17 additions and 5 deletions

View File

@@ -3326,11 +3326,11 @@ qemu-arm -g 1234 -L . bin/ls
TODO: find source. Lazy now.
=== Debug QEMU
=== Debug the emulator
When you start interacting with QEMU hardware, it is useful to see what is going on inside of QEMU itself.
When you start hacking QEMU or gem5, it is useful to see what is going on inside the emulator themselves.
This is of course trivial since QEMU is just an userland program on the host, but we make it a bit easier with:
This is of course trivial since they are just regular userland programs on the host, but we make it a bit easier with:
....
./run -D
@@ -3349,7 +3349,13 @@ And in QEMU:
/pci.sh
....
Just make sure that you never click inside the QEMU window when doing that, otherwise you mouse gets captured forever, and the only solution I can find is to go to a TTY with `Ctrl-Alt-F1` and `kill` QEMU.
When in <<graphic-mode,non graphic mode>>, using `-D` makes Ctrl-C not get passed to the QEMU guest anymore: it is instead captured by GDB itself, so allow breaking. So e.g. you won't be able to easily quit from a guest progra like:
....
sleep 10
....
In graphic mode, make sure that you never click inside the QEMU graphic while debugging, otherwise you mouse gets captured forever, and the only solution I can find is to go to a TTY with `Ctrl-Alt-F1` and `kill` QEMU.
You can still send key presses to QEMU however even without the mouse capture, just either click on the title bar, or alt tab to give it focus.