From: Luis Machado via Gdb-patches <gdb-patches@sourceware.org>
To: Simon Marchi <simark@simark.ca>,
Andrew Burgess <aburgess@redhat.com>,
gdb-patches@sourceware.org, pedro@palves.net
Cc: marcan@marcan.st
Subject: Re: [PATCH] aarch64: Check for valid inferior thread/regcache before reading pauth registers
Date: Fri, 17 Mar 2023 17:38:14 +0000 [thread overview]
Message-ID: <c5c9657e-ecf7-1420-0b77-05a4ba7e673d@arm.com> (raw)
In-Reply-To: <b38626aa-2a08-83ae-22f2-345f321525ee@simark.ca>
On 3/17/23 17:29, Simon Marchi wrote:
>
>> What would be the outcome of this call when there is no active register cache because the inferior
>> has been killed? I think it would assert in find_inferior_pid with a null_ptid.
>>
>> aarch64_remove_non_address_bits gets called for any memory access, so we may be in a state where we have
>> a valid stopped thread, a valid running thread, core file, no inferiors (just reading symbols/bfd) and so
>> on.
>>
>> Or were you considering doing a check for inferior_ptid == null_ptid before calling get_thread_regcache?
>
> Yes, a check for inferior_ptid == null_ptid would make sense. I was
> really just thinking about the initial problem, which is
> aarch64_remove_non_address_bits being called while processing the event
> in thread-db.
I could switch to using inferior_ptid instead of using the helper functions to check current_thread_ if it is
deemed more appropriate.
If the threads are running while we try to read memory, the try/catch block will guard against register read errors.
>
> Simon
next prev parent reply other threads:[~2023-03-17 17:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 10:39 Luis Machado via Gdb-patches
2023-03-16 15:49 ` Andrew Burgess via Gdb-patches
2023-03-16 23:15 ` Luis Machado via Gdb-patches
2023-03-17 17:15 ` Simon Marchi via Gdb-patches
2023-03-17 17:25 ` Luis Machado via Gdb-patches
2023-03-17 17:29 ` Simon Marchi via Gdb-patches
2023-03-17 17:38 ` Luis Machado via Gdb-patches [this message]
2023-03-20 20:06 ` Andrew Burgess via Gdb-patches
2023-03-22 10:26 ` Luis Machado via Gdb-patches
2023-03-23 10:56 ` [PATCH, v2] " Luis Machado via Gdb-patches
2023-03-23 18:25 ` Kevin Buettner via Gdb-patches
2023-03-23 18:27 ` Luis Machado via Gdb-patches
2023-03-23 18:32 ` Luis Machado via Gdb-patches
2023-03-23 18:39 ` Kevin Buettner via Gdb-patches
2023-03-24 6:28 ` Luis Machado via Gdb-patches
2023-03-24 8:19 ` Luis Machado via Gdb-patches
2023-03-24 13:42 ` Luis Machado via Gdb-patches
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=c5c9657e-ecf7-1420-0b77-05a4ba7e673d@arm.com \
--to=gdb-patches@sourceware.org \
--cc=aburgess@redhat.com \
--cc=luis.machado@arm.com \
--cc=marcan@marcan.st \
--cc=pedro@palves.net \
--cc=simark@simark.ca \
/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