mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 21:14:27 +01:00
run: pass Ctrl+C to GDB when using -D
This commit is contained in:
14
README.adoc
14
README.adoc
@@ -3326,11 +3326,11 @@ qemu-arm -g 1234 -L . bin/ls
|
|||||||
|
|
||||||
TODO: find source. Lazy now.
|
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
|
./run -D
|
||||||
@@ -3349,7 +3349,13 @@ And in QEMU:
|
|||||||
/pci.sh
|
/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.
|
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.
|
||||||
|
|
||||||
|
|||||||
8
run
8
run
@@ -195,6 +195,12 @@ ${extra_flags} \
|
|||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
if [ -z "$debug_vm" ]; then
|
||||||
|
serial_monitor='-serial mon:stdio \
|
||||||
|
'
|
||||||
|
else
|
||||||
|
serial_monitor=
|
||||||
|
fi
|
||||||
if "$kvm"; then
|
if "$kvm"; then
|
||||||
extra_flags="${extra_flags} -enable-kvm"
|
extra_flags="${extra_flags} -enable-kvm"
|
||||||
fi
|
fi
|
||||||
@@ -205,9 +211,9 @@ ${debug_vm} \
|
|||||||
-device rtl8139,netdev=net0 \\
|
-device rtl8139,netdev=net0 \\
|
||||||
-gdb tcp::1234 \\
|
-gdb tcp::1234 \\
|
||||||
-m '${memory}' \\
|
-m '${memory}' \\
|
||||||
-serial mon:stdio \\
|
|
||||||
-monitor telnet::45454,server,nowait \\
|
-monitor telnet::45454,server,nowait \\
|
||||||
-netdev user,hostfwd=tcp::45455-:45455,hostfwd=tcp::45456-:22,id=net0 \\
|
-netdev user,hostfwd=tcp::45455-:45455,hostfwd=tcp::45456-:22,id=net0 \\
|
||||||
|
${serial_monitor} \
|
||||||
-smp '${cpus}' \\
|
-smp '${cpus}' \\
|
||||||
-trace 'enable=${trace_type},file=${qemu_out_dir}/trace.bin' \\
|
-trace 'enable=${trace_type},file=${qemu_out_dir}/trace.bin' \\
|
||||||
-virtfs 'local,path=${p9_dir},mount_tag=host_scratch,security_model=mapped,id=host_scratch' \\
|
-virtfs 'local,path=${p9_dir},mount_tag=host_scratch,security_model=mapped,id=host_scratch' \\
|
||||||
|
|||||||
Reference in New Issue
Block a user