aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-ia64-low.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-03-28 18:30:01 +0000
committerPedro Alves <palves@redhat.com>2012-03-28 18:30:01 +0000
commitc14dfd32064a2213d57d8ef551a9c64841e61032 (patch)
tree5fc564505090c0694b3d502ab95126114453ed80 /gdb/gdbserver/linux-ia64-low.c
parentca9b8b9ce80fad94ebfbbe5c2743764868c031eb (diff)
downloadgdb-c14dfd32064a2213d57d8ef551a9c64841e61032.zip
gdb-c14dfd32064a2213d57d8ef551a9c64841e61032.tar.gz
gdb-c14dfd32064a2213d57d8ef551a9c64841e61032.tar.bz2
2012-03-28 Pedro Alves <palves@redhat.com>
* linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC. (IA64_GR0_REGNUM, IA64_FR0_REGNUM) (IA64_FR1_REGNUM): New defines. (ia64_fetch_register): New. (the_low_target): Install it. * linux-low.h (struct linux_target_ops) <fetch_register>: New field. * linux-low.c (linux_fetch_registers): Try the the_low_target.fetch_register hook first. * linux-arm-low.c (the_low_target): Adjust. * linux-bfin-low.c (the_low_target): Adjust. * linux-cris-low.c (the_low_target): Adjust. * linux-crisv32-low.c (the_low_target): Adjust. * linux-m32r-low.c (the_low_target): Adjust. * linux-m68k-low.c (the_low_target): Adjust. * linux-mips-low.c (the_low_target): Adjust. * linux-ppc-low.c (the_low_target): Adjust. * linux-s390-low.c (the_low_target): Adjust. * linux-sh-low.c (the_low_target): Adjust. * linux-sparc-low.c (the_low_target): Adjust. * linux-tic6x-low.c (the_low_target): Adjust. * linux-x86-low.c (the_low_target): Adjust. * linux-xtensa-low.c (the_low_target): Adjust.
Diffstat (limited to 'gdb/gdbserver/linux-ia64-low.c')
-rw-r--r--gdb/gdbserver/linux-ia64-low.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c
index 8753190..c8fa603 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,6 +278,48 @@ 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,
@@ -285,4 +327,5 @@ struct linux_target_ops the_low_target = {
NULL,
ia64_cannot_fetch_register,
ia64_cannot_store_register,
+ ia64_fetch_register,
};