diff mbox series

[03/22] docs: document breakpoint and watchpoint support

Message ID 20230503091244.1450613-4-alex.bennee@linaro.org
State Superseded
Headers show
Series testing/next: cirrus, docker, docs, ci, configs, gitlab | expand

Commit Message

Alex Bennée May 3, 2023, 9:12 a.m. UTC
This varies by accelerator. Also mention the modern bear trap that is
ASLR.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 docs/system/gdb.rst | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Juan Quintela May 3, 2023, 10:30 a.m. UTC | #1
Alex Bennée <alex.bennee@linaro.org> wrote:
> This varies by accelerator. Also mention the modern bear trap that is
> ASLR.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Reviewed-by: Juan Quintela <quintela@redhat.com>

> +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.

Makes sense for everything except debugging ASLR O:-)
diff mbox series

Patch

diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst
index 453eb73f6c..7d3718deef 100644
--- a/docs/system/gdb.rst
+++ b/docs/system/gdb.rst
@@ -46,6 +46,28 @@  Here are some useful tips in order to use gdb on system code:
 3. Use ``set architecture i8086`` to dump 16 bit code. Then use
    ``x/10i $cs*16+$eip`` to dump the code at the PC position.
 
+Breakpoint and Watchpoint support
+=================================
+
+While GDB can always fall back to inserting breakpoints into memory
+(if writable) other features are very much dependent on support of the
+accelerator. For TCG system emulation we advertise an infinite number
+of hardware assisted breakpoints and watchpoints. For other
+accelerators it will depend on if support has been added (see
+supports_guest_debug and related hooks in AccelOpsClass).
+
+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 multicore machines
 ============================