This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 08/10] Don't invalidate dcache when option stack-cache is changed
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Yao Qi <yao at codesourcery dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 19 Nov 2013 11:52:01 +0000
- Subject: Re: [PATCH 08/10] Don't invalidate dcache when option stack-cache is changed
- Authentication-results: sourceware.org; auth=none
- References: <1383458049-20893-1-git-send-email-yao at codesourcery dot com> <1383458049-20893-9-git-send-email-yao at codesourcery dot com> <CADPb22Q95Hfz1NOreFPwbrSnqjKQcXdYxbWc04zX1LG3MnJrYQ at mail dot gmail dot com>
I realize I didn't reply to this part, when I had meant to.
On 11/17/2013 09:44 PM, Doug Evans wrote:
> If one wanted to remove the cache invalidation for the off->on
> transition that seems reasonable, but if I do a backtrace, turn the
> caching optimization off, and then do another backtrace, I'd want the
> second one to not use the cache. YMMV.
I definitely agree.
Actually, doesn't the patch actually introduce a bug, like:
#1 - enable stack cache
#2 - print stack variable
#3 - disable cache
#4 - write to variable. As the cache is off, and
@@ -1593,14 +1593,14 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
/* Make sure the cache gets updated no matter what - if we are writing
to the stack. Even if this write is not tagged as such, we still need
- to update the cache. */
+ to update the cache. Update the cache to keep it in sync if it
+ has been initialized. */
if (res > 0
&& inf != NULL
&& writebuf != NULL
&& target_dcache_init_p ()
&& !region->attrib.cache
- && stack_cache_enabled ()
&& object != TARGET_OBJECT_STACK_MEMORY)
{
... we don't update the cache.
#5 - enable cache
#6 - print variable again. The stale cached value is printed.
?
--
Pedro Alves