aboutsummaryrefslogtreecommitdiff
path: root/docs/system/gdb.rst
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-04-03 10:40:14 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-04-14 13:15:40 +0100
commite5910d42dd7a12c66c3a0b050d5f1d2b00b99ea8 (patch)
tree3af5fef3652fcf4b5592e00e5f7032aa7a987020 /docs/system/gdb.rst
parent9edfa3580fd46c74328433544396b2af60522061 (diff)
docs: Improve our gdbstub documentation
The documentation of our -s and -gdb options is quite old; in particular it still claims that it will cause QEMU to stop and wait for the gdb connection, when this has not been true for some time: you also need to pass -S if you want to make QEMU not launch the guest on startup. Improve the documentation to mention this requirement in the executable's --help output, the documentation of the -gdb option in the manual, and in the "GDB usage" chapter. Includes some minor tweaks to these paragraphs of documentation since I was editing them anyway (such as dropping the description of our gdb support as "primitive"). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20200403094014.9589-1-peter.maydell@linaro.org
Diffstat (limited to 'docs/system/gdb.rst')
-rw-r--r--docs/system/gdb.rst24
1 files changed, 16 insertions, 8 deletions
diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst
index 639f814b32..a40145fcf8 100644
--- a/docs/system/gdb.rst
+++ b/docs/system/gdb.rst
@@ -3,17 +3,25 @@
GDB usage
---------
-QEMU has a primitive support to work with gdb, so that you can do
-'Ctrl-C' while the virtual machine is running and inspect its state.
-
-In order to use gdb, launch QEMU with the '-s' option. It will wait for
-a gdb connection:
+QEMU supports working with gdb via gdb's remote-connection facility
+(the "gdbstub"). This allows you to debug guest code in the same
+way that you might with a low-level debug facility like JTAG
+on real hardware. You can stop and start the virtual machine,
+examine state like registers and memory, and set breakpoints and
+watchpoints.
+
+In order to use gdb, launch QEMU with the ``-s`` and ``-S`` options.
+The ``-s`` option will make QEMU listen for an incoming connection
+from gdb on TCP port 1234, and ``-S`` will make QEMU not start the
+guest until you tell it to from gdb. (If you want to specify which
+TCP port to use or to use something other than TCP for the gdbstub
+connection, use the ``-gdb dev`` option instead of ``-s``.)
.. parsed-literal::
- |qemu_system| -s -kernel bzImage -hda rootdisk.img -append "root=/dev/hda"
- Connected to host network interface: tun0
- Waiting gdb connection on port 1234
+ |qemu_system| -s -S -kernel bzImage -hda rootdisk.img -append "root=/dev/hda"
+
+QEMU will launch but will silently wait for gdb to connect.
Then launch gdb on the 'vmlinux' executable::