Skip to content

Commit

Permalink
sh: Don't NOTIFY_STOP for non-UBC breakpoint traps.
Browse files Browse the repository at this point in the history
Presently the hw_breakpoint code is the primary notifier dispatch for
breakpoint traps, although it's only UBC traps that are of particular
interest there. This patches in a check to allow non-UBC generated
breakpoints to pass through down the remainder of the notifier chain,
giving things like kgdb a chance at getting notified.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Dec 22, 2009
1 parent 6c0ee6a commit b74ab70
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/sh/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,18 @@ BUILD_TRAP_HANDLER(breakpoint)
int __kprobes hw_breakpoint_exceptions_notify(struct notifier_block *unused,
unsigned long val, void *data)
{
struct die_args *args = data;

if (val != DIE_BREAKPOINT)
return NOTIFY_DONE;

/*
* If the breakpoint hasn't been triggered by the UBC, it's
* probably from a debugger, so don't do anything more here.
*/
if (args->trapnr != 0x1e0)
return NOTIFY_DONE;

return hw_breakpoint_handler(data);
}

Expand Down

0 comments on commit b74ab70

Please sign in to comment.