Opcode accesses are now marked debugger_access. This is important with the recent

changes to automatically call the read handler if the opcode base cannot be
found.

Changed logging for non-RAM opcode bases so that it does not output in the case
of debugger_access being set.

Fixed logic for deriving direct ranges so that it uses the non-watchpoint-
infected tables for its lookups.
This commit is contained in:
Aaron Giles 2009-01-30 18:11:46 +00:00
parent af29135b58
commit cc14b2aaa7
2 changed files with 18 additions and 3 deletions

View File

@ -1736,6 +1736,7 @@ void debug_write_qword(const address_space *space, offs_t address, UINT64 data,
UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, int arg)
{
UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2;
debugcpu_private *global = space->machine->debugcpu_data;
cpu_debug_data *info = cpu_get_debug_data(space->cpu);
/* keep in logical range */
@ -1745,8 +1746,14 @@ UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, i
if (info->readop != NULL)
{
UINT64 result;
/* return early if we got the result directly */
memory_set_debugger_access(space, global->debugger_access = TRUE);
if ((*info->readop)(space->cpu, address, size, &result))
{
memory_set_debugger_access(space, global->debugger_access = FALSE);
return result;
}
}
/* if we're bigger than the address bus, break into smaller pieces */
@ -1820,6 +1827,10 @@ UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, i
fatalerror("debug_read_opcode: unknown type = %d", space->dbits / 8 * 10 + size);
break;
}
/* turn on debugger access */
if (!global->debugger_access)
memory_set_debugger_access(space, global->debugger_access = TRUE);
/* switch off the size and handle unaligned accesses */
switch (size)
@ -1866,6 +1877,9 @@ UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, i
}
break;
}
/* no longer accessing via the debugger */
memory_set_debugger_access(space, global->debugger_access = FALSE);
return result;
}

View File

@ -909,7 +909,8 @@ int memory_set_direct_region(const address_space *space, offs_t byteaddress)
/* ensure future updates to land here as well until we get back into a bank */
spacerw->direct.byteend = 0;
spacerw->direct.bytestart = 1;
logerror("CPU '%s': warning - attempt to direct-map address %08X in %s space\n", space->cpu->tag, byteaddress, space->name);
if (!spacerw->debugger_access)
logerror("CPU '%s': warning - attempt to direct-map address %08X in %s space\n", space->cpu->tag, byteaddress, space->name);
return FALSE;
}
@ -2967,9 +2968,9 @@ static direct_range *direct_range_find(address_space *space, offs_t byteaddress,
/* determine which entry */
byteaddress &= space->bytemask;
*entry = space->readlookup[LEVEL1_INDEX(byteaddress)];
*entry = space->read.table[LEVEL1_INDEX(byteaddress)];
if (*entry >= SUBTABLE_BASE)
*entry = space->readlookup[LEVEL2_INDEX(*entry, byteaddress)];
*entry = space->read.table[LEVEL2_INDEX(*entry, byteaddress)];
rangelistptr = &space->direct.rangelist[*entry];
/* scan our table */