static const unsigned char *
v850_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
- int *lenptr)
+ int *lenptr)
{
- static unsigned char breakpoint[] = { 0x85, 0x05 };
+ *lenptr = 2;
- *lenptr = sizeof (breakpoint);
- return breakpoint;
-}
+ switch (gdbarch_bfd_arch_info (gdbarch)->mach)
+ {
+ case bfd_mach_v850e2:
+ case bfd_mach_v850e2v3:
+ case bfd_mach_v850e3v5:
+ {
+ /* Implement software breakpoints by using the dbtrap instruction.
+ Older architectures had no such instruction. For those, an
+ unconditional branch to self instruction is used. */
-/* Implement software breakpoints by using the dbtrap instruction.
- Older architectures had no such instruction. For those, an
- unconditional branch to self instruction is used. */
+ static unsigned char dbtrap_breakpoint[] = { 0x40, 0xf8 };
-static const unsigned char *
-v850_dbtrap_breakpoint_from_pc (struct gdbarch *gdbarch,
- CORE_ADDR *pcptr, int *lenptr)
-{
- static unsigned char breakpoint[] = { 0x40, 0xf8 };
+ return dbtrap_breakpoint;
+ }
+ break;
+ default:
+ {
+ static unsigned char breakpoint[] = { 0x85, 0x05 };
- *lenptr = sizeof (breakpoint);
- return breakpoint;
+ return breakpoint;
+ }
+ break;
+ }
}
static struct v850_frame_cache *
set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- switch (info.bfd_arch_info->mach)
- {
- case bfd_mach_v850e2:
- case bfd_mach_v850e2v3:
- case bfd_mach_v850e3v5:
- set_gdbarch_breakpoint_from_pc (gdbarch, v850_dbtrap_breakpoint_from_pc);
- break;
- default:
- set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc);
- break;
- }
+ set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc);
set_gdbarch_return_value (gdbarch, v850_return_value);
set_gdbarch_push_dummy_call (gdbarch, v850_push_dummy_call);
set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue);