* m68hc11-tdep.c (HARD_PAGE_REGNUM): Define for 68HC12 page register.
authorStephane Carrez <stcarrez@nerim.fr>
Tue, 13 Aug 2002 16:19:22 +0000 (16:19 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Tue, 13 Aug 2002 16:19:22 +0000 (16:19 +0000)
(M68HC11_LAST_HARD_REG, m68hc11_register_names): Update.
(m68hc11_register_virtual_type): Return a 8-bit type for 8-bit
registers.
(m68hc11_register_raw_size): Likewise.

gdb/ChangeLog
gdb/m68hc11-tdep.c

index 766a796ad4c3d436c34aff8a00e5dfbc88738d8e..f66f29437424739162e737caf7e81f48eaf037d9 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * m68hc11-tdep.c (HARD_PAGE_REGNUM): Define for 68HC12 page register.
+       (M68HC11_LAST_HARD_REG, m68hc11_register_names): Update.
+       (m68hc11_register_virtual_type): Return a 8-bit type for 8-bit
+       registers.
+       (m68hc11_register_raw_size): Likewise.
+
 2002-08-13  Andrew Cagney  <cagney@redhat.com>
 
        * i386-tdep.c (i386_register_name): Handle mmx registers.
index 11237bb83900e4aabcef14776df82f7e2a1c55c2..c2f7a4bbf76589db69314afa2520a7471f516781 100644 (file)
@@ -55,7 +55,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define HARD_A_REGNUM   5
 #define HARD_B_REGNUM   6
 #define HARD_CCR_REGNUM 7
-#define M68HC11_LAST_HARD_REG (HARD_CCR_REGNUM)
+
+/* 68HC12 page number register.
+   Note: to keep a compatibility with gcc register naming, we must
+   not have to rename FP and other soft registers.  The page register
+   is a real hard register and must therefore be counted by NUM_REGS.
+   For this it has the same number as Z register (which is not used).  */
+#define HARD_PAGE_REGNUM 8
+#define M68HC11_LAST_HARD_REG (HARD_PAGE_REGNUM)
 
 /* Z is replaced by X or Y by gcc during machine reorg.
    ??? There is no way to get it and even know whether
@@ -114,7 +121,7 @@ static char *
 m68hc11_register_names[] =
 {
   "x",    "d",    "y",    "sp",   "pc",   "a",    "b",
-  "ccr",  "z",    "frame","tmp",  "zs",   "xy",   0,
+  "ccr",  "page", "frame","tmp",  "zs",   "xy",   0,
   "d1",   "d2",   "d3",   "d4",   "d5",   "d6",   "d7",
   "d8",   "d9",   "d10",  "d11",  "d12",  "d13",  "d14",
   "d15",  "d16",  "d17",  "d18",  "d19",  "d20",  "d21",
@@ -891,7 +898,17 @@ m68hc11_call_dummy_address (void)
 static struct type *
 m68hc11_register_virtual_type (int reg_nr)
 {
-  return builtin_type_uint16;
+  switch (reg_nr)
+    {
+    case HARD_PAGE_REGNUM:
+    case HARD_A_REGNUM:
+    case HARD_B_REGNUM:
+    case HARD_CCR_REGNUM:
+      return builtin_type_uint8;
+
+    default:
+      return builtin_type_uint16;
+    }
 }
 
 static void
@@ -1014,7 +1031,17 @@ m68hc11_register_byte (int reg_nr)
 static int
 m68hc11_register_raw_size (int reg_nr)
 {
-  return M68HC11_REG_SIZE;
+  switch (reg_nr)
+    {
+    case HARD_PAGE_REGNUM:
+    case HARD_A_REGNUM:
+    case HARD_B_REGNUM:
+    case HARD_CCR_REGNUM:
+      return 1;
+
+    default:
+      return M68HC11_REG_SIZE;
+    }
 }
 
 static int