aboutsummaryrefslogtreecommitdiff
path: root/gdb/dcache.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-04-21 09:12:47 -0600
committerTom Tromey <tom@tromey.com>2019-05-08 16:01:46 -0600
commit35632941c90f406f69512c9559ae7ba561f7eee8 (patch)
treecfb2a58c71f2024392f2b1139fd367341f8ae18e /gdb/dcache.h
parent3017b94d60f1e8929886be6992547973ad354f4c (diff)
downloadgdb-35632941c90f406f69512c9559ae7ba561f7eee8.zip
gdb-35632941c90f406f69512c9559ae7ba561f7eee8.tar.gz
gdb-35632941c90f406f69512c9559ae7ba561f7eee8.tar.bz2
Convert target dcache to type-safe registry API
This changes the target dcache to use the type-safe registry API. gdb/ChangeLog 2019-05-08 Tom Tromey <tom@tromey.com> * target-dcache.c (target_dcache_cleanup): Remove. (target_dcache_aspace_key): Change type. (target_dcache_init_p, target_dcache_invalidate) (target_dcache_get, target_dcache_get_or_init) (_initialize_target_dcache): Update. * dcache.h (struct dcache_deleter): New.
Diffstat (limited to 'gdb/dcache.h')
-rw-r--r--gdb/dcache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/dcache.h b/gdb/dcache.h
index 9c29074..a58ac84 100644
--- a/gdb/dcache.h
+++ b/gdb/dcache.h
@@ -34,6 +34,15 @@ DCACHE *dcache_init (void);
/* Free a DCACHE. */
void dcache_free (DCACHE *);
+/* A deletion adapter that calls dcache_free. */
+struct dcache_deleter
+{
+ void operator() (DCACHE *d) const
+ {
+ dcache_free (d);
+ }
+};
+
enum target_xfer_status
dcache_read_memory_partial (struct target_ops *ops, DCACHE *dcache,
CORE_ADDR memaddr, gdb_byte *myaddr,