/* Target-dependent code for the VAX.
- Copyright (C) 1986, 1989, 1991-1992, 1995-1996, 1998-2000, 2002-2005,
- 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "trad-frame.h"
#include "value.h"
-#include "gdb_string.h"
-
#include "vax-tdep.h"
/* Return the name of register REGNUM. */
/* VAX register set. */
-static struct regset vax_gregset =
+static const struct regset vax_gregset =
{
NULL,
vax_supply_gregset
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
+ int len = TYPE_LENGTH (type);
gdb_byte buf[8];
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
ULONGEST addr;
regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
- read_memory (addr, readbuf, TYPE_LENGTH (type));
+ read_memory (addr, readbuf, len);
}
return RETURN_VALUE_ABI_RETURNS_ADDRESS;
{
/* Read the contents of R0 and (if necessary) R1. */
regcache_cooked_read (regcache, VAX_R0_REGNUM, buf);
- if (TYPE_LENGTH (type) > 4)
+ if (len > 4)
regcache_cooked_read (regcache, VAX_R1_REGNUM, buf + 4);
- memcpy (readbuf, buf, TYPE_LENGTH (type));
+ memcpy (readbuf, buf, len);
}
if (writebuf)
{
/* Read the contents to R0 and (if necessary) R1. */
- memcpy (buf, writebuf, TYPE_LENGTH (type));
+ memcpy (buf, writebuf, len);
regcache_cooked_write (regcache, VAX_R0_REGNUM, buf);
- if (TYPE_LENGTH (type) > 4)
+ if (len > 4)
regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4);
}