This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/5] Associate target_dcache to address_space.
- From: Tom Tromey <tromey at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 23 Oct 2013 10:37:04 -0600
- Subject: Re: [PATCH 2/5] Associate target_dcache to address_space.
- Authentication-results: sourceware.org; auth=none
- References: <1382516855-32218-1-git-send-email-yao at codesourcery dot com> <1382516855-32218-3-git-send-email-yao at codesourcery dot com>
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> Nowadays, 'target_dcache' is a global variable in GDB, which is not
Yao> necessary. It can be a per-address-space variable. In this patch, we
Yao> add a new structure 'target_dcache', which includes all dcaches of
Yao> target and all of them are per-address-space.
I like this patch quite a bit. For one thing, it fixes the target
dcache for the coming multi-target work :-)
Yao> +/* The current added space. */
Yao> +#define current_address_space current_program_space->aspace
On the whole I would prefer we not add new object-style macros like
this. (Actually I'd really like it if we got rid of the existing ones
too...) Writing out the expansion in the few places it is used seems
better to me.
Yao> +static void
Yao> +target_dcache_cleanup (struct address_space *aspace, void *arg)
Yao> +{
Yao> + struct target_dcache *dcache
Yao> + = address_space_data (aspace, target_dcache_aspace_key);
Yao> +
Yao> + target_dcache_xfree (dcache);
Here you don't need to call address_space_data, since ARG is the dcache
that was passed in.
Tom