[PATCH 2/5] Associate target_dcache to address_space.
Doug Evans
dje@google.com
Mon Oct 28 21:51:00 GMT 2013
On Wed, Oct 23, 2013 at 1:27 AM, Yao Qi <yao@codesourcery.com> wrote:
> Hi,
> Nowadays, 'target_dcache' is a global variable in GDB, which is not
> necessary. It can be a per-address-space variable. In this patch, we
> add a new structure 'target_dcache', which includes all dcaches of
> target and all of them are per-address-space.
>
> There is one field 'general' which is equivalent to current
> variable 'target_dcache'. I thought to name it 'stack', but it also
> cache memory regions marked by attributes, I choose 'general'.
>
> gdb:
>
> 2013-10-23 Yao Qi <yao@codesourcery.com>
>
> * progspace.h (struct address_space): Declare.
> (current_address_space): New macro.
> * target.c (target_dcache_aspace_key): New.
> (target_dcache): Delete.
> (struct target_dcache): New.
> (target_dcache_alloc): New function.
> (target_dcache_xfree): New function.
> (target_dcache_get): New function.
> (target_dcache_cleanup)): New function.
> (target_dcache_invalidate): Update.
> (memory_xfer_partial_1): Update.
> (initialize_targets): Initialize target_dcache_aspace_key.
> [...]
> +/* Allocate an instance of struct target_dcache. */
> +
> +static struct target_dcache *
> +target_dcache_alloc (void)
> +{
> + struct target_dcache *dcache = xmalloc (sizeof (*dcache));
> +
> + dcache->general = dcache_init ();
> +
> + return dcache;
> +}
I think more work is needed here.
I looked for it in the patch series, apologies if I missed it!
Consider "info dcache" and "set dcache size,line-size".
They use a nasty global, last_cache, which needs to go away.
Plus, we need to specify their semantics in a cache-per-address-space world.
More information about the Gdb-patches
mailing list