[PATCH 3/5] set/show code-cache

Yao Qi yao@codesourcery.com
Sat Oct 26 13:24:00 GMT 2013


On 10/25/2013 11:57 PM, Doug Evans wrote:
>> 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 it's just that "set stack-cache off" flushed the cache (as opposed
> to disabling/breaking all future use) I think that's ok.  How often
> will it get turned on and off?
>

It is confusing if command "set stack-cache off" flushes both stack 
cache and code cache.  I'd like to have separate stack cache and code 
cache, so that GDB can control them independently.  GDB invalidates 
stack cache when GDB resumes inferior, but GDB doesn't have to 
invalidate code cache, unless the program is self-modified.

If we obsolete command "set stack-cache" and replace it with command 
"set target-cache", I agree that we can use single cache for stack and 
code.  WDYT?

>>> >>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.
> Sorry, I left the assumption that caching is turned on via memory
> attributes as implicit.
> To be explicit: "If I turn on caching by memory attributes, and then
> do x/10x $addr and then x/10i $addr, will both caches get populated?"
> :)

Yes, both caches get populated.

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list