/* Target-dependent code for the CSKY architecture, for GDB.
- Copyright (C) 2010-2019 Free Software Foundation, Inc.
+ Copyright (C) 2010-2021 Free Software Foundation, Inc.
Contributed by C-SKY Microsystems and Mentor Graphics.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
-/* Standard C++ includes. */
-#include <algorithm>
-#include <vector>
-
-/* Local non-gdb includes. */
-#include "arch-utils.h"
-#include "block.h"
-#include "common/gdb_assert.h"
-#include "csky-tdep.h"
-#include "dis-asm.h"
-#include "dwarf2-frame.h"
-#include "elf-bfd.h"
-#include "elf/csky.h"
-#include "floatformat.h"
-#include "frame-base.h"
-#include "frame-unwind.h"
+#include "gdbsupport/gdb_assert.h"
#include "frame.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "gdbtypes.h"
-#include "infcall.h"
#include "inferior.h"
+#include "symtab.h"
+#include "value.h"
+#include "gdbcmd.h"
#include "language.h"
+#include "gdbcore.h"
+#include "symfile.h"
#include "objfiles.h"
-#include "opcode/csky.h"
-#include "osabi.h"
+#include "gdbtypes.h"
+#include "target.h"
+#include "arch-utils.h"
#include "regcache.h"
+#include "osabi.h"
+#include "block.h"
#include "reggroups.h"
-#include "regset.h"
-#include "remote.h"
-#include "sim-regno.h"
+#include "elf/csky.h"
+#include "elf-bfd.h"
#include "symcat.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "target-descriptions.h"
-#include "target.h"
+#include "sim-regno.h"
+#include "dis-asm.h"
+#include "frame-unwind.h"
+#include "frame-base.h"
#include "trad-frame.h"
+#include "infcall.h"
+#include "floatformat.h"
+#include "remote.h"
+#include "target-descriptions.h"
+#include "dwarf2/frame.h"
#include "user-regs.h"
#include "valprint.h"
-#include "value.h"
+#include "csky-tdep.h"
+#include "regset.h"
+#include "opcode/csky.h"
+#include <algorithm>
+#include <vector>
/* Control debugging information emitted in this file. */
-static int csky_debug = 0;
+static bool csky_debug = false;
static struct reggroup *cr_reggroup;
static struct reggroup *fr_reggroup;
/* C-Sky ABI register names. */
-static const char *csky_register_names[] =
+static const char * const csky_register_names[] =
{
/* General registers 0 - 31. */
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
append_composite_type_field (t, "u8",
init_vector_type (bt->builtin_int8, 16));
- TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "builtin_type_vec128i";
+ t->set_is_vector (true);
+ t->set_name ("builtin_type_vec128i");
return t;
}
int framereg;
/* Saved register offsets. */
- struct trad_frame_saved_reg *saved_regs;
+ trad_frame_saved_reg *saved_regs;
};
/* Do prologue analysis, returning the PC of the first instruction
{
if (register_offsets[rn] >= 0)
{
- this_cache->saved_regs[rn].addr
- = this_cache->prev_sp - register_offsets[rn];
+ this_cache->saved_regs[rn].set_addr (this_cache->prev_sp
+ - register_offsets[rn]);
if (csky_debug)
{
CORE_ADDR rn_value = read_memory_unsigned_integer (
- this_cache->saved_regs[rn].addr, 4, byte_order);
+ this_cache->saved_regs[rn].addr (), 4, byte_order);
fprintf_unfiltered (gdb_stdlog, "Saved register %s "
"stored at 0x%08lx, value=0x%08lx\n",
csky_register_names[rn],
(unsigned long)
- this_cache->saved_regs[rn].addr,
+ this_cache->saved_regs[rn].addr (),
(unsigned long) rn_value);
}
}
func_end, this_frame, cache, lr_type);
/* gdbarch_sp_regnum contains the value and not the address. */
- trad_frame_set_value (cache->saved_regs, sp_regnum, cache->prev_sp);
+ cache->saved_regs[sp_regnum].set_value (cache->prev_sp);
return cache;
}
unwinder. */
static const struct frame_unwind csky_unwind_cache = {
+ "cski prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
csky_frame_this_id,
prev_regnum);
}
-struct frame_unwind csky_stub_unwind = {
+static frame_unwind csky_stub_unwind = {
+ "csky stub",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
csky_stub_this_id,
return gdbarch;
}
+void _initialize_csky_tdep ();
void
-_initialize_csky_tdep (void)
+_initialize_csky_tdep ()
{
register_gdbarch_init (bfd_arch_csky, csky_gdbarch_init);