Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Delegate to target_ops->beneath to read cache lines
Date: Fri, 29 Nov 2013 14:27:00 -0000	[thread overview]
Message-ID: <52989AE0.2000008@redhat.com> (raw)
In-Reply-To: <52989668.3030604@codesourcery.com>

On 11/29/2013 01:28 PM, Yao Qi wrote:
> The endless recursion I saw yesterday is that both current_target.to_xfer_partial
> and current_target.beneath->to_xfer_partial are core_xfer_partial.  Looks
> like it delegates to "itself", and causes an endless recursion, so I use
> current_target.beneath instead of &current_target.  I may mess up
> something then.

Not really.  to_xfer_partial is not INHERITed in update_current_target.
current_target.to_xfer_partial is set to current_xfer_partial, which
always delegates to current_target.beneath.

Even it is was inherited, I don't think we'd recurse forever,
because although the callback would be the same, the target_ops
instances are not.  It's just that core_xfer_partial would end
up unnecessarily being called twice, before reaching the the exec target:

current_target.to_xfer_partial
  ==> core_xfer_partial  (squashed target, returns 0, try beneath)

current_target.beneath->to_xfer_partial
  ==> core_xfer_partial  (corelow target, returns 0, try beneath)

current_target.beneath->beneath->to_xfer_partial
  ==> exec_xfer_partial  (exec target, returns != 0)

(This is all less clear than it should be;  I think
Tromey's target delegation method patch should set us
in the direction of making these things a little clearer.)

-- 
Pedro Alves


  reply	other threads:[~2013-11-29 13:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 12:41 Yao Qi
2013-11-27 15:27 ` Pedro Alves
2013-11-29 11:12   ` Yao Qi
2013-11-29 13:47     ` Pedro Alves
2013-11-29 14:00       ` Yao Qi
2013-11-29 14:27         ` Pedro Alves [this message]
2013-11-29 20:06     ` Doug Evans
2013-11-29 20:16       ` Pedro Alves
2013-12-02  6:07       ` Yao Qi
2013-12-02 10:36         ` Pedro Alves
2013-12-02 11:04           ` Yao Qi
2013-12-02 11:12             ` Pedro Alves

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=52989AE0.2000008@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.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