#include "language.h"
#include "regcache.h"
#include "reggroups.h"
-#include "floatformat.h"
#include "block.h"
#include "observer.h"
#include "infcall.h"
spu_pseudo_register_read_spu (struct regcache *regcache, const char *regname,
gdb_byte *buf)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
enum register_status status;
gdb_byte reg[32];
spu_pseudo_register_write_spu (struct regcache *regcache, const char *regname,
const gdb_byte *buf)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char reg[32];
char annex[32];
static CORE_ADDR
spu_read_pc (struct regcache *regcache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+ struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
ULONGEST pc;
regcache_cooked_read_unsigned (regcache, SPU_PC_REGNUM, &pc);
/* Mask off interrupt enable bit. */
spu2ppu_prev_arch (struct frame_info *this_frame, void **this_cache)
{
struct spu2ppu_cache *cache = (struct spu2ppu_cache *) *this_cache;
- return get_regcache_arch (cache->regcache);
+ return cache->regcache->arch ();
}
static void
void **this_cache, int regnum)
{
struct spu2ppu_cache *cache = (struct spu2ppu_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));
if (fi)
{
- cache->regcache = frame_save_as_regcache (fi);
+ cache->regcache = frame_save_as_regcache (fi).release ();
*this_prologue_cache = cache;
return 1;
}
spu2ppu_dealloc_cache (struct frame_info *self, void *this_cache)
{
struct spu2ppu_cache *cache = (struct spu2ppu_cache *) this_cache;
- regcache_xfree (cache->regcache);
+ delete cache->regcache;
}
static const struct frame_unwind spu2ppu_unwind = {
static std::vector<CORE_ADDR>
spu_software_single_step (struct regcache *regcache)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR pc, next_pc;
unsigned int insn;
/* "info spu" commands. */
static void
-info_spu_event_command (char *args, int from_tty)
+info_spu_event_command (const char *args, int from_tty)
{
struct frame_info *frame = get_selected_frame (NULL);
ULONGEST event_status = 0;
ULONGEST event_mask = 0;
- struct cleanup *chain;
gdb_byte buf[100];
char annex[32];
LONGEST len;
buf[len] = '\0';
event_mask = strtoulst ((char *) buf, NULL, 16);
- chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoEvent");
+ ui_out_emit_tuple tuple_emitter (current_uiout, "SPUInfoEvent");
if (current_uiout->is_mi_like_p ())
{
printf_filtered (_("Event Status 0x%s\n"), phex (event_status, 4));
printf_filtered (_("Event Mask 0x%s\n"), phex (event_mask, 4));
}
-
- do_cleanups (chain);
}
static void
-info_spu_signal_command (char *args, int from_tty)
+info_spu_signal_command (const char *args, int from_tty)
{
struct frame_info *frame = get_selected_frame (NULL);
struct gdbarch *gdbarch = get_frame_arch (frame);
ULONGEST signal2 = 0;
ULONGEST signal2_type = 0;
int signal2_pending = 0;
- struct cleanup *chain;
char annex[32];
gdb_byte buf[100];
LONGEST len;
buf[len] = '\0';
signal2_type = strtoulst ((char *) buf, NULL, 16);
- chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoSignal");
+ ui_out_emit_tuple tuple_emitter (current_uiout, "SPUInfoSignal");
if (current_uiout->is_mi_like_p ())
{
else
printf_filtered (_("(Type Overwrite)\n"));
}
-
- do_cleanups (chain);
}
static void
}
static void
-info_spu_mailbox_command (char *args, int from_tty)
+info_spu_mailbox_command (const char *args, int from_tty)
{
struct frame_info *frame = get_selected_frame (NULL);
struct gdbarch *gdbarch = get_frame_arch (frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct cleanup *chain;
char annex[32];
gdb_byte buf[1024];
LONGEST len;
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
- chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoMailbox");
+ ui_out_emit_tuple tuple_emitter (current_uiout, "SPUInfoMailbox");
xsnprintf (annex, sizeof annex, "%d/mbox_info", id);
len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
info_spu_mailbox_list (buf, len / 4, byte_order,
"wbox", "SPU Inbound Mailbox");
-
- do_cleanups (chain);
}
static ULONGEST
}
static void
-info_spu_dma_command (char *args, int from_tty)
+info_spu_dma_command (const char *args, int from_tty)
{
struct frame_info *frame = get_selected_frame (NULL);
struct gdbarch *gdbarch = get_frame_arch (frame);
ULONGEST dma_info_status;
ULONGEST dma_info_stall_and_notify;
ULONGEST dma_info_atomic_command_status;
- struct cleanup *chain;
char annex[32];
gdb_byte buf[1024];
LONGEST len;
dma_info_atomic_command_status
= extract_unsigned_integer (buf + 32, 8, byte_order);
- chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoDMA");
+ ui_out_emit_tuple tuple_emitter (current_uiout, "SPUInfoDMA");
if (current_uiout->is_mi_like_p ())
{
}
info_spu_dma_cmdlist (buf + 40, 16, byte_order);
- do_cleanups (chain);
}
static void
-info_spu_proxydma_command (char *args, int from_tty)
+info_spu_proxydma_command (const char *args, int from_tty)
{
struct frame_info *frame = get_selected_frame (NULL);
struct gdbarch *gdbarch = get_frame_arch (frame);
ULONGEST dma_info_type;
ULONGEST dma_info_mask;
ULONGEST dma_info_status;
- struct cleanup *chain;
char annex[32];
gdb_byte buf[1024];
LONGEST len;
dma_info_mask = extract_unsigned_integer (buf + 8, 8, byte_order);
dma_info_status = extract_unsigned_integer (buf + 16, 8, byte_order);
- chain = make_cleanup_ui_out_tuple_begin_end (current_uiout,
- "SPUInfoProxyDMA");
+ ui_out_emit_tuple tuple_emitter (current_uiout, "SPUInfoProxyDMA");
if (current_uiout->is_mi_like_p ())
{
}
info_spu_dma_cmdlist (buf + 24, 8, byte_order);
- do_cleanups (chain);
}
static void
-info_spu_command (char *args, int from_tty)
+info_spu_command (const char *args, int from_tty)
{
printf_unfiltered (_("\"info spu\" must be followed by "
"the name of an SPU facility.\n"));
/* Root of all "set spu "/"show spu " commands. */
static void
-show_spu_command (char *args, int from_tty)
+show_spu_command (const char *args, int from_tty)
{
help_list (showspucmdlist, "show spu ", all_commands, gdb_stdout);
}
static void
-set_spu_command (char *args, int from_tty)
+set_spu_command (const char *args, int from_tty)
{
help_list (setspucmdlist, "set spu ", all_commands, gdb_stdout);
}