Index: gdb/gdbserver/linux-ia64-low.c |
diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c |
index 1b0ad81a6cf7f4e2760579b370e8b8a50d3ab900..c8fa603ec7d226a4efbd7cef4c80d284610759ab 100644 |
--- a/gdb/gdbserver/linux-ia64-low.c |
+++ b/gdb/gdbserver/linux-ia64-low.c |
@@ -256,7 +256,7 @@ static int ia64_regmap[] = |
-1, -1, -1, -1, -1, -1, -1, -1, -1, |
PT_AR_PFS, |
PT_AR_LC, |
- -1, /* Not available: EC, the Epilog Count register */ |
+ PT_AR_EC, |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
@@ -278,10 +278,54 @@ ia64_cannot_fetch_register (int regno) |
return 0; |
} |
+/* GDB register numbers. */ |
+#define IA64_GR0_REGNUM 0 |
+#define IA64_FR0_REGNUM 128 |
+#define IA64_FR1_REGNUM 129 |
+ |
+static int |
+ia64_fetch_register (struct regcache *regcache, int regnum) |
+{ |
+ /* r0 cannot be fetched but is always zero. */ |
+ if (regnum == IA64_GR0_REGNUM) |
+ { |
+ const gdb_byte zero[8] = { 0 }; |
+ |
+ gdb_assert (sizeof (zero) == register_size (regnum)); |
+ supply_register (regcache, regnum, zero); |
+ return 1; |
+ } |
+ |
+ /* fr0 cannot be fetched but is always zero. */ |
+ if (regnum == IA64_FR0_REGNUM) |
+ { |
+ const gdb_byte f_zero[16] = { 0 }; |
+ |
+ gdb_assert (sizeof (f_zero) == register_size (regnum)); |
+ supply_register (regcache, regnum, f_zero); |
+ return 1; |
+ } |
+ |
+ /* fr1 cannot be fetched but is always one (1.0). */ |
+ if (regnum == IA64_FR1_REGNUM) |
+ { |
+ const gdb_byte f_one[16] = |
+ { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 }; |
+ |
+ gdb_assert (sizeof (f_one) == register_size (regnum)); |
+ supply_register (regcache, regnum, f_one); |
+ return 1; |
+ } |
+ |
+ return 0; |
+} |
+ |
struct linux_target_ops the_low_target = { |
init_registers_ia64, |
ia64_num_regs, |
ia64_regmap, |
+ NULL, |
ia64_cannot_fetch_register, |
ia64_cannot_store_register, |
+ ia64_fetch_register, |
}; |