/* Target-dependent code for the IA-64 for GDB, the GNU debugger.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GDB.
}
static int
-ia64_dwarf_reg_to_regnum (int reg)
+ia64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
if (reg >= IA64_GR32_REGNUM && reg <= IA64_GR127_REGNUM)
return V32_REGNUM + (reg - IA64_GR32_REGNUM);
#define IA64_BREAKPOINT 0x00003333300LL
static int
-ia64_memory_insert_breakpoint (struct bp_target_info *bp_tgt)
+ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
+ struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
char bundle[BUNDLE_LEN];
}
static int
-ia64_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
+ia64_memory_remove_breakpoint (struct gdbarch *gdbarch,
+ struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
char bundle[BUNDLE_LEN];
long long instr;
int val;
int template;
+ struct cleanup *cleanup;
addr &= ~0x0f;
+ /* Disable the automatic memory restoration from breakpoints while
+ we read our instruction bundle. Otherwise, the general restoration
+ mechanism kicks in and ends up corrupting our bundle, because it
+ is not aware of the concept of instruction bundles. */
+ cleanup = make_show_memory_breakpoints_cleanup (1);
val = target_read_memory (addr, bundle, BUNDLE_LEN);
/* Check for L type instruction in 2nd slot, if present then
if (val == 0)
target_write_memory (addr, bundle, BUNDLE_LEN);
+ do_cleanups (cleanup);
return val;
}
spill_reg = rN;
last_prologue_pc = next_pc;
}
- else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM] &&
+ else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] &&
rN < 256 && imm == 0)
{
/* mov rN, rM where rM is an input register */
}
CORE_ADDR
-ia64_skip_prologue (CORE_ADDR pc)
+ia64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
{
struct ia64_frame_cache cache;
cache.base = 0;
ia64_libunwind_frame_prev_register,
NULL,
NULL,
- NULL,
libunwind_frame_dealloc_cache
};
}
static enum return_value_convention
-ia64_return_value (struct gdbarch *gdbarch, struct type *valtype,
- struct regcache *regcache, gdb_byte *readbuf,
- const gdb_byte *writebuf)
+ia64_return_value (struct gdbarch *gdbarch, struct type *func_type,
+ struct type *valtype, struct regcache *regcache,
+ gdb_byte *readbuf, const gdb_byte *writebuf)
{
int struct_return = ia64_use_struct_convention (valtype);