public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: Luis Machado <luis.machado@arm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/8] gdbserver: Add thread parameter to linux_get_auxv and linux_get_hwcap
Date: Sat, 26 Nov 2022 01:37:21 +0000	[thread overview]
Message-ID: <8735a6a432.fsf@linaro.org> (raw)
In-Reply-To: <07552f1c-85bf-0a09-0656-15790248c036@arm.com>


Hello Luis,

Thank you for your review.

Luis Machado <luis.machado@arm.com> writes:

> On 9/8/22 07:41, Thiago Jung Bauermann via Gdb-patches wrote:
>> This patch doesn't change gdbserver behaviour, but after later changes are
>> made it avoids a null pointer dereference when HWCAP needs to be obtained
>> for a specific process while current_thread is nullptr.
>> Fixing linux_read_auxv, linux_get_hwcap and linux_get_hwcap2 to take a
>> thread_info parameter seems more correct than setting current_thread in one
>> particular code path.
>> Changes are propagated to allow passing the thread parameter through the
>> call chain.
>
> I suppose the effects will only be known when later patches are
> applied. But the auxv data is per-process, right?

AFAIK yes.

> It sounds a bit strange to pass a thread for the hwcap/auxv lookup. Is
> there some other reason to do that?

Good point. I did it this way without thinking about it because the
read_auxv methods use current_thread. I changed the patch to add an
“int pid” parameter instead and it worked fine. I still get the PID
from current_thread when it's not available from the calling function
though.

-- 
Thiago

  reply	other threads:[~2022-11-26  1:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  6:41 [PATCH 0/8] gdbserver improvements for AArch64 SVE support Thiago Jung Bauermann
2022-09-08  6:41 ` [PATCH 1/8] gdbserver: Add asserts in register_size and register_data functions Thiago Jung Bauermann
2022-09-20  7:36   ` Luis Machado
2022-11-26  1:36     ` Thiago Jung Bauermann
2022-09-08  6:41 ` [PATCH 2/8] gdbserver: Add thread parameter to linux_get_auxv and linux_get_hwcap Thiago Jung Bauermann
2022-09-20  7:43   ` Luis Machado
2022-11-26  1:37     ` Thiago Jung Bauermann [this message]
2022-09-08  6:41 ` [PATCH 3/8] gdb, gdbserver/aarch64-linux: Allow aarch64_sve_get_vq to return error Thiago Jung Bauermann
2022-09-20  8:07   ` Luis Machado
2022-11-26  1:42     ` Thiago Jung Bauermann
2022-09-08  6:41 ` [PATCH 4/8] gdbserver/linux-aarch64: Factor out function to get aarch64_features Thiago Jung Bauermann
2022-09-20  8:08   ` Luis Machado
2022-11-26  1:44     ` Thiago Jung Bauermann
2022-09-08  6:41 ` [PATCH 5/8] gdbserver: Move target description from being per-process to being per-thread Thiago Jung Bauermann
2022-09-20 11:21   ` Luis Machado
2022-11-26  1:47     ` Thiago Jung Bauermann
2022-09-08  6:41 ` [PATCH 6/8] gdbserver/linux-aarch64: When inferior stops, update its target description Thiago Jung Bauermann
2022-09-20  8:48   ` Luis Machado
2022-11-26  1:49     ` Thiago Jung Bauermann
2022-09-08  6:41 ` [PATCH 7/8] gdb/aarch64: Factor out most of the thread_architecture method Thiago Jung Bauermann
2022-09-20  8:52   ` Luis Machado
2022-11-26  1:49     ` Thiago Jung Bauermann
2022-09-08  6:41 ` [PATCH 8/8] gdb/aarch64: When remote debugging detect changes in the target description Thiago Jung Bauermann
2022-09-20  8:59   ` Luis Machado
2022-11-26  1:50     ` Thiago Jung Bauermann

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=8735a6a432.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@arm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).