aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-05 11:42:32 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-05 11:42:32 +0000
commit24568a2cd9b1422f582b6f9c004ebd67ffadcb90 (patch)
tree85fd7da24abfd25d5412563736fe4cfa456cf195 /gdb/arm-tdep.c
parentf7fd47281bfa87d64a095880d752b16cd5ed4510 (diff)
downloadgdb-24568a2cd9b1422f582b6f9c004ebd67ffadcb90.zip
gdb-24568a2cd9b1422f582b6f9c004ebd67ffadcb90.tar.gz
gdb-24568a2cd9b1422f582b6f9c004ebd67ffadcb90.tar.bz2
* gdbarch.sh (addr_bits_remove): Change type to 'm'.
(smash_text_address): Likewise. * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (core_addr_identity): Add gdbarch parameter. * arch-utils.h (core_addr_identity): Likewise. * arm-tdep.c (arm_addr_bits_remove): Likewise. (arm_smash_text_address): Likewise. * hppa-tdep.c (hppa_smash_text_address): Likewise. * m88k-tdep.c (m88k_addr_bits_remove): Likewise. * s390-tdep.c (s390_addr_bits_remove): Likewise. * mips-tdep.c (mips_addr_bits_remove): Add gdbarch parameter. Use it instead of current_gdbarch. * arm-tdep.c (arm_prologue_prev_register, arm_unwind_pc, arm_dwarf2_prev_register): Update calls. * m88k-tdep.c (m88k_unwind_pc): Update call.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 8c05a5c..cb0eb12 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -363,7 +363,7 @@ arm_pc_is_thumb (CORE_ADDR memaddr)
/* Remove useless bits from addresses in a running program. */
static CORE_ADDR
-arm_addr_bits_remove (CORE_ADDR val)
+arm_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val)
{
if (arm_apcs_32)
return UNMAKE_THUMB_ADDR (val);
@@ -374,7 +374,7 @@ arm_addr_bits_remove (CORE_ADDR val)
/* When reading symbols, we need to zap the low bit of the address,
which may be set to 1 for Thumb functions. */
static CORE_ADDR
-arm_smash_text_address (CORE_ADDR val)
+arm_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR val)
{
return val & ~1;
}
@@ -1096,6 +1096,7 @@ arm_prologue_prev_register (struct frame_info *this_frame,
void **this_cache,
int prev_regnum)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct arm_prologue_cache *cache;
if (*this_cache == NULL)
@@ -1113,7 +1114,7 @@ arm_prologue_prev_register (struct frame_info *this_frame,
lr = frame_unwind_register_unsigned (this_frame, ARM_LR_REGNUM);
return frame_unwind_got_constant (this_frame, prev_regnum,
- arm_addr_bits_remove (lr));
+ arm_addr_bits_remove (gdbarch, lr));
}
/* SP is generally not saved to the stack, but this frame is
@@ -1251,7 +1252,7 @@ arm_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame)
{
CORE_ADDR pc;
pc = frame_unwind_register_unsigned (this_frame, ARM_PC_REGNUM);
- return arm_addr_bits_remove (pc);
+ return arm_addr_bits_remove (gdbarch, pc);
}
static CORE_ADDR
@@ -1264,6 +1265,7 @@ static struct value *
arm_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache,
int regnum)
{
+ struct gdbarch * gdbarch = get_frame_arch (this_frame);
CORE_ADDR lr, cpsr;
switch (regnum)
@@ -1275,7 +1277,7 @@ arm_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache,
part of the PC. */
lr = frame_unwind_register_unsigned (this_frame, ARM_LR_REGNUM);
return frame_unwind_got_constant (this_frame, regnum,
- arm_addr_bits_remove (lr));
+ arm_addr_bits_remove (gdbarch, lr));
case ARM_PS_REGNUM:
/* Reconstruct the T bit; see arm_prologue_prev_register for details. */