/* Target-dependent code for Moxie.
- Copyright (C) 2009-2017 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of GDB.
#include "moxie-tdep.h"
#include <algorithm>
-/* Local functions. */
-
-extern void _initialize_moxie_tdep (void);
-
/* Use an invalid address value as 'not available' marker. */
enum { REG_UNAVAIL = (CORE_ADDR) -1 };
moxie_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR regval;
int len = TYPE_LENGTH (type);
static std::vector<CORE_ADDR>
moxie_software_single_step (struct regcache *regcache)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
CORE_ADDR addr;
gdb_byte buf[4];
uint16_t inst;
return next_pcs;
}
-/* Implement the "read_pc" gdbarch method. */
-
-static CORE_ADDR
-moxie_read_pc (struct regcache *regcache)
-{
- ULONGEST pc;
-
- regcache_cooked_read_unsigned (regcache, MOXIE_PC_REGNUM, &pc);
- return pc;
-}
-
-/* Implement the "write_pc" gdbarch method. */
-
-static void
-moxie_write_pc (struct regcache *regcache, CORE_ADDR val)
-{
- regcache_cooked_write_unsigned (regcache, MOXIE_PC_REGNUM, val);
-}
-
/* Implement the "unwind_sp" gdbarch method. */
static CORE_ADDR
moxie_extract_return_value (struct type *type, struct regcache *regcache,
gdb_byte *dst)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int len = TYPE_LENGTH (type);
ULONGEST tmp;
return arches->gdbarch;
/* Allocate space for the new architecture. */
- tdep = XNEW (struct gdbarch_tdep);
+ tdep = XCNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
set_gdbarch_wchar_bit (gdbarch, 32);
set_gdbarch_wchar_signed (gdbarch, 0);
- set_gdbarch_read_pc (gdbarch, moxie_read_pc);
- set_gdbarch_write_pc (gdbarch, moxie_write_pc);
set_gdbarch_unwind_sp (gdbarch, moxie_unwind_sp);
set_gdbarch_num_regs (gdbarch, MOXIE_NUM_REGS);