if (size > 0)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
unsigned long tmp;
unsigned i;
char *buf = alloca (size);
Note that when loading a shared library (text_offset != 0) the
unwinds are already relative to the text_offset that will be
passed in. */
- if (gdbarch_tdep (current_gdbarch)->is_elf && text_offset == 0)
+ if (gdbarch_tdep (gdbarch)->is_elf && text_offset == 0)
{
low_text_segment_address = -1;
text_offset = low_text_segment_address;
}
- else if (gdbarch_tdep (current_gdbarch)->solib_get_text_base)
+ else if (gdbarch_tdep (gdbarch)->solib_get_text_base)
{
- text_offset = gdbarch_tdep (current_gdbarch)->solib_get_text_base (objfile);
+ text_offset = gdbarch_tdep (gdbarch)->solib_get_text_base (objfile);
}
bfd_get_section_contents (objfile->obfd, section, buf, 0, size);
return names[i];
}
+/* Map dwarf DBX register numbers to GDB register numbers. */
static int
hppa64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
- /* r0-r31 and sar map one-to-one. */
+ /* The general registers and the sar are the same in both sets. */
if (reg <= 32)
return reg;
/* fr4-fr31 are mapped from 72 in steps of 2. */
- if (reg >= 72 || reg < 72 + 28 * 2)
+ if (reg >= 72 && reg < 72 + 28 * 2 && !(reg & 1))
return HPPA64_FP4_REGNUM + (reg - 72) / 2;
- error ("Invalid DWARF register num %d.", reg);
+ warning (_("Unmapped DWARF DBX Register #%d encountered."), reg);
return -1;
}
ALL_OBJFILE_OSECTIONS (sec->objfile, opd)
{
if (strcmp (opd->the_bfd_section->name, ".opd") == 0)
- break;
+ break;
}
if (opd < sec->objfile->sections_end)
{
CORE_ADDR addr;
- for (addr = opd->addr; addr < opd->endaddr; addr += 2 * 8)
- {
+ for (addr = obj_section_addr (opd);
+ addr < obj_section_endaddr (opd);
+ addr += 2 * 8)
+ {
ULONGEST opdaddr;
char tmp[8];
break;
opdaddr = extract_unsigned_integer (tmp, sizeof (tmp));
- if (opdaddr == code)
+ if (opdaddr == code)
return addr - 16;
}
}
{
if (addr & 2)
{
+ struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
CORE_ADDR plabel = addr & ~3;
- return read_memory_typed_address (plabel, builtin_type_void_func_ptr);
+ return read_memory_typed_address (plabel, func_ptr_type);
}
return addr;
/* FIXME drow/20070101: Calling gdbarch_addr_bits_remove on the
result of get_frame_address_in_block implies a problem.
The bits should have been removed earlier, before the return
- value of gdbarch_unwind_pc. That might be happening already;
+ value of frame_pc_unwind. That might be happening already;
if it isn't, it should be fixed. Then this call can be
removed. */
pc = gdbarch_addr_bits_remove (get_frame_arch (this_frame), pc);
}
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
CORE_ADDR
hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
{
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
+
unsigned int insn[HPPA_MAX_INSN_PATTERN_LEN];
int dp_rel;
/* PLABELs have bit 30 set; if it's a PLABEL, then dereference it. */
if (pc & 0x2)
- pc = read_memory_typed_address (pc & ~0x3, builtin_type_void_func_ptr);
+ pc = read_memory_typed_address (pc & ~0x3, func_ptr_type);
return pc;
}
if (in_plt_section (pc, NULL))
{
- pc = read_memory_typed_address (pc, builtin_type_void_func_ptr);
+ pc = read_memory_typed_address (pc, func_ptr_type);
/* If the PLT slot has not yet been resolved, the target will be
the PLT stub. */
}
/* This should point to the fixup routine. */
- pc = read_memory_typed_address (pc + 8, builtin_type_void_func_ptr);
+ pc = read_memory_typed_address (pc + 8, func_ptr_type);
}
}