From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Delegate to target_ops->beneath to read cache lines
Date: Fri, 29 Nov 2013 14:00:00 -0000 [thread overview]
Message-ID: <52989668.3030604@codesourcery.com> (raw)
In-Reply-To: <529883D7.3030606@redhat.com>
On 11/29/2013 08:08 PM, Pedro Alves wrote:
> Hmm, that's not what I recall and documented in
> target_read_memory, etc.
>
> /* Dispatch to the topmost target, not the flattened current_target.
> Memory accesses check target->to_has_(all_)memory, and the
> flattened target doesn't inherit those. */
>
> And indeed, if I tweak the patch to drop that hunk,
> that's still what I see. What recursion did you see?
I can see a segmentation fault instead of a endless recursion today :-/
(top-gdb) n
1420 if (ops->to_has_all_memory (ops))
(top-gdb) p ops->to_has_all_memory
$13 = (int (*)(struct target_ops *)) 0x0
(top-gdb) p current_target.to_has_all_memory
$14 = (int (*)(struct target_ops *)) 0x0
The quoted documentation correctly explainss the behaviour here.
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 ¤t_target. I may mess up
something then.
> Note that using ¤t_target in dcache_read_line will cause an
> endless recursion, so I change it to current_target.beneath. IMO,
> other ¤t_target usages should be changed to
> current_target.beneath too.
I'll get rid of it from commit log.
--
Yao (é½å°§)
next prev parent reply other threads:[~2013-11-29 13:30 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 [this message]
2013-11-29 14:27 ` Pedro Alves
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=52989668.3030604@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