This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v9 21/29] record-btrace: provide xfer_partial target method
- From: Pedro Alves <palves at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: "jan dot kratochvil at redhat dot com" <jan dot kratochvil at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 20 Dec 2013 16:02:03 +0000
- Subject: Re: [PATCH v9 21/29] record-btrace: provide xfer_partial target method
- Authentication-results: sourceware.org; auth=none
- References: <1387471499-29444-1-git-send-email-markus dot t dot metzger at intel dot com> <1387471499-29444-22-git-send-email-markus dot t dot metzger at intel dot com> <52B34555 dot 8040200 at redhat dot com> <A78C989F6D9628469189715575E55B230AA3B9AE at IRSMSX104 dot ger dot corp dot intel dot com> <A78C989F6D9628469189715575E55B230AA3B9DE at IRSMSX104 dot ger dot corp dot intel dot com> <52B4688E dot 2090603 at redhat dot com>
On 12/20/2013 03:55 PM, Pedro Alves wrote:
> + /* Check if the section we found is readonly. */
> + if ((bfd_get_section_flags (section->the_bfd_section->owner,
> + section->the_bfd_section)
> + & SEC_READONLY) != 0)
> + {
> + /* Truncate the request to fit into this section. */
> + len = min (len, section->endaddr - offset);
> + break;
>
> ... here, this should return TARGET_XFER_E_IO rather than break and
> falling through to the code that defers to the target beneath, as the
> caller will already do that for memory transfers.
Ah, no, ignore that. You need to truncate len, so it wouldn't work
correctly, of course. Silly me.
--
Pedro Alves