Skip to content

Commit

Permalink
docs/system: clarify limits of using gdbstub in system emulation
Browse files Browse the repository at this point in the history
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.

Clarifies: https://gitlab.com/qemu-project/qemu/-/issues/1274
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20231120150833.2552739-9-alex.bennee@linaro.org>
  • Loading branch information
stsquad committed Nov 23, 2023
1 parent ef073eb commit 84dd7d8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/system/gdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,25 @@ 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
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 it is 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 what's 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
============================

Expand Down

0 comments on commit 84dd7d8

Please sign in to comment.