Skip to content

Commit c3005ce

Browse files
joevtdingusdev
authored andcommitted
debugger: Catch memory errors while disassembling.
1 parent cf0d78f commit c3005ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

debugger/debugger.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ static uint32_t disasm_68k(uint32_t count, uint32_t address) {
133133
for (; power_on && count > 0; count--) {
134134
// prefetch opcode bytes (a 68k instruction can occupy 2...12 bytes)
135135
for (int i = 0; i < sizeof(code); i++) {
136-
code[i] = mem_read_dbg(address + i, 1);
136+
try {
137+
code[i] = mem_read_dbg(address + i, 1);
138+
}
139+
catch(...) {
140+
printf("<memerror>");
141+
}
137142
}
138143

139144
const uint8_t *code_ptr = code;

0 commit comments

Comments
 (0)