From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 00/12] Concurrent displaced stepping
Date: Tue, 10 Nov 2020 16:46:02 -0500 [thread overview]
Message-ID: <20201110214614.2842615-1-simon.marchi@efficios.com> (raw)
This patch series changes GDB to allow concurrent displaced steps to
occur simultanesously in a single inferior. The goal is to reduce the
bottleneck in applications that need to do many displaced steps at the
same time.
Patches 09, 11 and 12 are the main ones implementing the feature. The
other ones are mostly preparatory patches to reduce the diff and
complexity in the main ones.
At the end of the series, GDB uses two displaced stepping buffers when
debugging an AMD64/Linux program, so is able to execute two displaced
steps at a time. There isn't a super significant performance
improvement as a result. However, this work was done in the context of
ROCm GDB [1], where we have as many displaced step buffers as there are
threads. In this context, it makes a huge difference. So, the feature
isn't absolutely necessary on AMD64/Linux, but it is there at least to
have one reference implementation of an architecture in upstream using
multiple displaced step buffers, so that it's possible to test the
feature with common hardware.
This was regtested on x86-64 Ubuntu 20.04 using the unix,
native-gdbserver and native-extended-gdbserver boards.
[1] https://github.com/ROCm-Developer-Tools/ROCgdb
Simon Marchi (12):
gdb: add inferior_execd observable
gdb: clear inferior displaced stepping state on exec
gdb: rename things related to step over chains
gdb: rename displaced_step_closure to displaced_step_copy_insn_closure
gdb: rename displaced_step_fixup to displaced_step_finish
gdb: introduce status enum for displaced step prepare/finish
gdb: pass inferior to get_linux_inferior_data
gdb: move displaced stepping types to displaced-stepping.{h,c}
gdb: move displaced stepping logic to gdbarch, allow starting
concurrent displaced steps
gdb: change linux gdbarch data from post to pre-init
gdb: make displaced stepping implementation capable of managing
multiple buffers
gdb: use two displaced step buffers on amd64/Linux
gdb/Makefile.in | 1 +
gdb/aarch64-linux-tdep.c | 3 +-
gdb/aarch64-tdep.c | 18 +-
gdb/aarch64-tdep.h | 5 +-
gdb/alpha-linux-tdep.c | 2 +-
gdb/amd64-linux-tdep.c | 11 +-
gdb/amd64-tdep.c | 23 +-
gdb/amd64-tdep.h | 9 +-
gdb/arc-linux-tdep.c | 2 +-
gdb/arm-linux-tdep.c | 19 +-
gdb/arm-tdep.c | 183 +++----
gdb/arm-tdep.h | 18 +-
gdb/bfin-linux-tdep.c | 2 +-
gdb/cris-linux-tdep.c | 2 +-
gdb/csky-linux-tdep.c | 2 +-
gdb/displaced-stepping.c | 289 +++++++++++
gdb/displaced-stepping.h | 200 ++++++++
gdb/frv-linux-tdep.c | 2 +-
gdb/gdbarch.c | 117 ++++-
gdb/gdbarch.h | 47 +-
gdb/gdbarch.sh | 26 +-
gdb/gdbthread.h | 35 +-
gdb/hppa-linux-tdep.c | 2 +-
gdb/i386-linux-tdep.c | 31 +-
gdb/i386-tdep.c | 14 +-
gdb/i386-tdep.h | 12 +-
gdb/ia64-linux-tdep.c | 2 +-
gdb/inferior.h | 1 +
gdb/infrun.c | 449 ++++++++----------
gdb/infrun.h | 84 +---
gdb/jit.c | 9 +-
gdb/jit.h | 7 -
gdb/linux-tdep.c | 114 ++++-
gdb/linux-tdep.h | 27 +-
gdb/m32r-linux-tdep.c | 2 +-
gdb/m68k-linux-tdep.c | 2 +-
gdb/microblaze-linux-tdep.c | 2 +-
gdb/mips-linux-tdep.c | 2 +-
gdb/mn10300-linux-tdep.c | 2 +-
gdb/nios2-linux-tdep.c | 2 +-
gdb/observable.c | 1 +
gdb/observable.h | 3 +
gdb/or1k-linux-tdep.c | 2 +-
gdb/ppc-linux-tdep.c | 5 +-
gdb/riscv-linux-tdep.c | 2 +-
gdb/rs6000-aix-tdep.c | 6 +-
gdb/rs6000-tdep.c | 94 +++-
gdb/s390-linux-tdep.c | 2 +-
gdb/s390-tdep.c | 22 +-
gdb/sh-linux-tdep.c | 2 +-
gdb/solib.c | 4 +
gdb/sparc-linux-tdep.c | 2 +-
gdb/sparc64-linux-tdep.c | 2 +-
.../gdb.arch/amd64-disp-step-avx.exp | 2 +-
.../forking-threads-plus-breakpoint.exp | 2 +-
.../gdb.threads/non-stop-fair-events.exp | 2 +-
gdb/thread.c | 60 ++-
gdb/tic6x-linux-tdep.c | 2 +-
gdb/tilegx-linux-tdep.c | 2 +-
gdb/xtensa-linux-tdep.c | 2 +-
60 files changed, 1352 insertions(+), 647 deletions(-)
create mode 100644 gdb/displaced-stepping.c
create mode 100644 gdb/displaced-stepping.h
--
2.28.0
next reply other threads:[~2020-11-10 21:46 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 21:46 Simon Marchi via Gdb-patches [this message]
2020-11-10 21:46 ` [PATCH 01/12] gdb: add inferior_execd observable Simon Marchi via Gdb-patches
2020-11-25 1:28 ` Pedro Alves
2020-11-10 21:46 ` [PATCH 02/12] gdb: clear inferior displaced stepping state on exec Simon Marchi via Gdb-patches
2020-11-25 1:28 ` Pedro Alves
2020-12-01 4:27 ` Simon Marchi
2020-11-10 21:46 ` [PATCH 03/12] gdb: rename things related to step over chains Simon Marchi via Gdb-patches
2020-11-25 1:28 ` Pedro Alves
2020-11-25 13:16 ` Simon Marchi via Gdb-patches
2020-11-10 21:46 ` [PATCH 04/12] gdb: rename displaced_step_closure to displaced_step_copy_insn_closure Simon Marchi via Gdb-patches
2020-11-25 1:29 ` Pedro Alves
2020-11-10 21:46 ` [PATCH 05/12] gdb: rename displaced_step_fixup to displaced_step_finish Simon Marchi via Gdb-patches
2020-11-25 1:29 ` Pedro Alves
2020-11-10 21:46 ` [PATCH 06/12] gdb: introduce status enum for displaced step prepare/finish Simon Marchi via Gdb-patches
2020-11-11 23:36 ` Andrew Burgess
2020-11-25 13:17 ` Simon Marchi via Gdb-patches
2020-11-25 1:30 ` Pedro Alves
2020-11-25 13:20 ` Simon Marchi via Gdb-patches
2020-11-10 21:46 ` [PATCH 07/12] gdb: pass inferior to get_linux_inferior_data Simon Marchi via Gdb-patches
2020-11-25 1:30 ` Pedro Alves
2020-11-10 21:46 ` [PATCH 08/12] gdb: move displaced stepping types to displaced-stepping.{h, c} Simon Marchi via Gdb-patches
2020-11-25 1:30 ` Pedro Alves
2020-11-10 21:46 ` [PATCH 09/12] gdb: move displaced stepping logic to gdbarch, allow starting concurrent displaced steps Simon Marchi via Gdb-patches
2020-11-25 1:40 ` Pedro Alves
2020-11-25 19:29 ` Simon Marchi via Gdb-patches
2020-11-25 19:35 ` Simon Marchi
2020-11-26 14:25 ` Pedro Alves
2020-11-30 19:13 ` Simon Marchi via Gdb-patches
2020-11-26 14:24 ` Pedro Alves
2020-11-30 20:26 ` Simon Marchi
2020-11-10 21:46 ` [PATCH 10/12] gdb: change linux gdbarch data from post to pre-init Simon Marchi via Gdb-patches
2020-11-25 1:41 ` Pedro Alves
2020-11-10 21:46 ` [PATCH 11/12] gdb: make displaced stepping implementation capable of managing multiple buffers Simon Marchi via Gdb-patches
2020-11-25 1:41 ` Pedro Alves
2020-11-30 18:58 ` Simon Marchi
2020-11-30 19:01 ` Simon Marchi
2020-11-10 21:46 ` [PATCH 12/12] gdb: use two displaced step buffers on amd64/Linux Simon Marchi via Gdb-patches
2020-11-25 1:42 ` Pedro Alves
2020-11-25 6:26 ` Simon Marchi
2020-11-25 20:07 ` Simon Marchi
2020-11-25 20:56 ` Simon Marchi
2020-11-26 21:43 ` Simon Marchi
2020-11-26 22:34 ` Simon Marchi
2020-11-28 18:56 ` Pedro Alves
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=20201110214614.2842615-1-simon.marchi@efficios.com \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/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