diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e85023e062..d628bc1072 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2016-04-15 Pedro Alves + + * nat/linux-ptrace.h [__mips__] (GDB_ARCH_IS_TRAP_BRKPT): Also + accept TRAP_BRKPT. + [__mips__] (GDB_ARCH_IS_TRAP_HWBKPT): Also accept TRAP_HWBKPT. + 2016-04-15 Yao Qi * arm-tdep.c (thumb_stack_frame_destroyed_p): Return zero if diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h index b9123c9ea6..0a23bcb0fc 100644 --- a/gdb/nat/linux-ptrace.h +++ b/gdb/nat/linux-ptrace.h @@ -140,8 +140,8 @@ struct buffer; in SPU code on a Cell/B.E. However, SI_KERNEL is never seen on a SIGTRAP for any other reason. - The MIPS kernel uses SI_KERNEL for all kernel generated traps. - Since: + The MIPS kernel up until 4.5 used SI_KERNEL for all kernel + generated traps. Since: - MIPS doesn't do hardware single-step. - We don't need to care about exec SIGTRAPs --- we assume @@ -152,6 +152,9 @@ struct buffer; software breakpoints and hardware watchpoints, which can be done by peeking the debug registers. + Beginning with Linux 4.6, the MIPS port reports proper TRAP_BRKPT and + TRAP_HWBKPT codes, so we also match them. + 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__ @@ -161,8 +164,8 @@ struct buffer; # define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == SI_KERNEL || (X) == TRAP_BRKPT) # define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == TRAP_HWBKPT) #elif defined __mips__ -# define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == SI_KERNEL) -# define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == SI_KERNEL) +# 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) #else # define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == TRAP_BRKPT) # define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == TRAP_HWBKPT)