public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 00/12] Initial support for ROCm platform (AMDGPU) debugging
Date: Tue,  6 Dec 2022 08:57:17 -0500	[thread overview]
Message-ID: <20221206135729.3937767-1-simon.marchi@efficios.com> (raw)

This patch series adds initial support for debugging programs offloaded
to AMD GPUs using the ROCm platform.

Patches 1 to 11 are preparatory patches, and patch 12 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 12 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 12 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 (10):
  gdbsupport: add type definitions for pid, lwp and tid
  gdb: add inferior_pre_detach observable
  gdb: make gdbarch_alloc take ownership of the tdep
  gdb: add gdbarch_up
  gdbsupport: move libxxhash configure check to gdbsupport
  gdbsupport: move fast_hash to gdbsupport/common-utils.h
  gdbsupport: add gdb::string_view_hash
  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/aarch64-tdep.c                |    5 +-
 gdb/alpha-tdep.c                  |    7 +-
 gdb/amd-dbgapi-target.c           | 1966 +++++++++++++++
 gdb/amd-dbgapi-target.h           |  116 +
 gdb/amdgpu-tdep.c                 | 1367 ++++++++++
 gdb/amdgpu-tdep.h                 |   93 +
 gdb/arc-tdep.c                    |    6 +-
 gdb/arch-utils.c                  |   11 +-
 gdb/arm-tdep.c                    |    6 +-
 gdb/avr-tdep.c                    |    6 +-
 gdb/bfin-tdep.c                   |    6 +-
 gdb/bpf-tdep.c                    |    4 +-
 gdb/breakpoint.c                  |    4 +-
 gdb/breakpoint.h                  |    8 +-
 gdb/configure                     | 3863 +++++++++++++++--------------
 gdb/configure.ac                  |   75 +-
 gdb/configure.tgt                 |   23 +-
 gdb/cris-tdep.c                   |    6 +-
 gdb/csky-tdep.c                   |    7 +-
 gdb/disasm.h                      |    4 +-
 gdb/doc/gdb.texinfo               |  758 ++++++
 gdb/frv-tdep.c                    |   15 +-
 gdb/ft32-tdep.c                   |    6 +-
 gdb/gdbarch.c                     |    6 +-
 gdb/gdbarch.h                     |   17 +-
 gdb/hppa-tdep.c                   |    7 +-
 gdb/i386-tdep.c                   |    7 +-
 gdb/ia64-tdep.c                   |    7 +-
 gdb/lm32-tdep.c                   |    6 +-
 gdb/loongarch-tdep.c              |    6 +-
 gdb/m32c-tdep.c                   |    5 +-
 gdb/m32r-tdep.c                   |    6 +-
 gdb/m68hc11-tdep.c                |    7 +-
 gdb/m68k-tdep.c                   |    7 +-
 gdb/mep-tdep.c                    |    7 +-
 gdb/microblaze-tdep.c             |    5 +-
 gdb/mips-tdep.c                   |    7 +-
 gdb/mn10300-tdep.c                |    6 +-
 gdb/moxie-tdep.c                  |    6 +-
 gdb/msp430-tdep.c                 |    7 +-
 gdb/nds32-tdep.c                  |    8 +-
 gdb/nios2-tdep.c                  |    6 +-
 gdb/observable.c                  |    1 +
 gdb/observable.h                  |    3 +
 gdb/or1k-tdep.c                   |    7 +-
 gdb/regcache.c                    |    3 +-
 gdb/riscv-tdep.c                  |    7 +-
 gdb/rl78-tdep.c                   |    7 +-
 gdb/rs6000-tdep.c                 |    8 +-
 gdb/rx-tdep.c                     |    7 +-
 gdb/s12z-tdep.c                   |    4 +-
 gdb/s390-tdep.c                   |   13 +-
 gdb/s390-tdep.h                   |    2 +
 gdb/sh-tdep.c                     |    6 +-
 gdb/solib-rocm.c                  |  679 +++++
 gdb/solib-svr4.c                  |   15 +-
 gdb/sparc-tdep.c                  |    6 +-
 gdb/symtab.c                      |    2 +-
 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 +
 gdb/tic6x-tdep.c                  |    6 +-
 gdb/utils.h                       |   19 -
 gdb/v850-tdep.c                   |    7 +-
 gdb/xtensa-config.c               |    4 +-
 gdb/xtensa-tdep.c                 |   10 +-
 gdb/z80-tdep.c                    |    6 +-
 gdbserver/config.in               |    3 +
 gdbserver/configure               |  514 ++++
 gdbsupport/Makefile.in            |    3 +
 gdbsupport/common-utils.h         |   38 +
 gdbsupport/common.m4              |   24 +
 gdbsupport/config.in              |    3 +
 gdbsupport/configure              |  514 ++++
 gdbsupport/ptid.h                 |   18 +-
 81 files changed, 8644 insertions(+), 2070 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

-- 
2.38.1


             reply	other threads:[~2022-12-06 13:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 13:57 Simon Marchi [this message]
2022-12-06 13:57 ` [PATCH 01/12] gdb: add supports_arch_info callback to gdbarch_register Simon Marchi
2022-12-06 16:45   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 02/12] gdb: make install_breakpoint return a non-owning reference Simon Marchi
2022-12-06 16:46   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 03/12] gdbsupport: add type definitions for pid, lwp and tid Simon Marchi
2022-12-06 16:36   ` Andrew Burgess
2022-12-07  2:55     ` Simon Marchi
2022-12-06 13:57 ` [PATCH 04/12] gdb: add inferior_pre_detach observable Simon Marchi
2022-12-06 16:39   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 05/12] gdb: make gdbarch_alloc take ownership of the tdep Simon Marchi
2022-12-06 17:06   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 06/12] gdb: add gdbarch_up Simon Marchi
2022-12-06 17:07   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 07/12] gdbsupport: move libxxhash configure check to gdbsupport Simon Marchi
2022-12-06 17:19   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 08/12] gdbsupport: move fast_hash to gdbsupport/common-utils.h Simon Marchi
2022-12-06 17:19   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 09/12] gdbsupport: add gdb::string_view_hash Simon Marchi
2022-12-06 17:19   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 10/12] gdb/solib-svr4: don't disable probes interface if probe not found Simon Marchi
2022-12-06 13:57 ` [PATCH 11/12] gdb: make gdb_printing_disassembler::stream public Simon Marchi
2022-12-06 17:38   ` Andrew Burgess
2022-12-06 13:57 ` [PATCH 12/12] gdb: initial support for ROCm platform (AMDGPU) debugging Simon Marchi
2022-12-06 15:00   ` Eli Zaretskii
2022-12-06 15:10     ` Simon Marchi
2022-12-06 15:42   ` Eli Zaretskii
2022-12-07  2:17     ` Simon Marchi
2022-12-07 13:29       ` Eli Zaretskii
2022-12-16 17:37         ` Simon Marchi
2023-01-05 19:41 ` [PATCH 00/12] Initial " Simon Marchi

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=20221206135729.3937767-1-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --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).