[0/8] Step over thread exit improvements/fixes + AMD GPU

Message ID 20231214202238.1065676-1-pedro@palves.net
Headers
Series Step over thread exit improvements/fixes + AMD GPU |

Message

Pedro Alves Dec. 14, 2023, 8:22 p.m. UTC
  This series is the result of making step-over-thread-exit work
properly with the AMD GPU target.

It includes some improvements to
gdb.threads/step-over-thread-exit.exp, a few core fixes, and then AMD
GPU target fixes.

Finally, the last two patches include tests that we are carrying
downstream, but that unfortunately can't work with upstream GDB yet,
because upstream doesn't understand the DWARF extensions that we are
working hard to get into DWARF 6, so upstream is missing proper
unwinding and accessing variables.  I include them in the series so
reading the patches makes more sense, but I don't plan on pushing
them.  Unless we are OK with adding them upstream with some early
return, effectivelly making them nops.

I sent the first two patches as a separate series last month, and
Simon & Lancelot have meanwhile reviewed this whole series internally
at AMD, which resulted in some further improvements in those first
patches (as well as in the others).

Pedro Alves (8):
  gdb.threads/step-over-thread-exit.exp improvements
  Ensure selected thread after thread exit stop
  displaced_step_finish: Don't fetch the regcache of exited threads
  Step over thread exit, always delete the thread non-silently
  Fix thread target ID of exited waves
  Fix handling of vanishing threads that were stepping/stopping
  Add tests for s_endpgm handling
  Add tests for handling of vanishing threads that were
    stepping/stopping

 gdb/amd-dbgapi-target.c                       | 313 ++++++++++++++----
 gdb/infrun.c                                  |  31 +-
 gdb/observable.c                              |   1 +
 gdb/observable.h                              |   5 +
 gdb/regcache.c                                |   2 +
 .../gdb.rocm/continue-over-kernel-exit.cpp    |  66 ++++
 .../gdb.rocm/continue-over-kernel-exit.exp    | 165 +++++++++
 .../gdb.rocm/step-over-kernel-exit.cpp        |  48 +++
 .../gdb.rocm/step-over-kernel-exit.exp        | 108 ++++++
 .../gdb.threads/step-over-thread-exit.c       |  16 +-
 .../gdb.threads/step-over-thread-exit.exp     | 127 +++++--
 gdb/thread.c                                  |   2 +
 12 files changed, 792 insertions(+), 92 deletions(-)
 create mode 100644 gdb/testsuite/gdb.rocm/continue-over-kernel-exit.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/continue-over-kernel-exit.exp
 create mode 100644 gdb/testsuite/gdb.rocm/step-over-kernel-exit.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/step-over-kernel-exit.exp


base-commit: 1d2f86b6b74e6caae77951353a4c353ce9816374
  

Comments

Pedro Alves Dec. 20, 2023, 9:24 p.m. UTC | #1
Hi!

On 2023-12-14 20:22, Pedro Alves wrote:
> This series is the result of making step-over-thread-exit work
> properly with the AMD GPU target.
> 
> It includes some improvements to
> gdb.threads/step-over-thread-exit.exp, a few core fixes, and then AMD
> GPU target fixes.
> 
> Finally, the last two patches include tests that we are carrying
> downstream, but that unfortunately can't work with upstream GDB yet,
> because upstream doesn't understand the DWARF extensions that we are
> working hard to get into DWARF 6, so upstream is missing proper
> unwinding and accessing variables.  I include them in the series so
> reading the patches makes more sense, but I don't plan on pushing
> them.  Unless we are OK with adding them upstream with some early
> return, effectivelly making them nops.
> 
> I sent the first two patches as a separate series last month, and
> Simon & Lancelot have meanwhile reviewed this whole series internally
> at AMD, which resulted in some further improvements in those first
> patches (as well as in the others).

I've addressed Lancelot's comments (thanks! all adjusted accordingly.), added
corresponding approved-by tags, and pushed this series in, except the tests,
as mentioned above.

Pedro Alves