From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH v2 0/8] Initial support for ROCm platform (AMD GPU) debugging
Date: Thu, 5 Jan 2023 15:02:29 -0500 [thread overview]
Message-ID: <20230105200237.987771-1-simon.marchi@polymtl.ca> (raw)
This is the v2 of:
https://inbox.sourceware.org/gdb-patches/20221206135729.3937767-1-simon.marchi@efficios.com/
I pushed patches 5, 7, 8 and 9, since I considered them good chances even
outside of this series.
Most other preparatory patches have been reviewed and LGTM'ed by Andrew
Burgess, but they are not really useful on their own, so they are still
in this series. There are no changes in them, except a typo fix in
patch 3.
The only preparatory patch which was not reviewed is "gdb/solib-svr4:
don't disable probes interface if probe not found".
The only changes in the last patch are in the doc. I reduced the size
and scope of the documentation drastically. There was a lot of
information that was only tangentially relevant to GDB, about the
behavior of the rest of the ROCm platform. We agreed that this kind of
information is not relevant for the upstream GDB project (it can still
continue to exist in the downstream ROCm GDB documentation). So I
removed anything that was not documenting concrete use cases of GDB
itself.
Other than that, the last patch didn't change since v1.
Here is the original cover letter (with patch numbers updated):
This patch series adds initial support for debugging programs offloaded
to AMD GPUs using the ROCm platform.
Patches 1 to 7 are preparatory patches, and patch 8 is the big one.
We included in that patch only what we consider to be the bare minimum
for a cohesive first step, something that can be run and tested. See
the commit message of patch 8 for more details.
At the end of this series, it is possible to hit breakpoints in GPU code
and resume execution until the end of the program. Notably, GDB is not
able to compute the backtrace, which is of course an important piece to
do any real debugging. Supporting this will require GDB to support some
extensions to DWARF, which is a big piece in itself. This part, as well
as other features, will come as future patches.
Patch 8 also contains documentation changes. This series was tested on
Ubuntu 22.04, and no regressions appear for x86-64 / Linux debugging
when and the AMDGPU / ROCm platform support is compiled in.
Built-tested with --enable-targets=all.
Porting GDB to the ROCm platform brought up many challenges and has a
few interesting differences, compared to a "standard" CPU port. We did
a presentation at the 2022 Cauldron, in Prague, that explains some of
them:
https://www.youtube.com/watch?v=X1iZ_Ta7jOo
Lancelot SIX (1):
gdb: add supports_arch_info callback to gdbarch_register
Pedro Alves (1):
gdb: make install_breakpoint return a non-owning reference
Simon Marchi (6):
gdbsupport: add type definitions for pid, lwp and tid
gdb: add inferior_pre_detach observable
gdb: add gdbarch_up
gdb/solib-svr4: don't disable probes interface if probe not found
gdb: make gdb_printing_disassembler::stream public
gdb: initial support for ROCm platform (AMDGPU) debugging
gdb/Makefile.in | 17 +-
gdb/NEWS | 7 +
gdb/README | 15 +
gdb/amd-dbgapi-target.c | 1966 +++++++++++++++++++++++++++++
gdb/amd-dbgapi-target.h | 116 ++
gdb/amdgpu-tdep.c | 1367 ++++++++++++++++++++
gdb/amdgpu-tdep.h | 93 ++
gdb/arch-utils.c | 9 +-
gdb/breakpoint.c | 4 +-
gdb/breakpoint.h | 8 +-
gdb/configure | 425 +++++--
gdb/configure.ac | 52 +
gdb/configure.tgt | 23 +-
gdb/disasm.h | 4 +-
gdb/doc/gdb.texinfo | 291 +++++
gdb/gdbarch.h | 12 +-
gdb/observable.c | 1 +
gdb/observable.h | 3 +
gdb/regcache.c | 3 +-
gdb/solib-rocm.c | 679 ++++++++++
gdb/solib-svr4.c | 15 +-
gdb/target.c | 2 +
gdb/testsuite/gdb.rocm/simple.cpp | 48 +
gdb/testsuite/gdb.rocm/simple.exp | 52 +
gdb/testsuite/lib/future.exp | 38 +
gdb/testsuite/lib/gdb.exp | 7 +
gdb/testsuite/lib/rocm.exp | 94 ++
gdbsupport/ptid.h | 18 +-
28 files changed, 5210 insertions(+), 159 deletions(-)
create mode 100644 gdb/amd-dbgapi-target.c
create mode 100644 gdb/amd-dbgapi-target.h
create mode 100644 gdb/amdgpu-tdep.c
create mode 100644 gdb/amdgpu-tdep.h
create mode 100644 gdb/solib-rocm.c
create mode 100644 gdb/testsuite/gdb.rocm/simple.cpp
create mode 100644 gdb/testsuite/gdb.rocm/simple.exp
create mode 100644 gdb/testsuite/lib/rocm.exp
base-commit: 1a8605a8c79b0c4ebc71f5691e36a1338d407837
--
2.39.0
next reply other threads:[~2023-01-05 20:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 20:02 Simon Marchi [this message]
2023-01-05 20:02 ` [PATCH v2 1/8] gdb: add supports_arch_info callback to gdbarch_register Simon Marchi
2023-01-05 20:02 ` [PATCH v2 2/8] gdb: make install_breakpoint return a non-owning reference Simon Marchi
2023-01-05 20:02 ` [PATCH v2 3/8] gdbsupport: add type definitions for pid, lwp and tid Simon Marchi
2023-01-05 20:02 ` [PATCH v2 4/8] gdb: add inferior_pre_detach observable Simon Marchi
2023-01-05 20:02 ` [PATCH v2 5/8] gdb: add gdbarch_up Simon Marchi
2023-01-05 20:31 ` Tom Tromey
2023-01-05 20:36 ` Simon Marchi
2023-01-05 20:41 ` Tom Tromey
2023-01-06 0:48 ` Simon Marchi
2023-01-05 20:02 ` [PATCH v2 6/8] gdb/solib-svr4: don't disable probes interface if probe not found Simon Marchi
2023-01-05 20:02 ` [PATCH v2 7/8] gdb: make gdb_printing_disassembler::stream public Simon Marchi
2023-01-05 20:02 ` [PATCH v2 8/8] gdb: initial support for ROCm platform (AMDGPU) debugging Simon Marchi
2023-01-05 20:17 ` Simon Marchi
2023-01-25 17:03 ` [PATCH v2 0/8] Initial support for ROCm platform (AMD GPU) debugging Simon Marchi
2023-02-02 15:08 ` Simon Marchi
2023-02-06 11:47 ` Tom de Vries
2023-02-06 14:01 ` Lancelot Six
2023-02-06 16:53 ` Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230105200237.987771-1-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).