X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=gdb%2Fhppa-linux-nat.c;h=94a5cc88124b457239dc9551852e68f930bb4922;hb=e79af960e264269f6719a008ca84c56487f2aec2;hp=ef9eafbcd3fb3135f7de30356bfd470303e7b1f0;hpb=9cbc6ef04e5d04231f2ac1c4b7fd9848d9a2b3b0;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c index ef9eafbcd3..94a5cc8812 100644 --- a/gdb/hppa-linux-nat.c +++ b/gdb/hppa-linux-nat.c @@ -1,6 +1,6 @@ /* Functions specific to running GDB native on HPPA running GNU/Linux. - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2005 Free Software Foundation, Inc. This file is part of GDB. @@ -24,6 +24,8 @@ #include "regcache.h" #include "gdb_string.h" #include "inferior.h" +#include "target.h" +#include "linux-nat.h" #include #include @@ -157,7 +159,7 @@ register_addr (int regno, CORE_ADDR blockend) CORE_ADDR addr; if ((unsigned) regno >= NUM_REGS) - error ("Invalid register number %d.", regno); + error (_("Invalid register number %d."), regno); if (u_offsets[regno] == -1) addr = 0; @@ -221,7 +223,7 @@ fetch_register (int regno) if (CANNOT_FETCH_REGISTER (regno)) { - supply_register (regno, NULL); + regcache_raw_supply (current_regcache, regno, NULL); return; } @@ -233,7 +235,7 @@ fetch_register (int regno) errno = 0; val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0); if (errno != 0) - error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regno), + error (_("Couldn't read register %s (#%d): %s."), REGISTER_NAME (regno), regno, safe_strerror (errno)); regcache_raw_supply (current_regcache, regno, &val); @@ -259,7 +261,7 @@ store_register (int regno) regcache_raw_collect (current_regcache, regno, &val); ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val); if (errno != 0) - error ("Couldn't write register %s (#%d): %s.", REGISTER_NAME (regno), + error (_("Couldn't write register %s (#%d): %s."), REGISTER_NAME (regno), regno, safe_strerror (errno)); } @@ -267,8 +269,8 @@ store_register (int regno) regno == -1, otherwise fetch all general registers or all floating point registers depending upon the value of regno. */ -void -fetch_inferior_registers (int regno) +static void +hppa_linux_fetch_inferior_registers (int regno) { if (-1 == regno) { @@ -285,8 +287,8 @@ fetch_inferior_registers (int regno) regno == -1, otherwise store all general registers or all floating point registers depending upon the value of regno. */ -void -store_inferior_registers (int regno) +static void +hppa_linux_store_inferior_registers (int regno) { if (-1 == regno) { @@ -311,7 +313,7 @@ supply_gregset (gdb_gregset_t *gregsetp) for (i = 0; i < sizeof (greg_map) / sizeof (greg_map[0]); i++, regp++) { int regno = greg_map[i]; - supply_register (regno, regp); + regcache_raw_supply (current_regcache, regno, regp); } } @@ -330,7 +332,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno) if (regno == -1 || regno == mregno) { - regcache_collect(mregno, &(*gregsetp)[i]); + regcache_raw_collect(current_regcache, mregno, &(*gregsetp)[i]); } } } @@ -348,8 +350,9 @@ supply_fpregset (gdb_fpregset_t *fpregsetp) for (regi = 0; regi <= 31; regi++) { from = (char *) &((*fpregsetp)[regi]); - supply_register (2*regi + HPPA_FP0_REGNUM, from); - supply_register (2*regi + HPPA_FP0_REGNUM + 1, from + 4); + regcache_raw_supply (current_regcache, 2*regi + HPPA_FP0_REGNUM, from); + regcache_raw_supply (current_regcache, 2*regi + HPPA_FP0_REGNUM + 1, + from + 4); } } @@ -370,6 +373,24 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno) char *to = (char *) &((*fpregsetp)[(i - HPPA_FP0_REGNUM) / 2]); if ((i - HPPA_FP0_REGNUM) & 1) to += 4; - regcache_collect (i, to); + regcache_raw_collect (current_regcache, i, to); } } + +void _initialize_hppa_linux_nat (void); + +void +_initialize_hppa_linux_nat (void) +{ + struct target_ops *t; + + /* Fill in the generic GNU/Linux methods. */ + t = linux_target (); + + /* Add our register access methods. */ + t->to_fetch_registers = arm_linux_fetch_inferior_registers; + t->to_store_registers = arm_linux_store_inferior_registers; + + /* Register the target. */ + add_target (t); +}