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
1111 #include <vm_tools.h>
1212 #include <utils.h>
1313 #include <vm_memory.h>
14+#include <vm_asm.h>
1415 #include "exec.h"
1516
1617 using namespace disvm;
@@ -136,8 +137,7 @@ namespace · 119 unmodified lines
136137 const auto print_m = print_d || m.middle.mode != address_mode_middle_t::none;
137138 const auto print_s = print_m || m.source.mode != address_mode_t::none;
138139
139− // [TODO] Convert the opcode value to a string
140− ss << static_cast<uint32_t>(m.opcode);
140+ ss << assembly::opcode_to_token(m.opcode);
141141
142142 if (print_s)
143143 ss << " " << m.source;
@@ -246,15 +246,20 @@ namespace · 102 unmodified lines
246246 R"(Help:
247247 c C - continue
248248 r R - print registers
249− w W - stack walk
249+ w W - print stack
250250 ? - help
251251 )";
252252
253253 void prompt(const vm_registers_t &r)
254254 {
255+ std::cout
256+ << console_modifiers::green_font
257+ << console_modifiers::bold
258+ << "'?' for help\n"
259+ << console_modifiers::reset_all;
260+
255261 std::locale loc;
256262 std::string cmd;
257−
258263 for (;;)
259264 {
260265 std::cout