This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, v3] Expect SI_KERNEL or TRAP_BRKPT si_code values for MIPS breakpoint traps


On Mon, 22 Feb 2016, Luis Machado wrote:

> > > +   The MIPS kernel uses the default si_code of SI_KERNEL for software
> > > +   breakpoints, hardware watchpoints and SIGTRAP's in general.
> > 
> > If we get this for both software breakpoints and hardware watchpoints,
> > then it seems to me that this change still leaves watchpoints broken,
> > as I can't see how check_stopped_by_watchpoint is reached, in either
> > gdb/linux-nat.c or gdbserver/linux-low.c.
> > 
> > Also, "and SIGTRAP's in general." seems wrong.  I hope that that's
> > not the case for user-sent SIGTRAPs?
> 
> I'll defer that to Maciej, as he knows what the kernel emits here. From his
> descriptions, it seems MIPS' kernel pretty much just uses the default si_code
> of SI_KERNEL.

 Yes, for signals produced by the kernel itself, i.e. with `__send_signal' 
from kernel/signal.c with the `info' argument set to SEND_SIG_PRIV, which 
the various calls to `force_sig' from arch/mips/kernel/traps.c boil down 
to.  To have the code set to something else `force_sig_info' is used, in 
the interpretation of `BREAK 6' and `BREAK 7' instructions among other 
cases.  This is also how kill(2) works, setting the code to SI_USER for 
user-issued signals, which is generic in Linux so any architecture will do 
the same here.

  Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]