From a078ef221f222ca5536307c6e695999b60b2a1ff Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Thu, 1 Dec 2022 09:47:09 -0800 Subject: Convert triggers::module_t::detect_trap_match to std::optional Goal is to remove match_result_t.fire field to eliminate dont-care fields. --- riscv/execute.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'riscv/execute.cc') diff --git a/riscv/execute.cc b/riscv/execute.cc index 1426d2d..3c627a4 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -302,9 +302,9 @@ void processor_t::step(size_t n) n = instret; // Trigger action takes priority over single step - triggers::match_result_t match = TM.detect_trap_match(t); - if (match.fire) - take_trigger_action(match.action, 0, state.pc); + auto match = TM.detect_trap_match(t); + if (match.has_value()) + take_trigger_action(match->action, 0, state.pc); else if (unlikely(state.single_step == state.STEP_STEPPED)) { state.single_step = state.STEP_NONE; enter_debug_mode(DCSR_CAUSE_STEP); -- cgit v1.1