/* Target-dependent code for the CSKY architecture, for GDB.
- Copyright (C) 2010-2019 Free Software Foundation, Inc.
+ Copyright (C) 2010-2020 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"
-#include "common/gdb_assert.h"
+#include "gdbsupport/gdb_assert.h"
#include "frame.h"
#include "inferior.h"
#include "symtab.h"
#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;
regcache_cooked_write_unsigned (regcache, CSKY_PC_REGNUM, val);
}
-/* Implement the unwind_sp gdbarch method. */
-
-static CORE_ADDR
-csky_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- return frame_unwind_register_unsigned (next_frame, CSKY_SP_REGNUM);
-}
-
/* C-Sky ABI register names. */
static const char *csky_register_names[] =
return cache;
}
-/* Implement the unwind_pc gdbarch method. */
-
-static CORE_ADDR
-csky_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- return frame_unwind_register_unsigned (next_frame, CSKY_PC_REGNUM);
-}
-
/* Implement the this_id function for the normal unwinder. */
static void
csky_frame_base_address
};
-/* Implement the dummy_id gdbarch method. The frame ID's base
- needs to match the TOS value saved by save_dummy_frame_tos,
- and the PC should match the dummy frame's breakpoint. */
-
-static struct frame_id
-csky_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- unsigned int sp_regnum = CSKY_SP_REGNUM;
-
- CORE_ADDR sp = get_frame_register_unsigned (this_frame, sp_regnum);
- return frame_id_build (sp, get_frame_pc (this_frame));
-}
-
/* Initialize register access method. */
static void
set_gdbarch_frame_align (gdbarch, csky_frame_align);
set_gdbarch_stack_frame_destroyed_p (gdbarch, csky_stack_frame_destroyed_p);
- /* Functions to access frame data. */
- set_gdbarch_unwind_pc (gdbarch, csky_unwind_pc);
- set_gdbarch_unwind_sp (gdbarch, csky_unwind_sp);
-
/* Functions handling dummy frames. */
set_gdbarch_push_dummy_call (gdbarch, csky_push_dummy_call);
- set_gdbarch_dummy_id (gdbarch, csky_dummy_id);
/* Frame unwinders. Use DWARF debug info if available,
otherwise use our own unwinder. */