#include "parser-defs.h"
#include "user-regs.h"
#include <ctype.h>
-#include "elf-bfd.h" /* for elfcore_write_* */
+#include "elf-bfd.h"
#include "features/rs6000/powerpc-32l.c"
#include "features/rs6000/powerpc-altivec32l.c"
ppc_supply_gregset (regset, regcache, regnum, gregs, len);
- if (ppc_linux_trap_reg_p (get_regcache_arch (regcache)))
+ if (ppc_linux_trap_reg_p (regcache->arch ()))
{
/* "orig_r3" is stored 2 slots after "pc". */
if (regnum == -1 || regnum == PPC_ORIG_R3_REGNUM)
ppc_collect_gregset (regset, regcache, regnum, gregs, len);
- if (ppc_linux_trap_reg_p (get_regcache_arch (regcache)))
+ if (ppc_linux_trap_reg_p (regcache->arch ()))
{
/* "orig_r3" is stored 2 slots after "pc". */
if (regnum == -1 || regnum == PPC_ORIG_R3_REGNUM)
struct regcache *regcache = get_thread_regcache (ptid);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct cleanup *cleanbuf;
- /* The content of a register */
- gdb_byte *buf;
- /* The result */
- LONGEST ret;
/* Make sure we're in a 32- or 64-bit machine */
gdb_assert (tdep->wordsize == 4 || tdep->wordsize == 8);
- buf = (gdb_byte *) xmalloc (tdep->wordsize * sizeof (gdb_byte));
-
- cleanbuf = make_cleanup (xfree, buf);
+ /* The content of a register */
+ gdb::byte_vector buf (tdep->wordsize);
/* Getting the system call number from the register.
When dealing with PowerPC architecture, this information
is stored at 0th register. */
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum, buf);
-
- ret = extract_signed_integer (buf, tdep->wordsize, byte_order);
- do_cleanups (cleanbuf);
+ regcache_cooked_read (regcache, tdep->ppc_gp0_regnum, buf.data ());
- return ret;
+ return extract_signed_integer (buf.data (), tdep->wordsize, byte_order);
}
/* PPC process record-replay */
static int
ppc_linux_syscall_record (struct regcache *regcache)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
ULONGEST scnum;
enum gdb_syscall syscall_gdb;
static void
ppc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
regcache_cooked_write_unsigned (regcache, gdbarch_pc_regnum (gdbarch), pc);
ppu2spu_prev_arch (struct frame_info *this_frame, void **this_cache)
{
struct ppu2spu_cache *cache = (struct ppu2spu_cache *) *this_cache;
- return get_regcache_arch (cache->regcache);
+ return cache->regcache->arch ();
}
static void
void **this_cache, int regnum)
{
struct ppu2spu_cache *cache = (struct ppu2spu_cache *) *this_cache;
- struct gdbarch *gdbarch = get_regcache_arch (cache->regcache);
+ struct gdbarch *gdbarch = cache->regcache->arch ();
gdb_byte *buf;
buf = (gdb_byte *) alloca (register_size (gdbarch, regnum));
{
struct ppu2spu_cache *cache
= FRAME_OBSTACK_CALLOC (1, struct ppu2spu_cache);
-
- struct address_space *aspace = get_frame_address_space (this_frame);
std::unique_ptr<struct regcache> regcache
- (new struct regcache (data.gdbarch, aspace));
+ (new struct regcache (data.gdbarch));
+
regcache_save (regcache.get (), ppu2spu_unwind_register, &data);
cache->frame_id = frame_id_build (base, func);
set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpc");
}
- /* PPC32 uses a different prpsinfo32 compared to most other Linux
- archs. */
- if (tdep->wordsize == 4)
- set_gdbarch_elfcore_write_linux_prpsinfo (gdbarch,
- elfcore_write_ppc_linux_prpsinfo32);
-
set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description);
set_gdbarch_iterate_over_regset_sections (gdbarch,
ppc_linux_iterate_over_regset_sections);