[PATCH v9 21/29] record-btrace: provide xfer_partial target method

Pedro Alves palves@redhat.com
Fri Dec 20 16:02:00 GMT 2013


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



More information about the Gdb-patches mailing list