X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fdcache.c;h=cb430681318fd3d4f38c1da675fd6342c52ccaa6;hb=c5ac15402a894e87a118526a066880f596b3c78d;hp=9780f4dd81b73092ff4196749da42d0ed6c4f98f;hpb=0256a6ac4b25d56da14cbbe3cda9977f9c7c13eb;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/dcache.c b/gdb/dcache.c index 9780f4dd81..cb43068131 100644 --- a/gdb/dcache.c +++ b/gdb/dcache.c @@ -1,6 +1,6 @@ /* Caching code for GDB, the GNU debugger. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -20,7 +20,6 @@ #include "defs.h" #include "dcache.h" #include "gdbcmd.h" -#include #include "gdbcore.h" #include "target-dcache.h" #include "inferior.h" @@ -371,8 +370,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++; } @@ -445,9 +445,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, @@ -499,9 +497,8 @@ dcache_read_memory_partial (struct target_ops *ops, DCACHE *dcache, { /* Even though reading the whole line failed, we may be able to read a piece starting where the caller wanted. */ - return ops->to_xfer_partial (ops, TARGET_OBJECT_MEMORY, NULL, - myaddr, NULL, memaddr, len, - xfered_len); + return raw_memory_xfer_partial (ops, myaddr, NULL, memaddr, len, + xfered_len); } else { @@ -681,7 +678,7 @@ set_dcache_command (char *arg, int from_tty) { printf_unfiltered ( "\"set dcache\" must be followed by the name of a subcommand.\n"); - help_list (dcache_set_list, "set dcache ", -1, gdb_stdout); + help_list (dcache_set_list, "set dcache ", all_commands, gdb_stdout); } static void