(emulator)
| 2683 | } |
| 2684 | |
| 2685 | function debug_start(emulator) |
| 2686 | { |
| 2687 | if(!emulator.v86) |
| 2688 | { |
| 2689 | return; |
| 2690 | } |
| 2691 | |
| 2692 | // called as soon as soon as emulation is started, in debug mode |
| 2693 | var debug = emulator.v86.cpu.debug; |
| 2694 | |
| 2695 | $("dump_gdt").onclick = debug.dump_gdt_ldt.bind(debug); |
| 2696 | $("dump_idt").onclick = debug.dump_idt.bind(debug); |
| 2697 | $("dump_regs").onclick = debug.dump_regs.bind(debug); |
| 2698 | $("dump_pt").onclick = debug.dump_page_structures.bind(debug); |
| 2699 | |
| 2700 | $("dump_log").onclick = function() |
| 2701 | { |
| 2702 | dump_file(log_data.join(""), "v86.log"); |
| 2703 | }; |
| 2704 | |
| 2705 | var cpu = emulator.v86.cpu; |
| 2706 | |
| 2707 | $("debug_panel").style.display = "block"; |
| 2708 | setInterval(function() |
| 2709 | { |
| 2710 | $("debug_panel").textContent = |
| 2711 | cpu.debug.get_regs_short().join("\n") + "\n" + cpu.debug.get_state(); |
| 2712 | |
| 2713 | $("dump_log").value = "Dump log" + (log_data.length ? " (" + log_data.length + " lines)" : ""); |
| 2714 | }, 1000); |
| 2715 | |
| 2716 | // helps debugging |
| 2717 | window.cpu = cpu; |
| 2718 | window.dump_file = dump_file; |
| 2719 | } |
| 2720 | |
| 2721 | function onpopstate(e) |
| 2722 | { |
no test coverage detected