(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.
+2008-09-05 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * 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.
+
2008-09-05 Ulrich Weigand <uweigand@de.ibm.com>
* dwarf2expr.h (dwarf2_read_address): Add gdbarch argument.
/* Misc helper functions for targets. */
CORE_ADDR
-core_addr_identity (CORE_ADDR addr)
+core_addr_identity (struct gdbarch *gdbarch, CORE_ADDR addr)
{
return addr;
}
/* Identity functions on a CORE_ADDR. Just return the "addr". */
-extern CORE_ADDR core_addr_identity (CORE_ADDR addr);
+extern CORE_ADDR core_addr_identity (struct gdbarch *gdbarch, CORE_ADDR addr);
extern gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr_identity;
/* No-op conversion of reg to regnum. */
/* 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);
/* 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;
}
void **this_cache,
int prev_regnum)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct arm_prologue_cache *cache;
if (*this_cache == NULL)
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
{
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
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)
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. */
default_stabs_argument_has_addr, /* stabs_argument_has_addr */
0, /* frame_red_zone_size */
convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
- 0, /* addr_bits_remove */
- 0, /* smash_text_address */
+ core_addr_identity, /* addr_bits_remove */
+ core_addr_identity, /* smash_text_address */
0, /* software_single_step */
0, /* single_step_through_delay */
0, /* print_insn */
gdb_assert (gdbarch->addr_bits_remove != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
- return gdbarch->addr_bits_remove (addr);
+ return gdbarch->addr_bits_remove (gdbarch, addr);
}
void
gdb_assert (gdbarch->smash_text_address != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
- return gdbarch->smash_text_address (addr);
+ return gdbarch->smash_text_address (gdbarch, addr);
}
void
sort of generic thing to handle alignment or segmentation (it's
possible it should be in TARGET_READ_PC instead). */
-typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
+typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
/* It is not at all clear why gdbarch_smash_text_address is not folded into
gdbarch_addr_bits_remove. */
-typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
+typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
# being a few stray bits in the PC which would mislead us, not as some
# sort of generic thing to handle alignment or segmentation (it's
# possible it should be in TARGET_READ_PC instead).
-f:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr::core_addr_identity::0
+m:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr::core_addr_identity::0
# It is not at all clear why gdbarch_smash_text_address is not folded into
# gdbarch_addr_bits_remove.
-f:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr::core_addr_identity::0
+m:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr::core_addr_identity::0
# FIXME/cagney/2001-01-18: This should be split in two. A target method that
# indicates if the target needs software single step. An ISA method to
}
static CORE_ADDR
-hppa_smash_text_address (CORE_ADDR addr)
+hppa_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
{
/* The low two bits of the PC on the PA contain the privilege level.
Some genius implementing a (non-GCC) compiler apparently decided
\f
static CORE_ADDR
-m88k_addr_bits_remove (CORE_ADDR addr)
+m88k_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
{
/* All instructures are 4-byte aligned. The lower 2 bits of SXIP,
SNIP and SFIP are used for special purposes: bit 0 is the
CORE_ADDR pc;
pc = frame_unwind_register_unsigned (next_frame, M88K_SXIP_REGNUM);
- return m88k_addr_bits_remove (pc);
+ return m88k_addr_bits_remove (gdbarch, pc);
}
static void
/* mips_addr_bits_remove - remove useless address bits */
static CORE_ADDR
-mips_addr_bits_remove (CORE_ADDR addr)
+mips_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (mips_mask_address_p (tdep) && (((ULONGEST) addr) >> 32 == 0xffffffffUL))
/* This hack is a work-around for existing boards using PMON, the
simulator, and any other 64-bit targets that doesn't have true
/* Address handling. */
static CORE_ADDR
-s390_addr_bits_remove (CORE_ADDR addr)
+s390_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
{
return addr & 0x7fffffff;
}