[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 44/44] docs: Document how to use gdb with unix sockets
From: |
Peter Maydell |
Subject: |
[PULL 44/44] docs: Document how to use gdb with unix sockets |
Date: |
Wed, 25 Aug 2021 11:35:34 +0100 |
From: Sebastian Meyer <meyer@absint.com>
With gdb 9.0 and better it is possible to connect to a gdbstub
over unix sockets, which is better than a TCP socket connection
in some situations. The QEMU command line to set this up is
non-obvious; document it.
Signed-off-by: Sebastian Meyer <meyer@absint.com>
Message-id: 162867284829.27377.4784930719350564918-0@git.sr.ht
[PMM: Tweaked commit message; adjusted wording in a couple of
places; fixed rST formatting issue; moved section up out of
the 'advanced debugging options' subsection]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
docs/system/gdb.rst | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst
index 144d083df31..bdb42dae2fe 100644
--- a/docs/system/gdb.rst
+++ b/docs/system/gdb.rst
@@ -15,7 +15,8 @@ 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``.)
+connection, use the ``-gdb dev`` option instead of ``-s``. See
+`Using unix sockets`_ for an example.)
.. parsed-literal::
@@ -100,6 +101,29 @@ not just those in the cluster you are currently working
on::
(gdb) set schedule-multiple on
+Using unix sockets
+==================
+
+An alternate method for connecting gdb to the QEMU gdbstub is to use
+a unix socket (if supported by your operating system). This is useful when
+running several tests in parallel, or if you do not have a known free TCP
+port (e.g. when running automated tests).
+
+First create a chardev with the appropriate options, then
+instruct the gdbserver to use that device:
+
+.. parsed-literal::
+
+ |qemu_system| -chardev
socket,path=/tmp/gdb-socket,server=on,wait=off,id=gdb0 -gdb chardev:gdb0 -S ...
+
+Start gdb as before, but this time connect using the path to
+the socket::
+
+ (gdb) target remote /tmp/gdb-socket
+
+Note that to use a unix socket for the connection you will need
+gdb version 9.0 or newer.
+
Advanced debugging options
==========================
--
2.20.1
- [PULL 36/44] target/arm: Re-indent sdiv and udiv helpers, (continued)
- [PULL 36/44] target/arm: Re-indent sdiv and udiv helpers, Peter Maydell, 2021/08/25
- [PULL 34/44] target/arm: Implement MVE scatter-gather immediate forms, Peter Maydell, 2021/08/25
- [PULL 24/44] target/arm: Rename MVEGenDualAccOpFn to MVEGenLongDualAccOpFn, Peter Maydell, 2021/08/25
- [PULL 32/44] target/arm: Implement MVE VCTP, Peter Maydell, 2021/08/25
- [PULL 35/44] target/arm: Implement MVE interleaving loads/stores, Peter Maydell, 2021/08/25
- [PULL 38/44] target/arm: kvm: use RCU_READ_LOCK_GUARD() in kvm_arch_fixup_msi_route(), Peter Maydell, 2021/08/25
- [PULL 37/44] target/arm: Implement M-profile trapping on division by zero, Peter Maydell, 2021/08/25
- [PULL 40/44] fsl-imx6ul: Instantiate SAI1/2/3 and ASRC as unimplemented devices, Peter Maydell, 2021/08/25
- [PULL 43/44] fsl-imx7: Instantiate SAI1/2/3 as unimplemented devices, Peter Maydell, 2021/08/25
- [PULL 39/44] hw/char/pl011: add support for sending break, Peter Maydell, 2021/08/25
- [PULL 44/44] docs: Document how to use gdb with unix sockets,
Peter Maydell <=
- [PULL 41/44] hw/dma/pl330: Add memory region to replace default, Peter Maydell, 2021/08/25
- [PULL 42/44] sbsa-ref: Rename SBSA_GWDT enum value, Peter Maydell, 2021/08/25
- Re: [PULL 00/44] target-arm queue, Peter Maydell, 2021/08/25