X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fdcache.c;h=805f492bd7c254c5468c73bc6d03861452358d06;hb=58ed5c38f52511e73c9748b86c319320177fb0ca;hp=f87c529cfcd5c7980cda5d0edfcf055d8daad073;hpb=cc9f16aa882eb22cb2128c5eb8237fd453ab2988;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/dcache.c b/gdb/dcache.c index f87c529cfc..805f492bd7 100644 --- a/gdb/dcache.c +++ b/gdb/dcache.c @@ -1,6 +1,6 @@ /* Caching code for GDB, the GNU debugger. - Copyright (C) 1992-2015 Free Software Foundation, Inc. + Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of GDB. @@ -125,10 +125,6 @@ static int dcache_read_line (DCACHE *dcache, struct dcache_block *db); static struct dcache_block *dcache_alloc (DCACHE *dcache, CORE_ADDR addr); -static void dcache_info (char *exp, int tty); - -void _initialize_dcache (void); - static int dcache_enabled_p = 0; /* OBSOLETE */ static void @@ -370,8 +366,9 @@ dcache_alloc (DCACHE *dcache, CORE_ADDR addr) if (db) remove_block (&dcache->freelist, db); else - db = xmalloc (offsetof (struct dcache_block, data) + - dcache->line_size); + db = ((struct dcache_block *) + xmalloc (offsetof (struct dcache_block, data) + + dcache->line_size)); dcache->size++; } @@ -444,9 +441,7 @@ dcache_splay_tree_compare (splay_tree_key a, splay_tree_key b) DCACHE * dcache_init (void) { - DCACHE *dcache; - - dcache = (DCACHE *) xmalloc (sizeof (*dcache)); + DCACHE *dcache = XNEW (DCACHE); dcache->tree = splay_tree_new (dcache_splay_tree_compare, NULL, @@ -588,7 +583,7 @@ dcache_print_line (DCACHE *dcache, int index) /* Parse EXP and show the info about DCACHE. */ static void -dcache_info_1 (DCACHE *dcache, char *exp) +dcache_info_1 (DCACHE *dcache, const char *exp) { splay_tree_node n; int i, refcount; @@ -643,13 +638,13 @@ dcache_info_1 (DCACHE *dcache, char *exp) } static void -dcache_info (char *exp, int tty) +info_dcache_command (const char *exp, int tty) { dcache_info_1 (target_dcache_get (), exp); } static void -set_dcache_size (char *args, int from_tty, +set_dcache_size (const char *args, int from_tty, struct cmd_list_element *c) { if (dcache_size == 0) @@ -661,7 +656,7 @@ set_dcache_size (char *args, int from_tty, } static void -set_dcache_line_size (char *args, int from_tty, +set_dcache_line_size (const char *args, int from_tty, struct cmd_list_element *c) { if (dcache_line_size < 2 @@ -675,7 +670,7 @@ set_dcache_line_size (char *args, int from_tty, } static void -set_dcache_command (char *arg, int from_tty) +set_dcache_command (const char *arg, int from_tty) { printf_unfiltered ( "\"set dcache\" must be followed by the name of a subcommand.\n"); @@ -683,7 +678,7 @@ set_dcache_command (char *arg, int from_tty) } static void -show_dcache_command (char *args, int from_tty) +show_dcache_command (const char *args, int from_tty) { cmd_show_list (dcache_show_list, from_tty, ""); } @@ -703,7 +698,7 @@ exists only for compatibility reasons."), show_dcache_enabled_p, &setlist, &showlist); - add_info ("dcache", dcache_info, + add_info ("dcache", info_dcache_command, _("\ Print information on the dcache performance.\n\ With no arguments, this command prints the cache configuration and a\n\