diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2021-11-02 19:16:58 -0700 |
---|---|---|
committer | Scott Johnson <scott.johnson@arilinc.com> | 2021-11-04 11:44:12 -0700 |
commit | f862f8c9f2d283b39d0141b798dcb9f96dca5129 (patch) | |
tree | 0c25399b69b5afe0cb622f10d4f29098c8ea77ce /riscv/trap.h | |
parent | c8f11f3eae37833607d7d2635a30275f30cd5f78 (diff) | |
download | spike-f862f8c9f2d283b39d0141b798dcb9f96dca5129.zip spike-f862f8c9f2d283b39d0141b798dcb9f96dca5129.tar.gz spike-f862f8c9f2d283b39d0141b798dcb9f96dca5129.tar.bz2 |
Add gva field to trap_breakpoint
So I can fix breakpoints next to properly report gva.
Diffstat (limited to 'riscv/trap.h')
-rw-r--r-- | riscv/trap.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/riscv/trap.h b/riscv/trap.h index 4434013..5ae7806 100644 --- a/riscv/trap.h +++ b/riscv/trap.h @@ -68,6 +68,12 @@ class mem_trap_t : public trap_t const char* name() { return "trap_"#x; } \ }; +#define DECLARE_INST_WITH_GVA_TRAP(n, x) class trap_##x : public insn_trap_t { \ + public: \ + trap_##x(bool gva, reg_t tval) : insn_trap_t(n, gva, tval) {} \ + const char* name() { return "trap_"#x; } \ +}; + #define DECLARE_MEM_TRAP(n, x) class trap_##x : public mem_trap_t { \ public: \ trap_##x(bool gva, reg_t tval, reg_t tval2, reg_t tinst) : mem_trap_t(n, gva, tval, tval2, tinst) {} \ @@ -83,7 +89,7 @@ class mem_trap_t : public trap_t DECLARE_MEM_TRAP(CAUSE_MISALIGNED_FETCH, instruction_address_misaligned) DECLARE_MEM_TRAP(CAUSE_FETCH_ACCESS, instruction_access_fault) DECLARE_INST_TRAP(CAUSE_ILLEGAL_INSTRUCTION, illegal_instruction) -DECLARE_INST_TRAP(CAUSE_BREAKPOINT, breakpoint) +DECLARE_INST_WITH_GVA_TRAP(CAUSE_BREAKPOINT, breakpoint) DECLARE_MEM_TRAP(CAUSE_MISALIGNED_LOAD, load_address_misaligned) DECLARE_MEM_TRAP(CAUSE_MISALIGNED_STORE, store_address_misaligned) DECLARE_MEM_TRAP(CAUSE_LOAD_ACCESS, load_access_fault) |