aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-10-29 21:34:20 +0800
committerYao Qi <yao@codesourcery.com>2013-11-20 11:40:43 +0800
commit2a2f9fe4007a0135ac091878dc7000f91e75e339 (patch)
tree9ea6cec1fab0a4a2c3ef5f78af7ad693589abf39 /gdb/target.h
parent3e9ecad3e843a588fa610c2419f7d3117014a927 (diff)
downloadgdb-2a2f9fe4007a0135ac091878dc7000f91e75e339.zip
gdb-2a2f9fe4007a0135ac091878dc7000f91e75e339.tar.gz
gdb-2a2f9fe4007a0135ac091878dc7000f91e75e339.tar.bz2
Remove last_cache
This patch removes global variable 'last_cache', and initialize 'target_dcache' lazily, so that 'target_dcache' can replace 'last_cache'. No functionalities should be changed after this patch. gdb: 2013-11-20 Yao Qi <yao@codesourcery.com> * dcache.c (last_cache): Remove. (dcache_free, dcache_init): Update. (dcache_update): (dcache_print_line): Add parameter 'dcache'. Replace 'target_dcache' with 'dcache'. (dcache_info): Move code to dcache_info_1. Call 'dcache_info_1'. (dcache_info_1): New function. (set_dcache_size): Call target_dcache_invalidate. (set_dcache_line_size): Call target_dcache_invalidate. * target.c (target_dcache_init_p): New function. (target_dcache_invalidate): Check target_dcache_init_p first. (target_dcache_get, target_dcache_get_or_init): New function. (memory_xfer_partial_1): Adjust. (initialize_target): Don't initialize 'target_dcache'. * target.h (struct dcache_struct): Declare. (target_dcache_get): Declare.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index df17be5..87366e6 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -37,6 +37,7 @@ struct uploaded_tp;
struct static_tracepoint_marker;
struct traceframe_info;
struct expression;
+struct dcache_struct;
/* This include file defines the interface between the main part
of the debugger, and the part which is target-specific, or
@@ -1045,6 +1046,8 @@ int target_supports_disable_randomization (void);
/* Invalidate all target dcaches. */
extern void target_dcache_invalidate (void);
+extern struct dcache_struct *target_dcache_get (void);
+
extern int target_read_string (CORE_ADDR, char **, int, int *);
extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,