* gdbarch.sh (ADDR_BITS_REMOVE): Replace by gdbarch_addr_bits_remove.
* value.c (value_as_address): Likewise (comment).
* remote-mips.c (common_breakpoint): Likewise.
* regcache.c (read_pc_pid): Likewise.
* printcmd.c (do_one_display): Likewise.
* monitor.c (monitor_write_memory, monitor_read_memory)
(monitor_insert_breakpoint): Likewise.
* mips-tdep.c (heuristic_proc_start): Likewise.
* infrun.c (insert_step_resume_breakpoint_at_frame)
(insert_step_resume_breakpoint_at_caller): Likewise.
* buildsym.c (record_line): Likewise.
* arm-tdep.c (arm_scan_prologue, thumb_get_next_pc)
(arm_get_next_pc): Likewise.
* armnbsd-nat.c (arm_supply_gregset, fetch_register, store_register)
(store_regs): Likewise.
* arm-linux-tdep.c (arm_linux_supply_gregset): Likewise.
* arm-linux-nat.c (fetch_register, fetch_regs): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
+2007-06-09 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (ADDR_BITS_REMOVE): Replace by gdbarch_addr_bits_remove.
+ * value.c (value_as_address): Likewise (comment).
+ * remote-mips.c (common_breakpoint): Likewise.
+ * regcache.c (read_pc_pid): Likewise.
+ * printcmd.c (do_one_display): Likewise.
+ * monitor.c (monitor_write_memory, monitor_read_memory)
+ (monitor_insert_breakpoint): Likewise.
+ * mips-tdep.c (heuristic_proc_start): Likewise.
+ * infrun.c (insert_step_resume_breakpoint_at_frame)
+ (insert_step_resume_breakpoint_at_caller): Likewise.
+ * buildsym.c (record_line): Likewise.
+ * arm-tdep.c (arm_scan_prologue, thumb_get_next_pc)
+ (arm_get_next_pc): Likewise.
+ * armnbsd-nat.c (arm_supply_gregset, fetch_register, store_register)
+ (store_regs): Likewise.
+ * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise.
+ * arm-linux-nat.c (fetch_register, fetch_regs): Likewise.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
2007-06-09 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (REGISTER_NAME): Replace by gdbarch_register_name.
if (ARM_PC_REGNUM == regno)
{
- regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
+ regs[ARM_PC_REGNUM] = gdbarch_addr_bits_remove
+ (current_gdbarch, regs[ARM_PC_REGNUM]);
regcache_raw_supply (regcache, ARM_PC_REGNUM,
(char *) ®s[ARM_PC_REGNUM]);
}
regcache_raw_supply (regcache, ARM_PS_REGNUM,
(char *) ®s[ARM_PC_REGNUM]);
- regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
+ regs[ARM_PC_REGNUM] = gdbarch_addr_bits_remove
+ (current_gdbarch, regs[ARM_PC_REGNUM]);
regcache_raw_supply (regcache, ARM_PC_REGNUM,
(char *) ®s[ARM_PC_REGNUM]);
}
reg_pc = extract_unsigned_integer (gregs
+ INT_REGISTER_SIZE * ARM_PC_REGNUM,
INT_REGISTER_SIZE);
- reg_pc = ADDR_BITS_REMOVE (reg_pc);
+ reg_pc = gdbarch_addr_bits_remove (current_gdbarch, reg_pc);
store_unsigned_integer (pc_buf, INT_REGISTER_SIZE, reg_pc);
regcache_raw_supply (regcache, ARM_PC_REGNUM, pc_buf);
}
return;
else
{
- prologue_start = ADDR_BITS_REMOVE (return_value) - 8;
+ prologue_start = gdbarch_addr_bits_remove
+ (current_gdbarch, return_value) - 8;
prologue_end = prologue_start + 64; /* See above. */
}
}
offset = bitcount (bits (inst1, 0, 7)) * DEPRECATED_REGISTER_SIZE;
sp = read_register (ARM_SP_REGNUM);
nextpc = (CORE_ADDR) read_memory_unsigned_integer (sp + offset, 4);
- nextpc = ADDR_BITS_REMOVE (nextpc);
+ nextpc = gdbarch_addr_bits_remove (current_gdbarch, nextpc);
if (nextpc == pc)
error (_("Infinite loop detected"));
}
else
nextpc = read_register (bits (inst1, 3, 6));
- nextpc = ADDR_BITS_REMOVE (nextpc);
+ nextpc = gdbarch_addr_bits_remove (current_gdbarch, nextpc);
if (nextpc == pc)
error (_("Infinite loop detected"));
}
{
rn = bits (this_instr, 0, 3);
result = (rn == 15) ? pc_val + 8 : read_register (rn);
- nextpc = (CORE_ADDR) ADDR_BITS_REMOVE (result);
+ nextpc = (CORE_ADDR) gdbarch_addr_bits_remove
+ (current_gdbarch, result);
if (nextpc == pc)
error (_("Infinite loop detected"));
result = ~operand2;
break;
}
- nextpc = (CORE_ADDR) ADDR_BITS_REMOVE (result);
+ nextpc = (CORE_ADDR) gdbarch_addr_bits_remove
+ (current_gdbarch, result);
if (nextpc == pc)
error (_("Infinite loop detected"));
nextpc = (CORE_ADDR) read_memory_integer ((CORE_ADDR) base,
4);
- nextpc = ADDR_BITS_REMOVE (nextpc);
+ nextpc = gdbarch_addr_bits_remove (current_gdbarch, nextpc);
if (nextpc == pc)
error (_("Infinite loop detected"));
+ offset),
4);
}
- nextpc = ADDR_BITS_REMOVE (nextpc);
+ nextpc = gdbarch_addr_bits_remove
+ (current_gdbarch, nextpc);
if (nextpc == pc)
error (_("Infinite loop detected"));
}
if (bits (this_instr, 28, 31) == INST_NV)
nextpc |= bit (this_instr, 24) << 1;
- nextpc = ADDR_BITS_REMOVE (nextpc);
+ nextpc = gdbarch_addr_bits_remove (current_gdbarch, nextpc);
if (nextpc == pc)
error (_("Infinite loop detected"));
break;
regcache_raw_supply (regcache, ARM_LR_REGNUM,
(char *) &gregset->r_lr);
/* This is ok: we're running native... */
- r_pc = ADDR_BITS_REMOVE (gregset->r_pc);
+ r_pc = gdbarch_addr_bits_remove (current_gdbarch, gregset->r_pc);
regcache_raw_supply (regcache, ARM_PC_REGNUM, (char *) &r_pc);
if (arm_apcs_32)
case ARM_PC_REGNUM:
/* This is ok: we're running native... */
- inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
+ inferior_registers.r_pc = gdbarch_addr_bits_remove
+ (current_gdbarch, inferior_registers.r_pc);
regcache_raw_supply (regcache, ARM_PC_REGNUM,
(char *) &inferior_registers.r_pc);
break;
regcache_raw_collect (regcache, ARM_PC_REGNUM,
(char *) &pc_val);
- pc_val = ADDR_BITS_REMOVE (pc_val);
- inferior_registers.r_pc
- ^= ADDR_BITS_REMOVE (inferior_registers.r_pc);
+ pc_val = gdbarch_addr_bits_remove (current_gdbarch, pc_val);
+ inferior_registers.r_pc ^= gdbarch_addr_bits_remove
+ (current_gdbarch,
+ inferior_registers.r_pc);
inferior_registers.r_pc |= pc_val;
}
break;
regcache_raw_collect (regcache, ARM_PS_REGNUM,
(char *) &psr_val);
- psr_val ^= ADDR_BITS_REMOVE (psr_val);
- inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
+ psr_val ^= gdbarch_addr_bits_remove (current_gdbarch, psr_val);
+ inferior_registers.r_pc = gdbarch_addr_bits_remove
+ (current_gdbarch,
+ inferior_registers.r_pc);
inferior_registers.r_pc |= psr_val;
}
break;
regcache_raw_collect (regcache, ARM_PS_REGNUM,
(char *) &psr_val);
- pc_val = ADDR_BITS_REMOVE (pc_val);
- psr_val ^= ADDR_BITS_REMOVE (psr_val);
+ pc_val = gdbarch_addr_bits_remove (current_gdbarch, pc_val);
+ psr_val ^= gdbarch_addr_bits_remove (current_gdbarch, psr_val);
inferior_registers.r_pc = pc_val | psr_val;
}
e = subfile->line_vector->item + subfile->line_vector->nitems++;
e->line = line;
- e->pc = ADDR_BITS_REMOVE(pc);
+ e->pc = gdbarch_addr_bits_remove (current_gdbarch, pc);
}
/* Needed in order to sort line tables from IBM xcoff files. Sigh! */
fprintf_unfiltered (file,
"gdbarch_dump: addr_bit = %s\n",
paddr_d (current_gdbarch->addr_bit));
-#ifdef ADDR_BITS_REMOVE
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "ADDR_BITS_REMOVE(addr)",
- XSTRING (ADDR_BITS_REMOVE (addr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: addr_bits_remove = <0x%lx>\n",
(long) current_gdbarch->addr_bits_remove);
/* On some machines there are bits in addresses which are not really
part of the address, but are used by the kernel, the hardware, etc.
- for special purposes. ADDR_BITS_REMOVE takes out any such bits so
+ for special purposes. gdbarch_addr_bits_remove takes out any such bits so
we get a "real" address such as one would find in a symbol table.
This is used only for addresses of instructions, and even then I'm
not sure it's used in all contexts. It exists to deal with there
typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (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);
-#if !defined (GDB_TM_FILE) && defined (ADDR_BITS_REMOVE)
-#error "Non multi-arch definition of ADDR_BITS_REMOVE"
-#endif
-#if !defined (ADDR_BITS_REMOVE)
-#define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
-#endif
/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
- ADDR_BITS_REMOVE. */
+ gdbarch_addr_bits_remove. */
typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
m::CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr, struct target_ops *targ:addr, targ::convert_from_func_ptr_addr_identity::0
# On some machines there are bits in addresses which are not really
# part of the address, but are used by the kernel, the hardware, etc.
-# for special purposes. ADDR_BITS_REMOVE takes out any such bits so
+# for special purposes. gdbarch_addr_bits_remove takes out any such bits so
# we get a "real" address such as one would find in a symbol table.
# This is used only for addresses of instructions, and even then I'm
# not sure it's used in all contexts. It exists to deal with there
# 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
+f::CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr::core_addr_identity::0
# It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
-# ADDR_BITS_REMOVE.
+# gdbarch_addr_bits_remove.
f:=: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
init_sal (&sr_sal); /* initialize to zeros */
- sr_sal.pc = ADDR_BITS_REMOVE (get_frame_pc (return_frame));
+ sr_sal.pc = gdbarch_addr_bits_remove
+ (current_gdbarch, get_frame_pc (return_frame));
sr_sal.section = find_pc_overlay (sr_sal.pc);
insert_step_resume_breakpoint_at_sal (sr_sal, get_frame_id (return_frame));
init_sal (&sr_sal); /* initialize to zeros */
- sr_sal.pc = ADDR_BITS_REMOVE (frame_pc_unwind (next_frame));
+ sr_sal.pc = gdbarch_addr_bits_remove
+ (current_gdbarch, frame_pc_unwind (next_frame));
sr_sal.section = find_pc_overlay (sr_sal.pc);
insert_step_resume_breakpoint_at_sal (sr_sal, frame_unwind_id (next_frame));
int instlen;
int seen_adjsp = 0;
- pc = ADDR_BITS_REMOVE (pc);
+ pc = gdbarch_addr_bits_remove (current_gdbarch, pc);
start_pc = pc;
fence = start_pc - heuristic_fence_post;
if (start_pc == 0)
monitor_debug ("MON write %d %s\n", len, paddr (memaddr));
if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
- memaddr = ADDR_BITS_REMOVE (memaddr);
+ memaddr = gdbarch_addr_bits_remove (current_gdbarch, memaddr);
/* Use memory fill command for leading 0 bytes. */
paddr_nz (memaddr), (long) myaddr, len);
if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
- memaddr = ADDR_BITS_REMOVE (memaddr);
+ memaddr = gdbarch_addr_bits_remove (current_gdbarch, memaddr);
if (current_monitor->flags & MO_GETMEM_READ_SINGLE)
return monitor_read_memory_single (memaddr, myaddr, len);
error (_("No set_break defined for this monitor"));
if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
- addr = ADDR_BITS_REMOVE (addr);
+ addr = gdbarch_addr_bits_remove (current_gdbarch, addr);
/* Determine appropriate breakpoint size for this address. */
bp = gdbarch_breakpoint_from_pc (current_gdbarch, &addr, &bplen);
val = evaluate_expression (d->exp);
addr = value_as_address (val);
if (d->format.format == 'i')
- addr = ADDR_BITS_REMOVE (addr);
+ addr = gdbarch_addr_bits_remove (current_gdbarch, addr);
annotate_display_value ();
else if (PC_REGNUM >= 0)
{
CORE_ADDR raw_val = read_register_pid (PC_REGNUM, ptid);
- pc_val = ADDR_BITS_REMOVE (raw_val);
+ pc_val = gdbarch_addr_bits_remove (current_gdbarch, raw_val);
}
else
internal_error (__FILE__, __LINE__, _("read_pc_pid: Unable to find PC"));
int rpid, rerrflg, rresponse, rlen;
int nfields;
- addr = ADDR_BITS_REMOVE (addr);
+ addr = gdbarch_addr_bits_remove (current_gdbarch, addr);
if (mips_monitor == MON_LSI)
{
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */
#if 0
- /* ADDR_BITS_REMOVE is wrong if we are being called for a
+ /* gdbarch_addr_bits_remove is wrong if we are being called for a
non-address (e.g. argument to "signal", "info break", etc.), or
for pointers to char, in which the low bits *are* significant. */
- return ADDR_BITS_REMOVE (value_as_long (val));
+ return gdbarch_addr_bits_remove (current_gdbarch, value_as_long (val));
#else
/* There are several targets (IA-64, PowerPC, and others) which