* 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.
This commit is contained in:
parent
b34c1498c2
commit
e38c262f35
|
@ -1,3 +1,25 @@
|
|||
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
|
||||
|
|
|
@ -741,7 +741,8 @@ hppa_hpux_sigtramp_unwind_sniffer (struct frame_info *next_frame)
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
|
@ -760,11 +761,12 @@ hppa32_hpux_find_global_pointer (struct value *function)
|
|||
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];
|
||||
|
@ -778,7 +780,7 @@ hppa64_hpux_find_global_pointer (struct value *function)
|
|||
}
|
||||
else
|
||||
{
|
||||
return gdbarch_tdep (current_gdbarch)->solib_get_got_by_pc (faddr);
|
||||
return gdbarch_tdep (gdbarch)->solib_get_got_by_pc (faddr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1031,11 +1033,11 @@ hppa_hpux_find_import_stub_for_addr (CORE_ADDR funcaddr)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1112,7 +1114,8 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
|
|||
|
||||
/* 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);
|
||||
|
|
|
@ -153,7 +153,7 @@ hppa_linux_register_addr (int regno, CORE_ADDR blockend)
|
|||
{
|
||||
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)
|
||||
|
|
|
@ -325,7 +325,7 @@ hppa_linux_sigtramp_unwind_sniffer (struct frame_info *next_frame)
|
|||
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;
|
||||
|
|
|
@ -828,7 +828,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
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);
|
||||
|
@ -1087,7 +1087,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||
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);
|
||||
|
||||
|
@ -2705,7 +2705,7 @@ hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
|
|||
}
|
||||
|
||||
static CORE_ADDR
|
||||
hppa_find_global_pointer (struct value *function)
|
||||
hppa_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ struct gdbarch_tdep
|
|||
|
||||
/* 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.
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#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;
|
||||
|
|
Loading…
Reference in New Issue