Showing the changes to src/vm/vm_exception_handler.cpp (1 of 31 files). Show all
Unified · Split
| @@ -10,10 +10,14 @@ · 9 unmodified lines | |||
| 10 | #include <exceptions.h> | 10 | #include <exceptions.h> |
| 11 | #include <debug.h> | 11 | #include <debug.h> |
| 12 | 12 | ||
| 13 | using namespace disvm; | 13 | using disvm::debug::component_trace_t; |
| 14 | using namespace disvm::runtime; | 14 | using disvm::debug::log_level_t; |
| 15 | 15 | ||
| 16 | std::tuple<const handler_t *, vm_frame_t *, vm_pc_t> disvm::runtime::find_exception_handler( | 16 | using disvm::runtime::vm_pc_t; |
| 17 | using disvm::runtime::vm_frame_t; | ||
| 18 | using disvm::runtime::handler_entry_t; | ||
| 19 | |||
| 20 | std::tuple<const handler_entry_t *, vm_frame_t *, vm_pc_t> disvm::runtime::find_exception_handler( | ||
| 17 | const vm_stack_t &stack, | 21 | const vm_stack_t &stack, |
| 18 | const vm_module_ref_t &faulting_module, | 22 | const vm_module_ref_t &faulting_module, |
| 19 | const vm_pc_t faulting_pc, | 23 | const vm_pc_t faulting_pc, |
| @@ -26,7 +30,7 @@ std::tuple<const handler_t *, vm_frame_t *, vm_pc_t> disvm::runtime::find_except · 6 unmodified lines | |||
| 26 | 30 | ||
| 27 | while (current_frame != nullptr) | 31 | while (current_frame != nullptr) |
| 28 | { | 32 | { |
| 29 | debug::log_msg(debug::component_trace_t::exception, debug::log_level_t::debug, "begin: handler: %d", unwind_depth); | 33 | disvm::debug::log_msg(component_trace_t::exception, log_level_t::debug, "begin: handler: %d", unwind_depth); |
| 30 | 34 | ||
| 31 | auto &handler_section = current_module->module->handler_section; | 35 | auto &handler_section = current_module->module->handler_section; |
| 32 | 36 | ||
| @@ -42,12 +46,12 @@ std::tuple<const handler_t *, vm_frame_t *, vm_pc_t> disvm::runtime::find_except · 9 unmodified lines | |||
| 42 | auto exception_name = exception.name.get(); | 46 | auto exception_name = exception.name.get(); |
| 43 | if (exception_id.compare_to(exception_name) == 0) | 47 | if (exception_id.compare_to(exception_name) == 0) |
| 44 | { | 48 | { |
| 45 | debug::log_msg(debug::component_trace_t::exception, debug::log_level_t::debug, "end: handler: match: %d", unwind_depth); | 49 | disvm::debug::log_msg(component_trace_t::exception, log_level_t::debug, "end: handler: match: %d", unwind_depth); |
| 46 | return std::make_tuple(&handler, current_frame, exception.pc); | 50 | return std::make_tuple(&handler, current_frame, exception.pc); |
| 47 | } | 51 | } |
| 48 | else if (exception_name == nullptr && exception.pc != runtime_constants::invalid_program_counter) | 52 | else if (exception_name == nullptr && exception.pc != runtime_constants::invalid_program_counter) |
| 49 | { | 53 | { |
| 50 | debug::log_msg(debug::component_trace_t::exception, debug::log_level_t::debug, "end: handler: fallback: %d", unwind_depth); | 54 | disvm::debug::log_msg(component_trace_t::exception, log_level_t::debug, "end: handler: fallback: %d", unwind_depth); |
| 51 | return std::make_tuple(&handler, current_frame, exception.pc); | 55 | return std::make_tuple(&handler, current_frame, exception.pc); |
| 52 | } | 56 | } |
| 53 | } | 57 | } |