Showing the changes to src/exec/debugger.cpp (1 of 10 files). Show all
Unified · Split
| @@ -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 | ||
| 16 | using namespace disvm; | 17 | using 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 string | 140 | 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 | |||
| 246 | R"(Help: | 246 | R"(Help: |
| 247 | c C - continue | 247 | c C - continue |
| 248 | r R - print registers | 248 | r R - print registers |
| 249 | w W - stack walk | 249 | w W - print stack |
| 250 | ? - help | 250 | ? - 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::cout | 265 | std::cout |