History

Update registers struct to include next_pc member. This allows the pc member to always point at the current PC instead of having been incremented to the 'next' PC.

arr committed 9 years ago

Commit a46f30c1 parent 87f2d5b6 files · +67 −68Browse files

Showing the changes to src/vm/tool_dispatch.cpp (1 of 6 files). Show all

Unified · Split

src/vm/tool_dispatch.cpp+1−2
@@ -364,7 +364,6 @@ void vm_tool_dispatch_t::resume_all_threads() · 363 unmodified lines
364364 std::tuple<opcode_t, cookie_t> vm_tool_dispatch_t::get_original_opcode_and_cookie(const vm_registers_t &r)
365365 {
366366 const auto module = r.module_ref->module.get();
367− const auto current_pc = r.pc - 1;
368367
369368 if (module == nullptr || util::has_flag(module->header.runtime_flag, runtime_flags_t::builtin))
370369 throw vm_system_exception{ "Unable to determine original opcode in supplied module" };
@@ -375,7 +374,7 @@ std::tuple<opcode_t, cookie_t> vm_tool_dispatch_t::get_original_opcode_and_cooki · 4 unmodified lines
375374 if (iter_orig != _breakpoints.original_opcodes.cend())
376375 {
377376 auto &pc_map = iter_orig->second;
378− auto iter_pc = pc_map.find(current_pc);
377+ auto iter_pc = pc_map.find(r.pc);
379378 if (iter_pc != pc_map.cend())
380379 return iter_pc->second;
381380 }