+2017-12-15 Richard Henderson <rth@redhat.com>
+ Uros Bizjak <ubizjak@gmail.com>
+
+ PR gdb/19061
+ * alpha-tdep.c (alpha_software_single_step): Call
+ alpha_deal_with_atomic_sequence here.
+ (set_gdbarch_software_single_step): Set to
+ alpha_software_single_step.
+ * nat/linux-ptrace.h [__alpha__]: Define GDB_ARCH_IS_TRAP_BRKPT
+ and GDB_ARCH_IS_TRAP_HWBKPT.
+
2017-12-15 Yao Qi <yao.qi@linaro.org>
* unittests/memory-map-selftests.c: Wrap test with HAVE_LIBEXPAT.
the sequence. */
static std::vector<CORE_ADDR>
-alpha_deal_with_atomic_sequence (struct regcache *regcache)
+alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
{
- struct gdbarch *gdbarch = regcache->arch ();
- CORE_ADDR pc = regcache_read_pc (regcache);
CORE_ADDR breaks[2] = {-1, -1};
CORE_ADDR loc = pc;
CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence. */
std::vector<CORE_ADDR>
alpha_software_single_step (struct regcache *regcache)
{
- CORE_ADDR pc = alpha_next_pc (regcache, regcache_read_pc (regcache));
+ struct gdbarch *gdbarch = regcache->arch ();
+
+ CORE_ADDR pc = regcache_read_pc (regcache);
+
+ std::vector<CORE_ADDR> next_pcs
+ = alpha_deal_with_atomic_sequence (gdbarch, pc);
+ if (!next_pcs.empty ())
+ return next_pcs;
- return {pc};
+ CORE_ADDR next_pc = alpha_next_pc (regcache, pc);
+ return {next_pc};
}
\f
set_gdbarch_cannot_step_breakpoint (gdbarch, 1);
/* Handles single stepping of atomic sequences. */
- set_gdbarch_software_single_step (gdbarch, alpha_deal_with_atomic_sequence);
+ set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
Beginning with Linux 4.6, the MIPS port reports proper TRAP_BRKPT and
TRAP_HWBKPT codes, so we also match them.
+ The Alpha kernel uses TRAP_BRKPT for all traps.
+
The generic Linux target code should use GDB_ARCH_IS_TRAP_* instead
of TRAP_* to abstract out these peculiarities. */
#if defined __i386__ || defined __x86_64__
#elif defined __mips__
# define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == SI_KERNEL || (X) == TRAP_BRKPT)
# define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == SI_KERNEL || (X) == TRAP_HWBKPT)
+#elif defined __alpha__
+# define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == TRAP_BRKPT)
+# define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == TRAP_BRKPT)
#else
# define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == TRAP_BRKPT)
# define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == TRAP_HWBKPT)