X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbserver%2Flinux-ia64-low.c;h=30699088d1d66a4a533ec6a4d3760459cd8bf880;hb=476350ba4800f1144b125f6511a5e25b223cc90b;hp=1b0ad81a6cf7f4e2760579b370e8b8a50d3ab900;hpb=0b30217134add051e159a192066a1e568ebd837f;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c index 1b0ad81a6c..30699088d1 100644 --- a/gdb/gdbserver/linux-ia64-low.c +++ b/gdb/gdbserver/linux-ia64-low.c @@ -1,6 +1,5 @@ /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB. - Copyright (C) 1995-1996, 1998-2002, 2007-2012 Free Software - Foundation, Inc. + Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -26,6 +25,7 @@ /* Defined in auto-generated file reg-ia64.c. */ void init_registers_ia64 (void); +extern const struct target_desc *tdesc_ia64; #define ia64_num_regs 462 @@ -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,83 @@ 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 (regcache->tdesc, 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 (regcache->tdesc, 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 (regcache->tdesc, regnum)); + supply_register (regcache, regnum, f_one); + return 1; + } + + return 0; +} + +static struct usrregs_info ia64_usrregs_info = + { + ia64_num_regs, + ia64_regmap, + }; + +static struct regs_info regs_info = + { + NULL, /* regset_bitmap */ + &ia64_usrregs_info + }; + +static const struct regs_info * +ia64_regs_info (void) +{ + return ®s_info; +} + +static void +ia64_arch_setup (void) +{ + current_process ()->tdesc = tdesc_ia64; +} + + struct linux_target_ops the_low_target = { - init_registers_ia64, - ia64_num_regs, - ia64_regmap, + ia64_arch_setup, + ia64_regs_info, ia64_cannot_fetch_register, ia64_cannot_store_register, + ia64_fetch_register, }; + +void +initialize_low_arch (void) +{ + init_registers_ia64 (); +}