From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 0/7] Pass ptid to target_ops register methods
Date: Wed, 08 Mar 2017 17:03:00 -0000 [thread overview]
Message-ID: <b483bf32-95fd-6a6a-07c0-5e230d501d93@ericsson.com> (raw)
In-Reply-To: <20170308164140.7281-1-simon.marchi@ericsson.com>
On 17-03-08 11:41 AM, Simon Marchi wrote:
> 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.
Oh, and to give an idea of the impact on the number of references to inferior_ptid,
here are some non-scientific numbers.
Before:
gdb $ grep '[^_]inferior_ptid' *.c | wc -l
973
After:
gdb $ grep '[^_]inferior_ptid' *.c | wc -l
765
next prev parent reply other threads:[~2017-03-08 17:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 16:42 Simon Marchi
2017-03-08 16:42 ` [PATCH 6/7] Pass ptid to target_store_registers 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 1/7] windows: Don't use current_thread for register fetch/store Simon Marchi
2017-03-08 16:42 ` [PATCH 3/7] Define and use typedefs for bsd_uthread_ops fields Simon Marchi
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 7/7] Pass ptid to to_prepare_to_store Simon Marchi
2017-03-08 16:42 ` [PATCH 2/7] Add overload of s390_inferior_tid with a parameter Simon Marchi
2017-03-08 17:03 ` Simon Marchi [this message]
2017-03-08 23:31 ` [PATCH 0/7] Pass ptid to target_ops register methods 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=b483bf32-95fd-6a6a-07c0-5e230d501d93@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