aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--riscv/triggers.cc4
-rw-r--r--riscv/triggers.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/riscv/triggers.cc b/riscv/triggers.cc
index 6c03c9e..6823615 100644
--- a/riscv/triggers.cc
+++ b/riscv/triggers.cc
@@ -10,7 +10,7 @@ reg_t trigger_with_tdata2_t::tdata2_read(const processor_t UNUSED * const proc)
}
bool trigger_with_tdata2_t::tdata2_write(processor_t UNUSED * const proc, const reg_t UNUSED val) noexcept {
- if (dmode && !proc->get_state()->debug_mode) {
+ if (get_dmode() && !proc->get_state()->debug_mode) {
return false;
}
tdata2 = val;
@@ -39,7 +39,7 @@ reg_t mcontrol_t::tdata1_read(const processor_t * const proc) const noexcept {
}
bool mcontrol_t::tdata1_write(processor_t * const proc, const reg_t val) noexcept {
- if (dmode && !proc->get_state()->debug_mode) {
+ if (get_dmode() && !proc->get_state()->debug_mode) {
return false;
}
auto xlen = proc->get_xlen();
diff --git a/riscv/triggers.h b/riscv/triggers.h
index 375b393..ffb51c5 100644
--- a/riscv/triggers.h
+++ b/riscv/triggers.h
@@ -51,11 +51,11 @@ public:
virtual bool tdata2_write(processor_t * const proc, const reg_t val) noexcept = 0;
virtual bool chain() const { return false; }
+ virtual bool get_dmode() const = 0;
virtual bool get_execute() const { return false; }
virtual bool get_store() const { return false; }
virtual bool get_load() const { return false; }
- bool dmode = false;
action_t action = ACTION_DEBUG_EXCEPTION;
bool hit = false;
@@ -90,6 +90,7 @@ public:
virtual bool tdata1_write(processor_t * const proc, const reg_t val) noexcept override;
virtual bool chain() const override { return chain_bit; }
+ virtual bool get_dmode() const override { return dmode; }
virtual bool get_execute() const override { return execute; }
virtual bool get_store() const override { return store; }
virtual bool get_load() const override { return load; }
@@ -101,6 +102,7 @@ private:
bool simple_match(unsigned xlen, reg_t value) const;
public:
+ bool dmode = false;
bool select = false;
bool timing = false;
bool chain_bit = false;