aboutsummaryrefslogtreecommitdiff
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
commite38c262f357690271e9fa3a5d94909d17ee80865 (patch)
treeb0db0098db708a73e1db074c44c9867a71078264 /gdb/hppa-hpux-tdep.c
parentb34c1498c29a6ed60de6ad8159dc6cc424066157 (diff)
downloadgdb-e38c262f357690271e9fa3a5d94909d17ee80865.zip
gdb-e38c262f357690271e9fa3a5d94909d17ee80865.tar.gz
gdb-e38c262f357690271e9fa3a5d94909d17ee80865.tar.bz2
* 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 e7de805..0c469b9 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);