| 89 | } |
| 90 | |
| 91 | static int disasmFetch(struct zdis_ctx *ctx, uint32_t addr) { |
| 92 | char tmp[3]; |
| 93 | uint8_t value = mem_peek_byte(addr), data; |
| 94 | (void)ctx; |
| 95 | if ((data = debug.addr[addr])) { |
| 96 | disasm.highlight.watchR |= data & DBG_MASK_READ ? true : false; |
| 97 | disasm.highlight.watchW |= data & DBG_MASK_WRITE ? true : false; |
| 98 | disasm.highlight.breakP |= data & DBG_MASK_EXEC ? true : false; |
| 99 | if (data & DBG_INST_START_MARKER && disasm.highlight.addr < 0) { |
| 100 | disasm.highlight.addr = static_cast<int32_t>(addr); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | if (cpu.registers.PC == addr) { |
| 105 | disasm.highlight.pc = true; |
| 106 | } |
| 107 | |
| 108 | if (disasm.bytes) { |
| 109 | snprintf(tmp, 3, "%02X", value); |
| 110 | uint8_t offset = (addr - disasm.ctx.zdis_start_addr) * 2; |
| 111 | if (offset + 2 > disasm.instr.data.size()) { |
| 112 | disasm.instr.data.resize(offset + 2, '0'); |
| 113 | } |
| 114 | memcpy(&disasm.instr.data[offset], tmp, 2); |
| 115 | } |
| 116 | |
| 117 | return value; |
| 118 | } |
| 119 | |
| 120 | static bool disasmPut(struct zdis_ctx *ctx, enum zdis_put kind, int32_t val, bool il) { |
| 121 | char tmp[11], sign = '+'; |
nothing calls this directly
no test coverage detected