From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C85D13858D39 for ; Mon, 3 Apr 2023 18:52:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C85D13858D39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com Received: from localhost.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C1F481E0D2; Mon, 3 Apr 2023 14:52:16 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 0/7] amdgpu: handle fork and exec Date: Mon, 3 Apr 2023 14:52:01 -0400 Message-Id: <20230403185208.197965-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1167.1 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 -- 2.40.0