History

Create disvm-asm static lib (Used for working with bytecode) - Convert functions for opcode <--> string Factor out common GYP settings

arr committed 10 years ago

Commit 8f296181 parent f2c6ef310 files · +328 −101Browse files

Showing the changes to src/exec/debugger.cpp (1 of 10 files). Show all

Unified · Split

src/exec/debugger.cpp+9−4
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#include <vm_tools.h>11#include <vm_tools.h>
12#include <utils.h>12#include <utils.h>
13#include <vm_memory.h>13#include <vm_memory.h>
14#include <vm_asm.h>
14#include "exec.h"15#include "exec.h"
15 16
16using namespace disvm;17using namespace disvm;
@@ -136,8 +137,7 @@ namespace · 119 unmodified lines
136 const auto print_m = print_d || m.middle.mode != address_mode_middle_t::none;137 const auto print_m = print_d || m.middle.mode != address_mode_middle_t::none;
137 const auto print_s = print_m || m.source.mode != address_mode_t::none;138 const auto print_s = print_m || m.source.mode != address_mode_t::none;
138 139
139 // [TODO] Convert the opcode value to a string140 ss << assembly::opcode_to_token(m.opcode);
140 ss << static_cast<uint32_t>(m.opcode);
141 141
142 if (print_s)142 if (print_s)
143 ss << " " << m.source;143 ss << " " << m.source;
@@ -246,15 +246,20 @@ namespace · 102 unmodified lines
246R"(Help:246R"(Help:
247 c C - continue247 c C - continue
248 r R - print registers248 r R - print registers
249 w W - stack walk249 w W - print stack
250 ? - help250 ? - help
251)";251)";
252 252
253 void prompt(const vm_registers_t &r)253 void prompt(const vm_registers_t &r)
254 {254 {
255 std::cout
256 << console_modifiers::green_font
257 << console_modifiers::bold
258 << "'?' for help\n"
259 << console_modifiers::reset_all;
260
255 std::locale loc;261 std::locale loc;
256 std::string cmd;262 std::string cmd;
257
258 for (;;)263 for (;;)
259 {264 {
260 std::cout265 std::cout