Make dcache multi-target-safe
authorPedro Alves <pedro@palves.net>
Fri, 24 Sep 2021 14:38:20 +0000 (15:38 +0100)
committerPedro Alves <pedro@palves.net>
Fri, 24 Sep 2021 17:53:55 +0000 (18:53 +0100)
commit604386598d43e50f183aba65189354e04ffbdda3
tree19f499f47dcfd9d326d925973aabc793b681a0ac
parenta13af434cfadb743e16b72ffaf716508b51f9d4a
Make dcache multi-target-safe

By inspection, I noticed that this code in dcache.c is not
multi-target-aware:

  /* If this is a different inferior from what we've recorded,
     flush the cache.  */

  if (inferior_ptid != dcache->ptid)

This doesn't take into account that threads of different targets may
have the same ptid.

Fixed by also storing/comparing the process_stratum_target.

Tested on x86-64-linux-gnu, native and gdbserver.

Change-Id: I4d9d74052c696b72d28cb1c77b697b911725c8d3
gdb/dcache.c