Re-add user_dbreg_trap() for debug register support
This commit is contained in:
parent
db5272252f
commit
170a05510d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125182
@ -396,6 +396,25 @@ trap(frame)
|
||||
break;
|
||||
|
||||
case T_TRCTRAP: /* trace trap */
|
||||
/*
|
||||
* Ignore debug register trace traps due to
|
||||
* accesses in the user's address space, which
|
||||
* can happen under several conditions such as
|
||||
* if a user sets a watchpoint on a buffer and
|
||||
* then passes that buffer to a system call.
|
||||
* We still want to get TRCTRAPS for addresses
|
||||
* in kernel space because that is useful when
|
||||
* debugging the kernel.
|
||||
*/
|
||||
if (user_dbreg_trap()) {
|
||||
/*
|
||||
* Reset breakpoint bits because the
|
||||
* processor doesn't
|
||||
*/
|
||||
/* XXX check upper bits here */
|
||||
load_dr6(rdr6() & 0xfffffff0);
|
||||
goto out;
|
||||
}
|
||||
/*
|
||||
* FALLTHROUGH (TRCTRAP kernel mode, kernel address)
|
||||
*/
|
||||
|
@ -69,6 +69,7 @@ void pagezero(void *addr);
|
||||
int is_physical_memory(vm_offset_t addr);
|
||||
int isa_nmi(int cd);
|
||||
void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist);
|
||||
int user_dbreg_trap(void);
|
||||
void fpstate_drop(struct thread *td);
|
||||
|
||||
#endif /* !_MACHINE_MD_VAR_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user