aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-11-20 16:21:47 +0800
committerYao Qi <yao@codesourcery.com>2013-11-24 14:56:48 +0800
commit0fb14d8ffde0940e0b55d529c50a5d424b763b13 (patch)
tree94aa270a61fb410036e8b771ce2dc4712a2b288a /gdb/target.c
parent22825df749cf79e849f6df35a6d3d0ae4e5a277e (diff)
downloadgdb-0fb14d8ffde0940e0b55d529c50a5d424b763b13.zip
gdb-0fb14d8ffde0940e0b55d529c50a5d424b763b13.tar.gz
gdb-0fb14d8ffde0940e0b55d529c50a5d424b763b13.tar.bz2
Renaming in target-dcache.c
Hi, This patch does some renamings on "stack-cache" related functions and variables. In the review to "code cache" series v2, we have some discussions on the name of predicate function 'stack_cache_enabled', and have some options, 1 keep it unchanged, as it is already a predicate clearly, 2 rename it to stack_cache_enabled_p, 3 rename it to enable_stack_cache_p, I choose #2, because 'stack_cache_enabled' is a predicate, but it's better to add "_p" suffix to stress this. There are some other similar patterns used in GDB source, such as unop_user_defined_p and agent_loaded_p. Then, I have to rename variable stack_cache_enabled_p to something else. The option is "stack-cache", so I'd like to name the variable associated with this command as "stack_cache". Similarly, the commands associated with this command should be renamed to "set_stack_cache" and "show_stack_cache" respectively. gdb: 2013-11-24 Yao Qi <yao@codesourcery.com> * target-dcache.c (stack_cache_enabled_p_1): Rename to ... (stack_cache_enabled_1): ... this. New variable. (stack_cache_enabled_p): Rename to ... (stack_cache_enabled): ... this. New variable. (set_stack_cache_enabled_p): Rename to ... (set_stack_cache): ... this. Update caller. (show_stack_cache_enabled_p): Rename to ... (show_stack_cache): ... this. Update caller. (stack_cache_enabled): Rename to ... (stack_cache_enabled_p): ... this. Update caller. (_initialize_target_dcache): Replace "data cache" with "target memory cache". * target-dcache.h (stack_cache_enabled): Remove declaration. (stack_cache_enabled_p): Add declaration.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 5001643..f402a18 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1547,7 +1547,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
the collected memory range fails. */
&& get_traceframe_number () == -1
&& (region->attrib.cache
- || (stack_cache_enabled () && object == TARGET_OBJECT_STACK_MEMORY)))
+ || (stack_cache_enabled_p () && object == TARGET_OBJECT_STACK_MEMORY)))
{
DCACHE *dcache = target_dcache_get_or_init ();
@@ -1600,7 +1600,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
&& writebuf != NULL
&& target_dcache_init_p ()
&& !region->attrib.cache
- && stack_cache_enabled ()
+ && stack_cache_enabled_p ()
&& object != TARGET_OBJECT_STACK_MEMORY)
{
DCACHE *dcache = target_dcache_get ();