[0/7] amdgpu: handle fork and exec

Message ID 20230403185208.197965-1-simon.marchi@efficios.com
Headers
Series amdgpu: handle fork and exec |

Message

Simon Marchi April 3, 2023, 6:52 p.m. UTC
  This series adds support for fork and exec to the amdgpu port.  This
means making sure that the appropriate cleanups are done when an
inferior using the GPU forks and / or execs, and the appropriates
actions taken so that we can properly debug an inferior using the GPU
post-fork or post-exec.

Simon Marchi (7):
  gdb: pass execing and following inferior to inferior_execd observers
  gdb: add inferior_forked observable
  gdb: remove regcache::target
  gdb: add maybe_switch_inferior function
  gdb: make regcache::raw_update switch to right inferior
  gdb: switch to right inferior in fetch_inferior_event
  gdb/amdgpu: add follow fork and exec support

 gdb/amd-dbgapi-target.c                       | 39 ++++++++
 gdb/gdbthread.h                               |  2 +
 gdb/inferior.c                                | 15 ++++
 gdb/inferior.h                                |  7 ++
 gdb/infrun.c                                  | 53 ++++++-----
 gdb/jit.c                                     | 20 +++--
 gdb/linux-tdep.c                              | 10 ++-
 gdb/observable.c                              |  1 +
 gdb/observable.h                              | 17 +++-
 gdb/record-btrace.c                           |  3 +-
 gdb/regcache.c                                | 90 ++++++++++++-------
 gdb/regcache.h                                | 22 +++--
 gdb/solib.c                                   |  3 +-
 .../fork-exec-gpu-to-non-gpu-execee.cpp       | 27 ++++++
 .../fork-exec-gpu-to-non-gpu-execer.cpp       | 55 ++++++++++++
 .../gdb.rocm/fork-exec-gpu-to-non-gpu.exp     | 89 ++++++++++++++++++
 .../fork-exec-non-gpu-to-gpu-execee.cpp       | 36 ++++++++
 .../fork-exec-non-gpu-to-gpu-execer.cpp       | 46 ++++++++++
 .../gdb.rocm/fork-exec-non-gpu-to-gpu.exp     | 88 ++++++++++++++++++
 gdb/thread.c                                  | 14 +++
 20 files changed, 561 insertions(+), 76 deletions(-)
 create mode 100644 gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu-execee.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu-execer.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu.exp
 create mode 100644 gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execee.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execer.cpp
 create mode 100644 gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu.exp
  

Comments

Simon Marchi April 13, 2023, 3:54 p.m. UTC | #1
On 4/3/23 14:52, Simon Marchi via Gdb-patches wrote:
> This series adds support for fork and exec to the amdgpu port.  This
> means making sure that the appropriate cleanups are done when an
> inferior using the GPU forks and / or execs, and the appropriates
> actions taken so that we can properly debug an inferior using the GPU
> post-fork or post-exec.

If there is no feedback on this (the non-amdgpu-specific bits may be
relevant to review), I intend to push this next week.

Simon
  
Simon Marchi April 17, 2023, 5:57 p.m. UTC | #2
On 4/13/23 11:54, Simon Marchi wrote:
> On 4/3/23 14:52, Simon Marchi via Gdb-patches wrote:
>> This series adds support for fork and exec to the amdgpu port.  This
>> means making sure that the appropriate cleanups are done when an
>> inferior using the GPU forks and / or execs, and the appropriates
>> actions taken so that we can properly debug an inferior using the GPU
>> post-fork or post-exec.
> 
> If there is no feedback on this (the non-amdgpu-specific bits may be
> relevant to review), I intend to push this next week.
> 
> Simon

I just pushed this.

Simon