/* The ptid of last inferior to use cache or null_ptid. */
ptid_t ptid;
+
+ /* The process target of last inferior to use the cache or
+ nullptr. */
+ process_stratum_target *proc_target;
};
typedef void (block_func) (struct dcache_block *block, void *param);
dcache->oldest = NULL;
dcache->size = 0;
dcache->ptid = null_ptid;
+ dcache->proc_target = nullptr;
if (dcache->line_size != dcache_line_size)
{
dcache->size = 0;
dcache->line_size = dcache_line_size;
dcache->ptid = null_ptid;
+ dcache->proc_target = nullptr;
return dcache;
}
{
ULONGEST i;
- /* If this is a different inferior from what we've recorded,
- flush the cache. */
+ /* If this is a different thread from what we've recorded, flush the
+ cache. */
- if (inferior_ptid != dcache->ptid)
+ process_stratum_target *proc_target = current_inferior ()->process_target ();
+ if (proc_target != dcache->proc_target || inferior_ptid != dcache->ptid)
{
dcache_invalidate (dcache);
dcache->ptid = inferior_ptid;
+ dcache->proc_target = proc_target;
}
for (i = 0; i < len; i++)