]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/amd-dbgapi: add displaced stepping support
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 14 Jan 2025 19:16:23 +0000 (14:16 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Feb 2025 16:45:43 +0000 (11:45 -0500)
commitb9935b23e47b6ff43d8099460b09c2e11666aa47
treec7f585b26b5e1e5c41c71ee575925c4f5eb480a8
parent7f7e6755c55041766b974d649e2ca841fdb1ed94
gdb/amd-dbgapi: add displaced stepping support

Implement the target_ops displaced stepping methods to add displaced
stepping support when debugging AMD GPU programs.  The knowledge of how
to prepare and finish displaced steps is provided by the amd-dbgapi
library, so the code here is relatively straightforward.  No need to
parse instructions or handle fixups, that is done by the lib  We just
need to remember, for each thread doing a displaced step, the displaced
stepping id given by the library.

Add a test to exercise the new functionality.  The compiler generates
DWARF that GDB doesn't understand yet [1], so trying to step over a
breakpoint with DWARF present gives:

    (gdb) si
    Unhandled dwarf expression opcode 0xe9

The test purposefully builds the binary without DWARF info to circumvent
this.

[1] https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html

Change-Id: I53f459221a42d4b02a6041eadb8cf554500e2162
Approved-By: Lancelot Six <lancelot.six@amd.com> (amdgpu)
gdb/amd-dbgapi-target.c
gdb/testsuite/gdb.rocm/displaced-stepping.cpp [new file with mode: 0644]
gdb/testsuite/gdb.rocm/displaced-stepping.exp [new file with mode: 0644]