public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: John Baldwin <jhb@FreeBSD.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Avoid harmful fall throughs in core_target::xfer_partial.
Date: Thu, 17 Mar 2022 16:26:06 +0000	[thread overview]
Message-ID: <b0f88ee1-4774-f2e4-c64b-cd84e1391018@palves.net> (raw)
In-Reply-To: <6c760756-3cc9-f024-f40a-f8b4a13e4418@FreeBSD.org>

On 2022-03-17 16:23, John Baldwin wrote:
> On 3/17/22 9:06 AM, Pedro Alves wrote:
>> On 2022-03-16 19:36, John Baldwin wrote:
>>> The cases for TARGET_OBJECT_LIBRARIES and TARGET_OBJECT_LIBRARIES_AIX
>>> can try to fetch different data objects (such as
>>> TARGET_OBJECT_SIGNAL_INFO) if gdbarch methods for the requested data
>>> aren't present.  Replace case fallthroughs with an explicit goto to
>>> the default case.
>>
>> This is OK.  I mean, I think it would be reasonable to instead return
>> TARGET_XFER_E_IO -- it's what the other cases do (notice even TARGET_OBJECT_SIGNAL_INFO
>> doesn't fallback to the beneath target if there's no gdbarch method installed), and the targets
>> beneath (file and dummy) won't be returning any library anyhow.  OTOH, maybe some day we will
>> teach GDB to read the list of libraries the program is linked with and load those before
>> the program starts, and it's conceivable that we would do that at the file_stratum layer.
> 
> I'm happy to do whichever.  I was trying to preserve the intent from when
> TARGET_OBJECT_LIBRARIES was first added.  If there are no beneath targets that
> handle these objects, then I think it probably is cleaner to just fail with
> TARGET_XFER_E_IO for now and let explicit fall through logic be added in the
> future when it is needed.

Fine with me.  Consider it pre-approved.

Thanks.

      reply	other threads:[~2022-03-17 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 19:36 John Baldwin
2022-03-17 16:06 ` Pedro Alves
2022-03-17 16:23   ` John Baldwin
2022-03-17 16:26     ` Pedro Alves [this message]

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=b0f88ee1-4774-f2e4-c64b-cd84e1391018@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.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).