/* Target-dependent code for Morpho mt processor, for GDB.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include "infcall.h"
#include "language.h"
#include "valprint.h"
+#include "common/byte-vector.h"
enum mt_arch_constants
{
|| regnum == MT_COPRO_PSEUDOREG_REGNUM)
{
/* Special output handling for the 'coprocessor' register. */
- gdb_byte *buf;
struct value_print_options opts;
+ struct value *val;
- buf = (gdb_byte *) alloca (register_size (gdbarch, MT_COPRO_REGNUM));
- deprecated_frame_register_read (frame, MT_COPRO_REGNUM, buf);
+ val = get_frame_register_value (frame, MT_COPRO_REGNUM);
/* And print. */
regnum = MT_COPRO_PSEUDOREG_REGNUM;
fputs_filtered (gdbarch_register_name (gdbarch, regnum),
file);
get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
- val_print (register_type (gdbarch, regnum), buf,
- 0, 0, file, 0, NULL,
+ val_print (register_type (gdbarch, regnum),
+ 0, 0, file, 0, val,
&opts, current_language);
fputs_filtered ("\n", file);
}
/* Next, the rest of the arguments go onto the stack, in reverse order. */
for (j = nargs - 1; j >= i; j--)
{
- gdb_byte *val;
- struct cleanup *back_to;
const gdb_byte *contents = value_contents (args[j]);
/* Right-justify the value in an aligned-length buffer. */
typelen = TYPE_LENGTH (value_type (args[j]));
slacklen = (wordsize - (typelen % wordsize)) % wordsize;
- val = (gdb_byte *) xmalloc (typelen + slacklen);
- back_to = make_cleanup (xfree, val);
- memcpy (val, contents, typelen);
- memset (val + typelen, 0, slacklen);
+ gdb::byte_vector val (typelen + slacklen);
+ memcpy (val.data (), contents, typelen);
+ memset (val.data () + typelen, 0, slacklen);
/* Now write this data to the stack. */
stack_dest -= typelen + slacklen;
- write_memory (stack_dest, val, typelen + slacklen);
- do_cleanups (back_to);
+ write_memory (stack_dest, val.data (), typelen + slacklen);
}
/* Finally, if a param needs to be split between registers and stack,
set_gdbarch_pseudo_register_write (gdbarch, mt_pseudo_register_write);
set_gdbarch_skip_prologue (gdbarch, mt_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- SET_GDBARCH_BREAKPOINT_MANIPULATION (mt);
+ set_gdbarch_breakpoint_kind_from_pc (gdbarch, mt_breakpoint_kind_from_pc);
+ set_gdbarch_sw_breakpoint_from_kind (gdbarch, mt_sw_breakpoint_from_kind);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_frame_args_skip (gdbarch, 0);
- set_gdbarch_print_insn (gdbarch, print_insn_mt);
set_gdbarch_register_type (gdbarch, mt_register_type);
set_gdbarch_register_reggroup_p (gdbarch, mt_register_reggroup_p);
return gdbarch;
}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_mt_tdep;
-
void
_initialize_mt_tdep (void)
{