X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fdcache.c;h=f7918caa8b8bbcf240cb8f84676ee5de1f866713;hb=1a457753cfad05989574c671a221ffce2d5df703;hp=ef1753124dabdd3b7f0ca25bad7894bf0b8bcde5;hpb=6d3d12ebef6fa7dd6bc8c34fbc5e440ac8d0a8c6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/dcache.c b/gdb/dcache.c index ef1753124d..f7918caa8b 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-2017 Free Software Foundation, Inc. This file is part of GDB. @@ -370,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++; } @@ -444,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, @@ -498,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 {