From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH 0/7] Pass ptid to target_ops register methods
Date: Wed, 08 Mar 2017 16:42:00 -0000 [thread overview]
Message-ID: <20170308164140.7281-1-simon.marchi@ericsson.com> (raw)
GDB uses global variables a lot to indirectly pass information about the debug
context between functions. This patch series tries to reduce this practice a
tiny bit by adding a ptid parameter to the register access methods of the
target_ops interface. This removes a lot of direct references to inferior_ptid
in low level code. Instead, the callers of to_fetch_registers /
to_store_registers / to_prepare_to_store provide the ptid on which to operate.
One of the goals is to reduce the number of times we need to save and restore
inferior_ptid. It should also make it easier to track down the context of why
we are reading/writing registers of a certain thread by looking at the stack.
The buildbot shows good results x86 (32 and 64) and PowerPC. s390 has some
regressions, but I think it's unrelated:
new FAIL: gdb.python/py-mi-events.exp: verify python support
new FAIL: gdb.python/py-mi-events.exp: check if python 2.4
PASS -> FAIL: gdb.threads/schedlock.exp: schedlock=off: cmd=next: call_function=0: other threads ran - unlocked
I built-tested a few other platforms:
- mips64el/linux
- m68k/linux
- powerpc/linux
- powerpc/aix
- arm/linux
- aarch64/linux
- s390x/linux
- x86-64/windows (a x86_64-w64-mingw32 toolchain)
Here are the platforms I didn't test at all:
- anything BSD
- OS X
I tried to identify all the locations impacted by this change and update them
accordingly, but it's almost certain that I forgot or messed up some, sorry in
advance.
Simon Marchi (7):
windows: Don't use current_thread for register fetch/store
Add overload of s390_inferior_tid with a parameter
Define and use typedefs for bsd_uthread_ops fields
Pass down ptid in bsd_uthread_ops layer
Pass ptid to target_fetch_registers
Pass ptid to target_store_registers
Pass ptid to to_prepare_to_store
gdb/aarch64-linux-nat.c | 36 +++++++++++------------
gdb/aix-thread.c | 22 +++++++-------
gdb/alpha-bsd-nat.c | 18 +++++++-----
gdb/amd64-bsd-nat.c | 24 ++++++++-------
gdb/amd64-fbsd-tdep.c | 13 ++++++--
gdb/amd64-linux-nat.c | 14 +++++----
gdb/amd64-obsd-tdep.c | 13 ++++++--
gdb/arm-linux-nat.c | 70 +++++++++++++++++++++++---------------------
gdb/arm-nbsd-nat.c | 56 ++++++++++++++++++-----------------
gdb/bsd-kvm.c | 3 +-
gdb/bsd-uthread.c | 39 ++++++++++++------------
gdb/bsd-uthread.h | 19 +++++++-----
gdb/corelow.c | 6 ++--
gdb/ctf.c | 3 +-
gdb/fbsd-tdep.c | 6 +---
gdb/go32-nat.c | 6 ++--
gdb/hppa-linux-nat.c | 26 ++++++++--------
gdb/hppa-nbsd-nat.c | 18 +++++++-----
gdb/hppa-obsd-nat.c | 18 +++++++-----
gdb/i386-bsd-nat.c | 30 ++++++++++---------
gdb/i386-darwin-nat.c | 10 ++++---
gdb/i386-fbsd-tdep.c | 13 ++++++--
gdb/i386-gnu-nat.c | 14 +++++----
gdb/i386-linux-nat.c | 32 ++++++++++----------
gdb/i386-obsd-tdep.c | 13 ++++++--
gdb/ia64-linux-nat.c | 27 +++++++++--------
gdb/inf-child.c | 9 ++++--
gdb/inf-ptrace.c | 28 ++++++++++--------
gdb/linux-tdep.c | 4 ++-
gdb/m32r-linux-nat.c | 14 +++++----
gdb/m68k-bsd-nat.c | 18 +++++++-----
gdb/m68k-linux-nat.c | 45 +++++++++++++++-------------
gdb/m88k-bsd-nat.c | 12 ++++----
gdb/mips-fbsd-nat.c | 18 +++++++-----
gdb/mips-linux-nat.c | 45 +++++++++++++++-------------
gdb/mips-nbsd-nat.c | 18 +++++++-----
gdb/mips64-obsd-nat.c | 12 ++++----
gdb/nto-procfs.c | 12 ++++----
gdb/ppc-fbsd-nat.c | 18 +++++++-----
gdb/ppc-linux-nat.c | 14 +++++----
gdb/ppc-nbsd-nat.c | 18 +++++++-----
gdb/ppc-obsd-nat.c | 18 +++++++-----
gdb/ppc-ravenscar-thread.c | 32 ++++++++++++--------
gdb/proc-service.c | 36 ++++++++---------------
gdb/procfs.c | 22 +++++++-------
gdb/ravenscar-thread.c | 41 +++++++++++++-------------
gdb/ravenscar-thread.h | 6 ++--
gdb/record-btrace.c | 21 +++++++------
gdb/record-full.c | 13 ++++----
gdb/regcache.c | 6 ++--
gdb/remote-sim.c | 22 +++++++++-----
gdb/remote.c | 17 ++++++-----
gdb/rs6000-aix-tdep.c | 3 +-
gdb/rs6000-lynx178-tdep.c | 3 +-
gdb/rs6000-nat.c | 66 +++++++++++++++++++++--------------------
gdb/s390-linux-nat.c | 26 +++++++++++-----
gdb/sh-nbsd-nat.c | 12 ++++----
gdb/sol-thread.c | 22 +++++++-------
gdb/sparc-nat.c | 14 +++++----
gdb/sparc-nat.h | 4 +--
gdb/sparc-obsd-tdep.c | 13 ++++++--
gdb/sparc-ravenscar-thread.c | 20 ++++++-------
gdb/sparc64-obsd-tdep.c | 13 ++++++--
gdb/spu-linux-nat.c | 3 +-
gdb/spu-multiarch.c | 14 ++++-----
gdb/target-delegates.c | 40 ++++++++++++++-----------
gdb/target.c | 8 ++---
gdb/target.h | 21 ++++++++-----
gdb/tilegx-linux-nat.c | 14 +++++----
gdb/tracefile-tfile.c | 4 +--
gdb/vax-bsd-nat.c | 12 ++++----
gdb/windows-nat.c | 49 +++++++++++++++----------------
gdb/xtensa-linux-nat.c | 46 +++++++++++++++--------------
73 files changed, 819 insertions(+), 656 deletions(-)
--
2.11.0
next reply other threads:[~2017-03-08 16:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 16:42 Simon Marchi [this message]
2017-03-08 16:42 ` [PATCH 5/7] Pass ptid to target_fetch_registers Simon Marchi
2017-03-08 21:08 ` Simon Marchi
2017-03-08 16:42 ` [PATCH 2/7] Add overload of s390_inferior_tid with a parameter Simon Marchi
2017-03-08 16:42 ` [PATCH 7/7] Pass ptid to to_prepare_to_store Simon Marchi
2017-03-08 16:42 ` [PATCH 1/7] windows: Don't use current_thread for register fetch/store Simon Marchi
2017-03-08 16:42 ` [PATCH 4/7] Pass down ptid in bsd_uthread_ops layer Simon Marchi
2017-03-08 16:42 ` [PATCH 6/7] Pass ptid to target_store_registers Simon Marchi
2017-03-08 16:42 ` [PATCH 3/7] Define and use typedefs for bsd_uthread_ops fields Simon Marchi
2017-03-08 17:03 ` [PATCH 0/7] Pass ptid to target_ops register methods Simon Marchi
2017-03-08 23:31 ` Pedro Alves
2017-03-10 16:06 ` Simon Marchi
2017-03-10 17:12 ` Ulrich Weigand
2017-03-10 17:51 ` 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=20170308164140.7281-1-simon.marchi@ericsson.com \
--to=simon.marchi@ericsson.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).