arm64: add definition for IS_SSTEP_TRAP()

arm64 has a distinct exception code for single-step, so we can use this
to detect when an unexpected SS trap is encountered, or when an expected
one is not. See db_stop_at_pc().

Reviewed by:	markj, jhb
MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28942
This commit is contained in:
Mitchell Horne 2021-03-01 10:01:25 -04:00
parent bd0b7cbf5a
commit e152c88273

View File

@ -38,6 +38,7 @@
#include <machine/trap.h>
#define T_BREAKPOINT (EXCP_BRK)
#define T_SINGLESTEP (EXCP_SOFTSTP_EL1)
#define T_WATCHPOINT (EXCP_WATCHPT_EL1)
typedef vm_offset_t db_addr_t;
@ -58,6 +59,7 @@ typedef long db_expr_t;
#define db_set_single_step kdb_cpu_set_singlestep
#define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT)
#define IS_SSTEP_TRAP(type, code) (type == T_SINGLESTEP)
#define IS_WATCHPOINT_TRAP(type, code) (type == T_WATCHPOINT)
#define inst_trap_return(ins) (0)