qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"David Hildenbrand" <david@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-s390x@nongnu.org, "Beraldo Leal" <bleal@redhat.com>,
	qemu-arm@nongnu.org, devel@lists.libvirt.org,
	qemu-ppc@nongnu.org,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Marek Vasut" <marex@denx.de>, "Thomas Huth" <thuth@redhat.com>,
	"Chris Wulff" <crwulff@gmail.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Nicholas Piggin" <npiggin@gmail.com>
Subject: [PATCH v2 08/14] docs/system: clarify limits of using gdbstub in system emulation
Date: Mon, 20 Nov 2023 15:08:27 +0000	[thread overview]
Message-ID: <20231120150833.2552739-9-alex.bennee@linaro.org> (raw)
In-Reply-To: <20231120150833.2552739-1-alex.bennee@linaro.org>

It seems some users will try and use the gdbstub to debug userspace
inside a system emulation. While possible clarify the limitations of
this approach and direct the users to a less head scratching way of
debugging user-space.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Clarifies: https://gitlab.com/qemu-project/qemu/-/issues/1274
---
 docs/system/gdb.rst | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst
index 9906991b84..c0cc0c9c7e 100644
--- a/docs/system/gdb.rst
+++ b/docs/system/gdb.rst
@@ -60,7 +60,7 @@ As TCG cannot track all memory accesses in user-mode there is no
 support for watchpoints.
 
 Relocating code
----------------
+===============
 
 On modern kernels confusion can be caused by code being relocated by
 features such as address space layout randomisation. To avoid
@@ -68,6 +68,17 @@ confusion when debugging such things you either need to update gdb's
 view of where things are in memory or perhaps more trivially disable
 ASLR when booting the system.
 
+Debugging user-space in system emulation
+========================================
+
+While technically possible to debug a user-space program running
+inside a system image it does present challenges. Kernel preemption
+and execution mode changes between kernel and user mode can make it
+hard to follow whats going on. Unless you are specifically trying to
+debug some interaction between kernel and user-space you are better
+off running your guest program with gdb either in the guest or using
+a gdbserver exposed via a port to the outside world.
+
 Debugging multicore machines
 ============================
 
-- 
2.39.2



  parent reply	other threads:[~2023-11-20 15:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 15:08 [PATCH v2 00/14] random fixes for 8.2 pre-PR (tests, plugins, docs, semihosting) Alex Bennée
2023-11-20 15:08 ` [PATCH v2 01/14] tests/docker: replace fedora-i386 with debian-i686 Alex Bennée
2023-11-20 15:08 ` [PATCH v2 02/14] .gitlab-ci.d/cirrus: Upgrade macOS to 13 (Ventura) Alex Bennée
2023-11-20 15:08 ` [PATCH v2 03/14] tests/docker: merge debian-native with debian-amd64 Alex Bennée
2023-11-20 15:08 ` [PATCH v2 04/14] plugins: fix win plugin tests on cross compile Alex Bennée
2023-11-20 15:08 ` [PATCH v2 05/14] target/nios2: Deprecate the Nios II architecture Alex Bennée
2023-11-20 15:08 ` [PATCH v2 06/14] tests/tcg: fixup Aarch64 semiconsole test Alex Bennée
2023-11-20 15:08 ` [PATCH v2 07/14] docs/emulation: expand warning about semihosting Alex Bennée
2023-11-20 16:15   ` Richard Henderson
2023-11-20 15:08 ` Alex Bennée [this message]
2023-11-20 16:15   ` [PATCH v2 08/14] docs/system: clarify limits of using gdbstub in system emulation Richard Henderson
2023-11-20 17:20   ` Philippe Mathieu-Daudé
2023-11-20 17:26   ` Peter Maydell
2023-11-20 15:08 ` [PATCH v2 09/14] hw/core: skip loading debug on all failures Alex Bennée
2023-11-20 15:08 ` [PATCH v2 10/14] testing: move arm system tests into their own folder Alex Bennée
2023-11-20 15:08 ` [PATCH v2 11/14] tests/tcg: enable arm softmmu tests Alex Bennée
2023-11-20 16:32   ` Richard Henderson
2023-11-20 17:25   ` Peter Maydell
2023-11-20 15:08 ` [PATCH v2 12/14] tests/tcg: enable semiconsole test for Arm Alex Bennée
2023-11-20 15:08 ` [PATCH v2 13/14] configure: don't try a "native" cross for linux-user Alex Bennée
2023-11-20 15:08 ` [PATCH v2 14/14] tests/tcg: finesse the registers check for "hidden" regs Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231120150833.2552739-9-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=bleal@redhat.com \
    --cc=clg@kaod.org \
    --cc=crwulff@gmail.com \
    --cc=danielhb413@gmail.com \
    --cc=david@redhat.com \
    --cc=devel@lists.libvirt.org \
    --cc=erdnaxe@crans.org \
    --cc=iii@linux.ibm.com \
    --cc=ma.mandourr@gmail.com \
    --cc=marex@denx.de \
    --cc=npiggin@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).