/* Target-dependent code for the HP PA-RISC architecture.
- Copyright (C) 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
- 2011 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
struct hppa_unwind_info *ui;
struct hppa_objfile_private *obj_private;
- text_offset = ANOFFSET (objfile->section_offsets, 0);
+ text_offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
ui = (struct hppa_unwind_info *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct hppa_unwind_info));
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned long status;
unsigned int inst;
- char buf[4];
- int off;
+ gdb_byte buf[4];
status = target_read_memory (pc, buf, 4);
if (status != 0)
struct type *type = check_typedef (value_type (arg));
/* The corresponding parameter that is pushed onto the
stack, and [possibly] passed in a register. */
- char param_val[8];
+ gdb_byte param_val[8];
int param_len;
memset (param_val, 0, sizeof param_val);
if (TYPE_LENGTH (type) > 8)
addr += 2 * 8)
{
ULONGEST opdaddr;
- char tmp[8];
+ gdb_byte tmp[8];
if (target_read_memory (addr, tmp, sizeof (tmp)))
break;
/* Handle 32/64-bit struct return conventions. */
static enum return_value_convention
-hppa32_return_value (struct gdbarch *gdbarch, struct type *func_type,
+hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
}
static enum return_value_convention
-hppa64_return_value (struct gdbarch *gdbarch, struct type *func_type,
+hppa64_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
int stop_before_branch)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- char buf[4];
+ gdb_byte buf[4];
CORE_ADDR orig_pc = pc;
unsigned long inst, stack_remaining, save_gr, save_fr, save_rp, save_sp;
unsigned long args_stored, status, i, restart_gr, restart_fr;
{
struct symtab_and_line sal;
CORE_ADDR func_addr, func_end;
- struct symbol *f;
/* If we can not find the symbol in the partial symbol table, then
there is no hope we can determine the function's start address
static CORE_ADDR
hppa_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
{
- unsigned long inst;
- int offset;
CORE_ADDR post_prologue_pc;
- char buf[4];
/* See if we can determine the end of the prologue via the symbol table.
If so, then return either PC, or the PC after the prologue, whichever
struct hppa_frame_cache *cache;
long saved_gr_mask;
long saved_fr_mask;
- CORE_ADDR this_sp;
long frame_size;
struct unwind_table_entry *u;
CORE_ADDR prologue_end;
pc += 4)
{
int reg;
- char buf4[4];
+ gdb_byte buf4[4];
long inst;
if (!safe_frame_unwind_memory (this_frame, pc, buf4, sizeof buf4))
static const struct frame_unwind hppa_frame_unwind =
{
NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
hppa_frame_this_id,
hppa_frame_prev_register,
NULL,
static const struct frame_unwind hppa_fallback_frame_unwind =
{
NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
hppa_fallback_frame_this_id,
hppa_fallback_frame_prev_register,
NULL,
if (pc == 0
|| (tdep->in_solib_call_trampoline != NULL
- && tdep->in_solib_call_trampoline (gdbarch, pc, NULL))
+ && tdep->in_solib_call_trampoline (gdbarch, pc))
|| gdbarch_in_solib_return_trampoline (gdbarch, pc, NULL))
return 1;
return 0;
static const struct frame_unwind hppa_stub_frame_unwind = {
NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
hppa_stub_frame_this_id,
hppa_stub_frame_prev_register,
NULL,
}
static CORE_ADDR
-hppa_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
+hppa_addr_bits_remove (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
}
int
-hppa_in_solib_call_trampoline (struct gdbarch *gdbarch,
- CORE_ADDR pc, char *name)
+hppa_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc)
{
unsigned int insn[HPPA_MAX_INSN_PATTERN_LEN];
struct unwind_table_entry *u;
- if (in_plt_section (pc, name) || hppa_in_dyncall (pc))
+ if (in_plt_section (pc) || hppa_in_dyncall (pc))
return 1;
/* The GNU toolchain produces linker stubs without unwind
/* fallthrough */
}
- if (in_plt_section (pc, NULL))
+ if (in_plt_section (pc))
{
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. */
- if (in_plt_section (pc, NULL))
+ if (in_plt_section (pc))
{
/* Sanity check: are we pointing to the PLT stub? */
if (!hppa_match_insns (gdbarch, pc, hppa_plt_stub, insn))
set_gdbarch_inner_than (gdbarch, core_addr_greaterthan);
set_gdbarch_sp_regnum (gdbarch, HPPA_SP_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, HPPA_FP0_REGNUM);
- set_gdbarch_addr_bits_remove (gdbarch, hppa_smash_text_address);
- set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address);
+ set_gdbarch_addr_bits_remove (gdbarch, hppa_addr_bits_remove);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_read_pc (gdbarch, hppa_read_pc);
set_gdbarch_write_pc (gdbarch, hppa_write_pc);