Skip to content

Commit

Permalink
kgdb,sh: update superh kgdb exception handling
Browse files Browse the repository at this point in the history
Implement kgdb_arch_pc() which adjusts the pc if it needs to be
adjusted after a software breakpoint trap.

Implement kgdb_arch_set_pc() which is a new required function in the
kgdb debug core.

When processing a single step return zero in the error exception field
so that the debug core can distinguish between a single step trap and
a breakpoint trap generically.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Jason Wessel committed May 21, 2010
1 parent c75fbb0 commit 489022c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion arch/sh/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
return -1;
}

unsigned long kgdb_arch_pc(int exception, struct pt_regs *regs)
{
if (exception == 60)
return instruction_pointer(regs) - 2;
return instruction_pointer(regs);
}

void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
{
regs->pc = ip;
}

/*
* The primary entry points for the kgdb debug trap table entries.
*/
Expand All @@ -247,7 +259,7 @@ BUILD_TRAP_HANDLER(singlestep)

local_irq_save(flags);
regs->pc -= instruction_size(__raw_readw(regs->pc - 4));
kgdb_handle_exception(vec >> 2, SIGTRAP, 0, regs);
kgdb_handle_exception(0, SIGTRAP, 0, regs);
local_irq_restore(flags);
}

Expand Down

0 comments on commit 489022c

Please sign in to comment.