2008-02-18 Markus Deuling <deuling@de.ibm.com>
+ * hppa-tdep.h (find_global_pointer): Add gdbarch as parameter.
+
+ * hppa-hpux-tdep.c (hppa32_hpux_find_global_pointer): Likewise. Replace
+ current_gdbarch by gdbarch.
+ (hppa64_hpux_find_global_pointer): Likewise.
+ * hppa-tdep.c (hppa_find_global_pointer): Likewise.
+ (hppa32_push_dummy_call, hppa64_push_dummy_call): Update call for
+ find_global_pointer.
+
+ * hppabsd-tdep.c (hppabsd_find_global_pointer): Add gdbarch as
+ parameter.
+ * hppa-linux-tdep.c (hppa_linux_find_global_pointer): Likewise.
+
+ * hppa-linux-nat.c (hppa_linux_register_addr): Use ARRAY_SIZE instead
+ of gdbarch_num_regs.
+
+ * hppa-hpux-tdep.c (hppa_hpux_sr_for_addr): Add gdbarch as parameter and
+ replace current_gdbarch by gdbarch.
+ (hppa_hpux_push_dummy_code): Update call for hppa_hpux_sr_for_addr.
+
+2008-02-18 Markus Deuling <deuling@de.ibm.com>
+
* rs6000-nat.c (exec_one_dummy_insn, regmap): Add gdbarch as parameter
and replace current_gdbarch by gdbarch.
}
static CORE_ADDR
-hppa32_hpux_find_global_pointer (struct value *function)
+hppa32_hpux_find_global_pointer (struct gdbarch *gdbarch,
+ struct value *function)
{
CORE_ADDR faddr;
return extract_unsigned_integer (buf, sizeof (buf));
}
- return gdbarch_tdep (current_gdbarch)->solib_get_got_by_pc (faddr);
+ return gdbarch_tdep (gdbarch)->solib_get_got_by_pc (faddr);
}
static CORE_ADDR
-hppa64_hpux_find_global_pointer (struct value *function)
+hppa64_hpux_find_global_pointer (struct gdbarch *gdbarch,
+ struct value *function)
{
CORE_ADDR faddr;
char buf[32];
}
else
{
- return gdbarch_tdep (current_gdbarch)->solib_get_got_by_pc (faddr);
+ return gdbarch_tdep (gdbarch)->solib_get_got_by_pc (faddr);
}
}
}
static int
-hppa_hpux_sr_for_addr (CORE_ADDR addr)
+hppa_hpux_sr_for_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
{
int sr;
/* The space register to use is encoded in the top 2 bits of the address. */
- sr = addr >> (gdbarch_tdep (current_gdbarch)->bytes_per_address * 8 - 2);
+ sr = addr >> (gdbarch_tdep (gdbarch)->bytes_per_address * 8 - 2);
return sr + 4;
}
/* The simple case is where we call a function in the same space that we are
currently in; in that case we don't really need to do anything. */
- if (hppa_hpux_sr_for_addr (pc) == hppa_hpux_sr_for_addr (funcaddr))
+ if (hppa_hpux_sr_for_addr (gdbarch, pc)
+ == hppa_hpux_sr_for_addr (gdbarch, funcaddr))
{
/* Intraspace call. */
*bp_addr = hppa_hpux_find_dummy_bpaddr (pc);
{
CORE_ADDR addr;
- if ((unsigned) regno >= gdbarch_num_regs (current_gdbarch))
+ if ((unsigned) regno >= ARRAY_SIZE (u_offsets))
error (_("Invalid register number %d."), regno);
if (u_offsets[regno] == -1)
d_un.d_ptr value is the global pointer. */
static CORE_ADDR
-hppa_linux_find_global_pointer (struct value *function)
+hppa_linux_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
{
struct obj_section *faddr_sect;
CORE_ADDR faddr;
if (struct_return)
regcache_cooked_write_unsigned (regcache, 28, struct_addr);
- gp = tdep->find_global_pointer (function);
+ gp = tdep->find_global_pointer (gdbarch, function);
if (gp != 0)
regcache_cooked_write_unsigned (regcache, 19, gp);
regcache_cooked_write_unsigned (regcache, HPPA_RET0_REGNUM, struct_addr);
/* Set up GR27 (%dp) to hold the global pointer (gp). */
- gp = tdep->find_global_pointer (function);
+ gp = tdep->find_global_pointer (gdbarch, function);
if (gp != 0)
regcache_cooked_write_unsigned (regcache, HPPA_DP_REGNUM, gp);
}
static CORE_ADDR
-hppa_find_global_pointer (struct value *function)
+hppa_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
{
return 0;
}
/* Given a function address, try to find the global pointer for the
corresponding shared object. */
- CORE_ADDR (*find_global_pointer) (struct value *);
+ CORE_ADDR (*find_global_pointer) (struct gdbarch *, struct value *);
/* For shared libraries, each call goes through a small piece of
trampoline code in the ".plt", or equivalent, section.
#include "solib-svr4.h"
CORE_ADDR
-hppabsd_find_global_pointer (struct value *function)
+hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
{
CORE_ADDR faddr = value_as_address (function);
struct obj_section *faddr_sec;