From bd496067387a9c89a7e62bbba76e784634936932 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 3 Jan 2018 15:14:12 +0000 Subject: Fix PR19061, gdb hangs/spins-on-cpu when debugging any program on Alpha This fixes PR19061, where gdb hangs/spins-on-cpu when debugging any program on Alpha. (This patch is Uros' forward port of the patch from comment #5 of the PR [1].) Patch was tested on alphaev68-linux-gnu, also tested with gcc's testsuite, where it fixed all hangs in guality.exp and simulate-thread.exp testcases. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=19061#c5 gdb/ChangeLog: 2018-01-03 Richard Henderson Uros Bizjak PR gdb/19061 * alpha-tdep.c (alpha_deal_with_atomic_sequence): Change prototype. (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. --- gdb/nat/linux-ptrace.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/nat') diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h index 5954945..8a8c4c6 100644 --- a/gdb/nat/linux-ptrace.h +++ b/gdb/nat/linux-ptrace.h @@ -155,6 +155,8 @@ struct buffer; 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__ @@ -166,6 +168,9 @@ struct buffer; #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) -- cgit v1.1