summaryrefslogtreecommitdiff
path: root/gdb/hppa-hpux-tdep.c
diff options
context:
space:
mode:
authorMarkus Deuling <deuling@de.ibm.com>2008-02-18 16:11:21 +0000
committerMarkus Deuling <deuling@de.ibm.com>2008-02-18 16:11:21 +0000
commit9215e42a5c4085dbe7375264069ec6d3f049ac8b (patch)
tree1f561dc83dc080d960b24f32d91c09d9ebd981c5 /gdb/hppa-hpux-tdep.c
parenteedec97d866ecf3267b286476142f9260ca2189e (diff)
downloadgdb-9215e42a5c4085dbe7375264069ec6d3f049ac8b.tar.gz
* 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.
Diffstat (limited to 'gdb/hppa-hpux-tdep.c')
-rw-r--r--gdb/hppa-hpux-tdep.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index e7de80502de..0c469b9597d 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -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);