+/* Implementation of 'register_sim_regno' gdbarch method. */
+
+static int
+h8300_register_sim_regno (struct gdbarch *gdbarch, int regnum)
+{
+ /* Only makes sense to supply raw registers. */
+ gdb_assert (regnum >= 0 && regnum < gdbarch_num_regs (gdbarch));
+
+ /* We hide the raw ccr from the user by making it nameless. Because
+ the default register_sim_regno hook returns
+ LEGACY_SIM_REGNO_IGNORE for unnamed registers, we need to
+ override it. The sim register numbering is compatible with
+ gdb's. */
+ return regnum;
+}
+
+static const char *
+h8300_register_name_common (const char *regnames[], int numregs,
+ struct gdbarch *gdbarch, int regno)
+{
+ if (regno < 0
+ || regno >= numregs)
+ internal_error (__FILE__, __LINE__,
+ _("h8300_register_name_common: illegal register number %d"),
+ regno);
+ else
+ return regnames[regno];
+}