comparison m68k_core.c @ 2423:b733a10488c6

Fix off-by-one in watchpoint eval
author Michael Pavone <pavone@retrodev.com>
date Sat, 20 Jan 2024 21:16:04 -0800
parents c97609fe8315
children 767ec72acca7
comparison
equal deleted inserted replaced
2422:1978bd770023 2423:b733a10488c6
837 837
838 static m68k_watchpoint *m68k_find_watchpoint(uint32_t address, m68k_context *context) 838 static m68k_watchpoint *m68k_find_watchpoint(uint32_t address, m68k_context *context)
839 { 839 {
840 for (uint32_t i = 0; i < context->num_watchpoints; i++) 840 for (uint32_t i = 0; i < context->num_watchpoints; i++)
841 { 841 {
842 if (address >= context->watchpoints[i].start && address < context->watchpoints[i].end) { 842 if (address >= context->watchpoints[i].start && address <= context->watchpoints[i].end) {
843 return context->watchpoints + i; 843 return context->watchpoints + i;
844 } 844 }
845 } 845 }
846 return NULL; 846 return NULL;
847 } 847 }