Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/6] Fix generating core files when GPU waves are present
@ 2026-10-16  5:20 Simon Marchi
  2026-10-16  5:20 ` [PATCH 1/6] gdb/testsuite: make with_rocm_gpu_lock transparent to return Simon Marchi
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Simon Marchi @ 2026-10-16  5:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

The thing that sparked this series is that we identified a problem in
rocgdb with the recently introduced get_ptid_for_slash_proc function.
When GPU waves are present, and especially when a GPU wave is selected,
get_ptid_for_slash_proc will return the ptid of such a wave to be used
for /proc accesses.  All GPU waves have `lwp == 1`, which means GDB
attempts to read from /proc/1, which does not end well.

While looking for a way to expose this problem with what we currently
have upstream, I found that trying to generate a core dump while GPU
waves exist fails quite badly.  The get_ptid_for_slash_proc problem is a
reason, but there are more issues.

The goal of this series is to make it possible to generate a host core
dump while GPU waves are active, and possibly one of those is selected.
It is not a goal of this series to dump the state of GPU waves.
Downstream rocgdb has this functionality, and we want to send it
upstream eventually, just not in this series.

Shahab Vahedi (1):
  gdb/amd-dbgapi: defer TARGET_OBJECT_AUXV xfers to the beneath target

Simon Marchi (5):
  gdb/testsuite: make with_rocm_gpu_lock transparent to return
  gdb/corefile: handle no signalled thread when writing NT_GDB_TDESC
  gdb/amd-dbgapi: handle regno == -1 in fetch_registers and
    store_registers
  gdb/linux-tdep: don't write core file notes for non-Linux threads
  gdb/linux-tdep: ignore non-Linux threads in get_ptid_for_slash_proc

 gdb/amd-dbgapi-target.c                       | 109 +++++++++------
 gdb/elf-none-tdep.c                           |   7 +-
 gdb/gcore.c                                   |  27 ++--
 gdb/gcore.h                                   |   9 +-
 gdb/linux-tdep.c                              |  64 ++++++---
 gdb/testsuite/gdb.rocm/auxv-wave-selected.cpp |  42 ++++++
 gdb/testsuite/gdb.rocm/auxv-wave-selected.exp |  65 +++++++++
 gdb/testsuite/gdb.rocm/gcore-host.cpp         |  42 ++++++
 gdb/testsuite/gdb.rocm/gcore-host.exp         | 125 ++++++++++++++++++
 .../gdb.testsuite/with-rocm-gpu-lock.exp      |  90 +++++++++++++
 .../gcore-exited-selected-thread.c            |  51 +++++++
 .../gcore-exited-selected-thread.exp          |  83 ++++++++++++
 gdb/testsuite/lib/rocm.exp                    |  20 ++-
 13 files changed, 661 insertions(+), 73 deletions(-)
 create mode 100644 gdb/testsuite/gdb.rocm/auxv-wave-selected.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/auxv-wave-selected.exp
 create mode 100644 gdb/testsuite/gdb.rocm/gcore-host.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/gcore-host.exp
 create mode 100644 gdb/testsuite/gdb.testsuite/with-rocm-gpu-lock.exp
 create mode 100644 gdb/testsuite/gdb.threads/gcore-exited-selected-thread.c
 create mode 100644 gdb/testsuite/gdb.threads/gcore-exited-selected-thread.exp


base-commit: 835aee81fa93e587eb9ac73a79e911361ec46d6f
-- 
2.56.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-16  5:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16  5:20 [PATCH 0/6] Fix generating core files when GPU waves are present Simon Marchi
2026-10-16  5:20 ` [PATCH 1/6] gdb/testsuite: make with_rocm_gpu_lock transparent to return Simon Marchi
2026-10-16  5:20 ` [PATCH 2/6] gdb/corefile: handle no signalled thread when writing NT_GDB_TDESC Simon Marchi
2026-10-16  5:20 ` [PATCH 3/6] gdb/amd-dbgapi: handle regno == -1 in fetch_registers and store_registers Simon Marchi
2026-10-16  5:20 ` [PATCH 4/6] gdb/linux-tdep: don't write core file notes for non-Linux threads Simon Marchi
2026-10-16  5:20 ` [PATCH 5/6] gdb/amd-dbgapi: defer TARGET_OBJECT_AUXV xfers to the beneath target Simon Marchi
2026-10-16  5:20 ` [PATCH 6/6] gdb/linux-tdep: ignore non-Linux threads in get_ptid_for_slash_proc Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox