+2007-11-07 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (breakpoint_from_pc): Add gdbarch parameter.
+ * gdbarch.{c,h}: Regenerate.
+
+ * xtensa-tdep.c (xtensa_breakpoint_from_pc): Add gdbarch parameter.
+ Replace current_gdbarch by gdbarch.
+ * sh-tdep.c (sh_breakpoint_from_pc): Likewise.
+ * sh64-tdep.c (sh64_breakpoint_from_pc): Likewise.
+ * score-tdep.c (score_breakpoint_from_pc): Likewise.
+ * mips-tdep.c (mips_breakpoint_from_pc): Likewise.
+ * m32r-tdep.c (m32r_breakpoint_from_pc): Likewise.
+ * iq2000-tdep.c (iq2000_breakpoint_from_pc): Likewise.
+ * arm-tdep.c (arm_breakpoint_from_pc): Likewise.
+
+ * xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Add gdbarch
+ parameter.
+ * vax-tdep.c (vax_breakpoint_from_pc): Likewise.
+ * v850-tdep.c (v850_breakpoint_from_pc): Likewise.
+ * spu-tdep.c (spu_breakpoint_from_pc): Likewise.
+ * sparc-tdep.c (sparc_breakpoint_from_pc): Likewise.
+ * s390-tdep.c (s390_breakpoint_from_pc): Likewise.
+ * mn10300-tdep.c (mn10300_breakpoint_from_pc): Likewise.
+ * mt-tdep.c (mt_breakpoint_from_pc): Likewise.
+ * mep-tdep.c (mep_breakpoint_from_pc): Likewise.
+ * m88k-tdep.c (m88k_breakpoint_from_pc): Likewise.
+ * m68hc11-tdep.c (m68hc11_breakpoint_from_pc): Likewise.
+ * m32c-tdep.c (m32c_breakpoint_from_pc): Likewise.
+ * ia64-tdep.c (ia64_breakpoint_from_pc): Likewise.
+ * i386-tdep.c (i386_breakpoint_from_pc): Likewise.
+ * hppa-tdep.c (hppa_breakpoint_from_pc): Likewise.
+ * h8300-tdep.c (h8300_breakpoint_from_pc): Likewise.
+ * frv-tdep.c (frv_breakpoint_from_pc): Likewise.
+ * cris-tdep.c (cris_breakpoint_from_pc): Likewise.
+ * avr-tdep.c (avr_breakpoint_from_pc): Likewise.
+ * alpha-tdep.c (alpha_breakpoint_from_pc): Likewise.
+ * m68k-tdep.c (m68k_local_breakpoint_from_pc): Likewise.
+
+ * rs6000-tdep.c (rs6000_breakpoint_from_pc): Add gdbarch parameter.
+ Replace current_gdbarch by gdbarch.
+ (rs6000_software_single_step): Use get_frame_arch to get at the
+ current architecture by frame_info. Add gdbarch to
+ rs6000_breakpoint_from_pc call.
+
2007-11-07 Markus Deuling <deuling@de.ibm.com>
* frv-tdep.c (frv_register_name, frv_check_watch_resources): Replace
}
\f
static const gdb_byte *
-alpha_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+alpha_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
{
static const gdb_byte break_insn[] = { 0x80, 0, 0, 0 }; /* call_pal bpt */
breakpoint should be inserted. */
static const unsigned char *
-arm_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+arm_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (arm_pc_is_thumb (*pcptr))
{
only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */
static const unsigned char *
-avr_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+avr_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR * pcptr, int *lenptr)
{
static unsigned char avr_break_insn [] = { 0x98, 0x95 };
*lenptr = sizeof (avr_break_insn);
the breakpoint should be inserted. */
static const unsigned char *
-cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+cris_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char break8_insn[] = {0x38, 0xe9};
static unsigned char break15_insn[] = {0x3f, 0xe9};
}
static const unsigned char *
-frv_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenp)
+frv_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenp)
{
static unsigned char breakpoint[] = {0xc0, 0x70, 0x00, 0x01};
*lenp = sizeof (breakpoint);
gdb_assert (gdbarch->breakpoint_from_pc != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
- return gdbarch->breakpoint_from_pc (pcptr, lenptr);
+ return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
}
void
extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
-typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
+typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
extern const gdb_byte * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
f:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0
f:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0
-f:const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0:
+m:const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0:
M:CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
f:int:memory_insert_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_insert_breakpoint::0
f:int:memory_remove_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_remove_breakpoint::0
}
const static unsigned char *
-h8300_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+h8300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
+ int *lenptr)
{
/*static unsigned char breakpoint[] = { 0x7A, 0xFF }; *//* ??? */
static unsigned char breakpoint[] = { 0x01, 0x80 }; /* Sleep */
}
static const unsigned char *
-hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+hppa_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
{
static const unsigned char breakpoint[] = {0x00, 0x01, 0x00, 0x04};
(*len) = sizeof (breakpoint);
This function is 64-bit safe. */
static const gdb_byte *
-i386_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+i386_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
{
static gdb_byte break_insn[] = { 0xcc }; /* int 3 */
/* We don't really want to use this, but remote.c needs to call it in order
to figure out if Z-packets are supported or not. Oh, well. */
const unsigned char *
-ia64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+ia64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
};
static const unsigned char *
-iq2000_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+iq2000_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
+ int *lenptr)
{
static const unsigned char big_breakpoint[] = { 0x00, 0x00, 0x00, 0x0d };
static const unsigned char little_breakpoint[] = { 0x0d, 0x00, 0x00, 0x00 };
(long) *pcptr);
*lenptr = 4;
- return (gdbarch_byte_order (current_gdbarch)
- == BFD_ENDIAN_BIG) ? big_breakpoint
- : little_breakpoint;
+ return (gdbarch_byte_order (gdbarch)
+ == BFD_ENDIAN_BIG) ? big_breakpoint : little_breakpoint;
}
/* Target function return value methods: */
/* Breakpoints. */
static const unsigned char *
-m32c_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+m32c_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
{
static unsigned char break_insn[] = { 0x00 }; /* brk */
}
static const gdb_byte *
-m32r_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+m32r_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
static gdb_byte be_bp_entry[] = { 0x10, 0xf1, 0x70, 0x00 }; /* dpt -> nop */
static gdb_byte le_bp_entry[] = { 0x00, 0x70, 0xf1, 0x10 }; /* dpt -> nop */
gdb_byte *bp;
/* Determine appropriate breakpoint. */
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
if ((*pcptr & 3) == 0)
{
}
static const unsigned char *
-m68hc11_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+m68hc11_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
+ int *lenptr)
{
static unsigned char breakpoint[] = {0x0};
-
+
*lenptr = sizeof (breakpoint);
return breakpoint;
}
#endif
static const gdb_byte *
-m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+m68k_local_breakpoint_from_pc (struct gdbarch *gdbarch,
+ CORE_ADDR *pcptr, int *lenptr)
{
static gdb_byte break_insn[] = {0x4e, (0x40 | BPT_VECTOR)};
*lenptr = sizeof (break_insn);
location for inserting the breakpoint. */
static const gdb_byte *
-m88k_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+m88k_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
{
/* tb 0,r0,511 */
static gdb_byte break_insn[] = { 0xf0, 0x00, 0xd1, 0xff };
/* Breakpoints. */
static const unsigned char *
-mep_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+mep_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR * pcptr, int *lenptr)
{
static unsigned char breakpoint[] = { 0x70, 0x32 };
*lenptr = sizeof (breakpoint);
should be inserted. */
static const gdb_byte *
-mips_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
if (mips_pc_is_mips16 (*pcptr))
{
one, so we defined it ourselves. */
const static unsigned char *
-mn10300_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
+mn10300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
+ int *bp_size)
{
static char breakpoint[] = {0xff};
*bp_size = 1;
The BP for ms2 is defined as 0x69000000 (illegal) */
static const gdb_byte *
-mt_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
+mt_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
+ int *bp_size)
{
static gdb_byte ms1_breakpoint[] = { 0x68, 0, 0, 0 };
static gdb_byte ms2_breakpoint[] = { 0x69, 0, 0, 0 };
*bp_size = 4;
- if (gdbarch_bfd_arch_info (current_gdbarch)->mach == bfd_mach_ms2)
+ if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2)
return ms2_breakpoint;
return ms1_breakpoint;
/* Sequence of bytes for breakpoint instruction. */
const static unsigned char *
-rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
+rs6000_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
+ int *bp_size)
{
static unsigned char big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 };
static unsigned char little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d };
*bp_size = 4;
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
return big_breakpoint;
else
return little_breakpoint;
{
CORE_ADDR dummy;
int breakp_sz;
- const gdb_byte *breakp = rs6000_breakpoint_from_pc (&dummy, &breakp_sz);
+ const gdb_byte *breakp
+ = rs6000_breakpoint_from_pc (get_frame_arch (frame), &dummy, &breakp_sz);
int ii, insn;
CORE_ADDR loc;
CORE_ADDR breaks[2];
/* Breakpoints. */
static const gdb_byte *
-s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+s390_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
static const gdb_byte breakpoint[] = { 0x0, 0x1 };
}
static const gdb_byte *
-score_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+score_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
+ int *lenptr)
{
gdb_byte buf[SCORE_INSTLEN] = { 0 };
int ret;
}
raw = extract_unsigned_integer (buf, SCORE_INSTLEN);
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
if (!(raw & 0x80008000))
{
}
static const unsigned char *
-sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+sh_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
/* 0xc3c3 is trapa #c3, and it works in big and little endian modes */
static unsigned char breakpoint[] = { 0xc3, 0xc3 };
static unsigned char big_remote_breakpoint[] = { 0xc3, 0x20 };
static unsigned char little_remote_breakpoint[] = { 0x20, 0xc3 };
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
*lenptr = sizeof (big_remote_breakpoint);
return big_remote_breakpoint;
}
static const unsigned char *
-sh64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
/* The BRK instruction for shmedia is
01101111 11110101 11111111 11110000
which translates in big endian mode to 0x0, 0x3b
and in little endian mode to 0x3b, 0x0*/
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
if (pc_is_isa32 (*pcptr))
{
location for inserting the breakpoint. */
static const gdb_byte *
-sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+sparc_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
{
static const gdb_byte break_insn[] = { 0x91, 0xd0, 0x20, 0x01 };
/* Breakpoints. */
static const gdb_byte *
-spu_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+spu_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR * pcptr, int *lenptr)
{
static const gdb_byte breakpoint[] = { 0x00, 0x00, 0x3f, 0xff };
}
const static unsigned char *
-v850_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+v850_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = { 0x85, 0x05 };
*lenptr = sizeof (breakpoint);
location for inserting the breakpoint. */
static const gdb_byte *
-vax_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+vax_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
{
static gdb_byte break_insn[] = { 3 };
}
const static unsigned char *
-xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+xstormy16_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
+ int *lenptr)
{
static unsigned char breakpoint[] = { 0x06, 0x0 };
*lenptr = sizeof (breakpoint);
#define DENSITY_LITTLE_BREAKPOINT { 0x2d, 0xf0 }
static const unsigned char *
-xtensa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+xtensa_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
+ int *lenptr)
{
static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT;
DEBUGTRACE ("xtensa_breakpoint_from_pc (pc = 0x%08x)\n", (int) *pcptr);
- if (gdbarch_tdep (current_gdbarch)->isa_use_density_instructions)
+ if (gdbarch_tdep (gdbarch)->isa_use_density_instructions)
{
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
*lenptr = sizeof (density_big_breakpoint);
return density_big_breakpoint;
}
else
{
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
*lenptr = sizeof (big_breakpoint);
return big_breakpoint;