[hatari-devel] Debugger an 32 bit addresses |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi
Eero, in breakcond.c, I see in BreakCond_CheckAddress() many checks to
validate an address to be used as indirect condition for a cpu breakpoint.
I think we could save the whole job of checking some memory ranges by
letting BreakCond_ReadSTMemory() read any address it's given in the
breakpoint condition, as this will call STMemory_Readxxx() functions and
those functions will handle 24/32 bit mode as well as all memory regions.
So, I think we could remove this :
bit23 = (addr >> 23) & 1;
highbyte = (addr >> 24) & 0xff;
if ((bit23 == 0 && highbyte != 0) ||
(bit23 == 1 && highbyte != 0xff)) {
fprintf(stderr, "WARNING: address 0x%x 23th bit isn't
extended to bits 24-31.\n", addr);
}
/* use a 24-bit address */
addr &= 0x00ffffff;
if ((addr > STRamEnd && addr < 0xe00000) ||
(addr >= 0xff0000 && addr < 0xff8000)) {
EXITFUNC(("-> false (CPU)\n"));
return false;
}
EXITFUNC(("-> true (CPU)\n"));
return true;
and use instead :
if (addr > 0xFFFFFFFF) {
EXITFUNC(("-> false (CPU)\n"));
return false;
}
EXITFUNC(("-> true (CPU)\n"));
return true;
The less we use constant memory regions start/end address in different
places, the easier it will be to maintain.
What do you think ?
Nicolas