X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbserver%2Flinux-ia64-low.c;h=c8fa603ec7d226a4efbd7cef4c80d284610759ab;hb=623b6bdf12dec583722ca6615e5ff26581597d6c;hp=4a32e991cb1501af2f03b7660313a477b14880d9;hpb=7fb85e41908ab0cbd8b6316da74f753143c9007c;p=deliverable%2Fbinutils-gdb.git
diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c
index 4a32e991cb..c8fa603ec7 100644
--- a/gdb/gdbserver/linux-ia64-low.c
+++ b/gdb/gdbserver/linux-ia64-low.c
@@ -1,12 +1,12 @@
/* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998-2002, 2007-2012 Free Software
+ Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -15,9 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ along with this program. If not, see . */
#include "server.h"
#include "linux-low.h"
@@ -26,6 +24,9 @@
#include
#endif
+/* Defined in auto-generated file reg-ia64.c. */
+void init_registers_ia64 (void);
+
#define ia64_num_regs 462
#include
@@ -255,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,
@@ -277,9 +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,
};