Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 5/6] Return target_xfer_status in to_xfer_partial
Date: Fri, 07 Feb 2014 02:11:00 -0000	[thread overview]
Message-ID: <52F4403E.8030202@codesourcery.com> (raw)
In-Reply-To: <52F39FD8.2070507@redhat.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 (齐尧)


  reply	other threads:[~2014-02-07  2:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31  3:37 [PATCH 0/6] " Yao Qi
2014-01-31  3:37 ` [PATCH 1/6] Tweak in memory_error Yao Qi
2014-02-06 12:41   ` Pedro Alves
2014-02-07  4:21     ` Yao Qi
2014-01-31  3:37 ` [PATCH 2/6] core_xfer_shared_libraries and core_xfer_shared_libraries_aix returns ULONGEST Yao Qi
2014-02-06 14:43   ` Pedro Alves
2014-02-07  4:21     ` Yao Qi
2014-01-31  3:38 ` [PATCH 3/6] Replace -1 with TARGET_XFER_E_IO Yao Qi
2014-02-06 14:43   ` Pedro Alves
2014-01-31  3:38 ` [PATCH 6/6] Update comments to to_xfer_partial implementations Yao Qi
2014-01-31  3:50   ` Joel Brobecker
2014-01-31  3:38 ` [PATCH 4/6] Return early in target_xfer_partial when LEN is zero Yao Qi
2014-02-06 14:44   ` Pedro Alves
2014-01-31  3:39 ` [PATCH 5/6] Return target_xfer_status in to_xfer_partial Yao Qi
2014-02-06 14:44   ` Pedro Alves
2014-02-07  2:11     ` Yao Qi [this message]
2014-02-11  6:35     ` Yao Qi

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=52F4403E.8030202@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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