version 1.2.16.5, 2018/10/20 06:58:24 |
version 1.3, 2018/04/01 04:35:03 |
|
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <aarch64/frame.h> |
#include <aarch64/frame.h> |
#include <ddb/db_user.h> |
|
|
|
typedef long long int db_expr_t; |
typedef long long int db_expr_t; |
#define DDB_EXPR_FMT "ll" |
#define DDB_EXPR_FMT "ll" |
Line 119 static inline bool |
|
Line 118 static inline bool |
|
inst_load(db_expr_t insn) |
inst_load(db_expr_t insn) |
{ |
{ |
return |
return |
((insn & 0xffe00c00) == 0xb8800000) || /* ldursw */ |
((((insn) & 0x3b000000) == 0x18000000) || /* literal */ |
/* ldrsw imm{pre,post}idx */ |
(((insn) & 0x3f400000) == 0x08400000) || /* exclusive */ |
((insn & 0xffe00400) == 0xb8800400) || |
(((insn) & 0x3bc00000) == 0x28400000) || /* no-allocate pair */ |
((insn & 0xffc00c00) == 0xb8800800) || /* ldrsw reg,ldtrsw */ |
((((insn) & 0x3b200c00) == 0x38000400) && |
((insn & 0xffc00000) == 0xb9800000) || /* ldrsw immunsign */ |
(((insn) & 0x3be00c00) != 0x38000400) && |
((insn & 0xffc00000) == 0x39400000) || /* ldrb immunsign */ |
(((insn) & 0xffe00c00) != 0x3c800400)) || /* imm post-indexed */ |
((insn & 0xff000000) == 0x98000000) || /* ldrsw literal */ |
((((insn) & 0x3b200c00) == 0x38000c00) && |
/* ldpsw {pre,post}idx */ |
(((insn) & 0x3be00c00) != 0x38000c00) && |
((insn & 0xfec00000) == 0x68c00000) || |
(((insn) & 0xffe00c00) != 0x3c800c00)) || /* imm pre-indexed */ |
/* ldrh immunsign,ldpsw signed */ |
((((insn) & 0x3b200c00) == 0x38200800) && |
((insn & 0xefc00000) == 0x69400000) || |
(((insn) & 0x3be00c00) != 0x38200800) && |
((insn & 0xbfff0000) == 0x887f0000) || /* ldaxp,ldxp */ |
(((insn) & 0xffe00c00) != 0x3ca00c80)) || /* register offset */ |
((insn & 0xbfc00000) == 0xb9400000) || /* ldr immunsign */ |
((((insn) & 0x3b200c00) == 0x38000800) && |
((insn & 0xbfa00c00) == 0x38800000) || /* ldursh,ldursb */ |
(((insn) & 0x3be00c00) != 0x38000800)) || /* unprivileged */ |
/* ldrsh imm{pre,post}idx,ldrsb imm{pre,post}idx */ |
((((insn) & 0x3b200c00) == 0x38000000) && |
((insn & 0xbfa00400) == 0x38800400) || |
(((insn) & 0x3be00c00) != 0x38000000) && |
/* ldrs[bh] reg,ldtrs[bh] */ |
(((insn) & 0xffe00c00) != 0x3c800000)) || /* unscaled imm */ |
((insn & 0xbf800c00) == 0x38800800) || |
((((insn) & 0x3b000000) == 0x39000000) && |
/* ldrsh immunsign,ldrsb immunsign */ |
(((insn) & 0x3bc00000) != 0x39000000) && |
((insn & 0xbf800000) == 0x39800000) || |
(((insn) & 0xffc00000) != 0x3d800000)) || /* unsigned imm */ |
((insn & 0xbf000000) == 0x18000000) || /* ldr literal */ |
(((insn) & 0x3bc00000) == 0x28400000) || /* pair (offset) */ |
/* ldp {pre,post}idx,ldp signed,ldnp */ |
(((insn) & 0x3bc00000) == 0x28c00000) || /* pair (post-indexed) */ |
((insn & 0x7e400000) == 0x28400000) || |
(((insn) & 0x3bc00000) == 0x29800000)); /* pair (pre-indexed) */ |
((insn & 0x3ffffc00) == 0x085f7c00) || /* ldxr,ldxr[bh] */ |
|
((insn & 0x3fe00c00) == 0x38400000) || /* ldur,ldur[bh] */ |
|
/* ldr imm{pre,post}idx,ldr[bh]_imm{pre,post}idx */ |
|
((insn & 0x3fe00400) == 0x38400400) || |
|
/* ldtr,ldtr[bh],ldr_reg,ldr[bh]_reg */ |
|
((insn & 0x3fc00c00) == 0x38400800) || |
|
/* ldaxr,ldaxr[bh],ldar,ldar[bh] */ |
|
((insn & 0x3f7ffc00) == 0x085ffc00); |
|
} |
} |
|
|
static inline bool |
static inline bool |
inst_store(db_expr_t insn) |
inst_store(db_expr_t insn) |
{ |
{ |
return |
return |
((insn & 0xbfe00000) == 0x88200000) || /* stlxp,stxp */ |
((((insn) & 0x3f400000) == 0x08000000) || /* exclusive */ |
/* stp {pre,post}idx,stp signed,stnp */ |
(((insn) & 0x3bc00000) == 0x28000000) || /* no-allocate pair */ |
((insn & 0x7e400000) == 0x28000000) || |
((((insn) & 0x3be00c00) == 0x38000400) || |
((insn & 0x3ffffc00) == 0x089ffc00) || /* stlr,stlr[bh] */ |
(((insn) & 0xffe00c00) == 0x3c800400)) || /* imm post-indexed */ |
/* stlxr,stlxr[bh],stxr,stxr[bh] */ |
((((insn) & 0x3be00c00) == 0x38000c00) || |
((insn & 0x3fe07c00) == 0x08007c00) || |
(((insn) & 0xffe00c00) == 0x3c800c00)) || /* imm pre-indexed */ |
((insn & 0x3fe00c00) == 0x38000000) || /* stur,stur[bh] */ |
((((insn) & 0x3be00c00) == 0x38200800) || |
/* str imm{pre,post}idx,str[bh] imm{pre,post}idx */ |
(((insn) & 0xffe00c00) == 0x3ca00800)) || /* register offset */ |
((insn & 0x3fe00400) == 0x38000400) || |
(((insn) & 0x3be00c00) == 0x38000800) || /* unprivileged */ |
/* str reg,str[bh] reg,sttr,sttr[bh] */ |
((((insn) & 0x3be00c00) == 0x38000000) || |
((insn & 0x3fc00c00) == 0x38000800) || |
(((insn) & 0xffe00c00) == 0x3c800000)) || /* unscaled imm */ |
/* str immunsign,str[bh] immunsign */ |
((((insn) & 0x3bc00000) == 0x39000000) || |
((insn & 0x3fc00000) == 0x39000000); |
(((insn) & 0xffc00000) == 0x3d800000)) || /* unsigned imm */ |
|
(((insn) & 0x3bc00000) == 0x28000000) || /* pair (offset) */ |
|
(((insn) & 0x3bc00000) == 0x28800000) || /* pair (post-indexed) */ |
|
(((insn) & 0x3bc00000) == 0x29800000)); /* pair (pre-indexed) */ |
} |
} |
|
|
#define SOFTWARE_SSTEP |
#define SOFTWARE_SSTEP |
Line 202 db_addr_t db_branch_taken(db_expr_t, db_ |
|
Line 196 db_addr_t db_branch_taken(db_expr_t, db_ |
|
|
|
#define DB_MACHINE_COMMANDS |
#define DB_MACHINE_COMMANDS |
void dump_trapframe(struct trapframe *, void (*)(const char *, ...)); |
void dump_trapframe(struct trapframe *, void (*)(const char *, ...)); |
const char *strdisasm(vaddr_t); |
|
const char *strdisasm_aarch32(vaddr_t); |
|
|
|
void db_machdep_init(void); |
void db_machdep_init(void); |
|
|
/* hardware breakpoint/watchpoint functions */ |
/* hardware breakpoint/watchpoint functions */ |
Line 216 void aarch64_watchpoint_set(int, vaddr_t |
|
Line 211 void aarch64_watchpoint_set(int, vaddr_t |
|
#define WATCHPOINT_ACCESS_LOADSTORE 0x03 |
#define WATCHPOINT_ACCESS_LOADSTORE 0x03 |
#define WATCHPOINT_ACCESS_MASK 0x03 |
#define WATCHPOINT_ACCESS_MASK 0x03 |
|
|
#define DB_ELF_SYMBOLS |
|
|
|
#elif defined(__arm__) |
#elif defined(__arm__) |
|
|