Showing the changes to src/exec/debugger.cpp (1 of 10 files). Show all
Unified · Split
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <vm_tools.h> |
| 12 | 12 | #include <utils.h> |
| 13 | 13 | #include <vm_memory.h> |
| 14 | +#include <vm_asm.h> | |
| 14 | 15 | #include "exec.h" |
| 15 | 16 | |
| 16 | 17 | using namespace disvm; |
| @@ -136,8 +137,7 @@ namespace · 119 unmodified lines | ||
| 136 | 137 | const auto print_m = print_d || m.middle.mode != address_mode_middle_t::none; |
| 137 | 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 << static_cast<uint32_t>(m.opcode); | |
| 140 | + ss << assembly::opcode_to_token(m.opcode); | |
| 141 | 141 | |
| 142 | 142 | if (print_s) |
| 143 | 143 | ss << " " << m.source; |
| @@ -246,15 +246,20 @@ namespace · 102 unmodified lines | ||
| 246 | 246 | R"(Help: |
| 247 | 247 | c C - continue |
| 248 | 248 | r R - print registers |
| 249 | − w W - stack walk | |
| 249 | + w W - print stack | |
| 250 | 250 | ? - help |
| 251 | 251 | )"; |
| 252 | 252 | |
| 253 | 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 | 261 | std::locale loc; |
| 256 | 262 | std::string cmd; |
| 257 | − | |
| 258 | 263 | for (;;) |
| 259 | 264 | { |
| 260 | 265 | std::cout |