This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/5] set/show code-cache
- From: Yao Qi <yao at codesourcery dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Fri, 25 Oct 2013 22:34:12 +0800
- Subject: Re: [PATCH 3/5] set/show code-cache
- Authentication-results: sourceware.org; auth=none
- References: <1382516855-32218-1-git-send-email-yao at codesourcery dot com> <1382516855-32218-4-git-send-email-yao at codesourcery dot com> <CADPb22SrY50xeRsKb3T8cY=qYVf=QmMicpRcr9_m79nD0MpwHQ at mail dot gmail dot com>
On 10/25/2013 03:47 PM, Doug Evans wrote:
While perhaps it usually won't be a problem (*1), it's odd to have two caches.
At the very beginning, I use single dcache for both stack access and
code access. However, it is odd that command "set stack-cache off"
invalidates code caches, so I decide to add a new cache dedicated to
code access.
If I do x/10x $addr and then x/10i $addr will both caches get populated?
No, "x/10i $addr" gets code cache populated, while "x/10x $addr" doesn't
get "general" or "stack" cache populated, unless I set memory attribute
cache for this area.
[Will there be latent bugs due to "storing the same thing twice"?
(which has been a source of bugs in gdb) Plus there's the extra
complexity of keeping both in sync.]
"Storing the same thing twice" may introduce bugs, but "store two things
together" is not good either :).
The code keeping caches in sync is localized, and probably we can move
them into a new file target-cache.c. I don't see too much complexity
here and the disassembly is sped up, so it is worth doing it, IMO.
--
Yao (éå)