Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/trap.c
Show First 20 Lines • Show All 528 Lines • ▼ Show 20 Lines | case EXCP_PC_ALIGN: | ||||
userret(td, frame); | userret(td, frame); | ||||
break; | break; | ||||
case EXCP_BRKPT_EL0: | case EXCP_BRKPT_EL0: | ||||
case EXCP_BRK: | case EXCP_BRK: | ||||
call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr, | call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr, | ||||
exception); | exception); | ||||
userret(td, frame); | userret(td, frame); | ||||
break; | break; | ||||
case EXCP_WATCHPT_EL0: | |||||
call_trapsignal(td, SIGTRAP, TRAP_TRACE, (void *)frame->tf_elr, | |||||
mgorny_gentoo.org: I'm not sure here and I can't figure out the abstractions in Linux code but on Linux I'm… | |||||
mhorneAuthorUnsubmitted Done Inline ActionsHmm. Returning the watched address in si_addr does seem more useful. I don't think there is any other simple way to determine which watchpoint triggered the exception, so we can probably switch over to this. My only reservation is that FreeBSD/amd64 does not appear to behave this way, and it returns the trapping instruction address in si_addr. mhorne: Hmm. Returning the watched address in `si_addr` does seem more useful. I don't think there is… | |||||
mgorny_gentoo.orgUnsubmitted Not Done Inline ActionsIndeed it doesn't. We are working around that by checking DR7 directly. mgorny_gentoo.org: Indeed it doesn't. We are working around that by checking DR7 directly. | |||||
exception); | |||||
userret(td, frame); | |||||
break; | |||||
case EXCP_MSR: | case EXCP_MSR: | ||||
/* | /* | ||||
* The CPU can raise EXCP_MSR when userspace executes an mrs | * The CPU can raise EXCP_MSR when userspace executes an mrs | ||||
* instruction to access a special register userspace doesn't | * instruction to access a special register userspace doesn't | ||||
* have access to. | * have access to. | ||||
*/ | */ | ||||
if (!undef_insn(0, frame)) | if (!undef_insn(0, frame)) | ||||
call_trapsignal(td, SIGILL, ILL_PRVOPC, | call_trapsignal(td, SIGILL, ILL_PRVOPC, | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |
I'm not sure here and I can't figure out the abstractions in Linux code but on Linux I'm getting a SIGTRAP with si_addr pointing to the watched memory rather than the instruction, and LLDB uses that to identify which watchpoint was hit. Do you have any suggestion if I can determine that any other way?