This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/6] Return target_xfer_status in to_xfer_partial
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 7 Feb 2014 10:09:02 +0800
- Subject: Re: [PATCH 5/6] Return target_xfer_status in to_xfer_partial
- Authentication-results: sourceware.org; auth=none
- References: <1391139325-2758-1-git-send-email-yao at codesourcery dot com> <1391139325-2758-6-git-send-email-yao at codesourcery dot com> <52F39FD8 dot 2070507 at redhat dot com>
On 02/06/2014 10:44 PM, Pedro Alves wrote:
>> -static LONGEST
>> > +static enum target_xfer_status
>> > target_read_live_memory (enum target_object object,
>> > - ULONGEST memaddr, gdb_byte *myaddr, ULONGEST len)
>> > + ULONGEST memaddr, gdb_byte *myaddr, ULONGEST len,
>> > + ULONGEST *xfered_len)
>> > {
>> > - LONGEST ret;
>> > + enum target_xfer_status ret;
>> > struct cleanup *cleanup;
>> >
>> > /* Switch momentarily out of tfind mode so to access live memory.
>> > @@ -1326,8 +1327,8 @@ target_read_live_memory (enum target_object object,
>> > cleanup = make_cleanup_restore_traceframe_number ();
>> > set_traceframe_number (-1);
>> >
>> > - ret = target_read (current_target.beneath, object, NULL,
>> > - myaddr, memaddr, len);
>> > + ret = target_xfer_partial (current_target.beneath, object, NULL,
>> > + myaddr, NULL, memaddr, len, xfered_len);
> This doesn't seem equivalent?
>
We added 'xfered_len' to target_read_live_memory, so we don't have to
call target_read which tries to read all the requested data once.
Instead, we call target_xfer_partial here which stores the length of
transferred data in *xfered_len and target_xfer_partial here fits in the
new target xfer infrastructure.
--
Yao (éå)