Handle the breakpoint instruction in userland by sending a SIGTRAP signal.

This commit is contained in:
andrew 2015-08-23 13:18:56 +00:00
parent 790cec3cb6
commit cbbb7c2fa0

View File

@ -327,6 +327,7 @@ el0_excp_unknown(struct trapframe *frame)
void
do_el0_sync(struct trapframe *frame)
{
struct thread *td;
uint32_t exception;
uint64_t esr;
@ -368,6 +369,11 @@ do_el0_sync(struct trapframe *frame)
case EXCP_UNKNOWN:
el0_excp_unknown(frame);
break;
case EXCP_BRK:
td = curthread;
call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr);
userret(td, frame);
break;
default:
print_registers(frame);
panic("Unknown userland exception %x esr_el1 %lx\n", exception,