/* 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.
#include "defs.h"
#include "dcache.h"
#include "gdbcmd.h"
-#include <string.h>
#include "gdbcore.h"
#include "target-dcache.h"
#include "inferior.h"
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++;
}
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,
{
/* 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
{