Fixed 'dirty page' support in debugger

This commit is contained in:
Stanislav Shwartsman 2008-07-26 14:44:26 +00:00
parent 9a90d20f59
commit f303d61cc1
3 changed files with 9 additions and 16 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: icache.h,v 1.37 2008-07-13 13:24:36 sshwarts Exp $
// $Id: icache.h,v 1.38 2008-07-26 14:44:26 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007 Stanislav Shwartsman
@ -73,11 +73,13 @@ public:
{
pAddr >>= 12;
#if BX_SUPPORT_TRACE_CACHE
if ((pageWriteStampTable[pAddr] & ICacheWriteStampFetchModeMask) != ICacheWriteStampFetchModeMask) {
// Decrement page write stamp, so iCache entries with older stamps are
// effectively invalidated.
if ((pageWriteStampTable[pAddr] & ICacheWriteStampFetchModeMask) != ICacheWriteStampFetchModeMask)
{
handleSMC(); // one of the CPUs might be running trace from this page
}
#endif
#if BX_DEBUGGER
BX_DBG_DIRTY_PAGE(pAddr);
#endif
// Decrement page write stamp, so iCache entries with older stamps are
// effectively invalidated.

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: memory.cc,v 1.69 2008-05-31 20:59:38 sshwarts Exp $
// $Id: memory.cc,v 1.70 2008-07-26 14:44:26 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -105,22 +105,18 @@ mem_write:
{
if (len == 8) {
WriteHostQWordToLittleEndian(BX_MEM_THIS get_vector(a20addr), *(Bit64u*)data);
BX_DBG_DIRTY_PAGE(a20addr >> 12);
return;
}
if (len == 4) {
WriteHostDWordToLittleEndian(BX_MEM_THIS get_vector(a20addr), *(Bit32u*)data);
BX_DBG_DIRTY_PAGE(a20addr >> 12);
return;
}
if (len == 2) {
WriteHostWordToLittleEndian(BX_MEM_THIS get_vector(a20addr), *(Bit16u*)data);
BX_DBG_DIRTY_PAGE(a20addr >> 12);
return;
}
if (len == 1) {
* (BX_MEM_THIS get_vector(a20addr)) = * (Bit8u *) data;
BX_DBG_DIRTY_PAGE(a20addr >> 12);
return;
}
// len == other, just fall thru to special cases handling
@ -137,7 +133,6 @@ mem_write:
while(1) {
// addr *not* in range 000A0000 .. 000FFFFF
*(BX_MEM_THIS get_vector(a20addr)) = *data_ptr;
BX_DBG_DIRTY_PAGE(a20addr >> 12);
if (len == 1) return;
len--;
a20addr++;
@ -158,7 +153,6 @@ mem_write:
// devices are not allowed to access SMMRAM under VGA memory
if (cpu) {
*(BX_MEM_THIS get_vector(a20addr)) = *data_ptr;
BX_DBG_DIRTY_PAGE(a20addr >> 12);
}
goto inc_one;
}
@ -175,7 +169,6 @@ mem_write:
case 0x1: // Writes to ShadowRAM
BX_DEBUG(("Writing to ShadowRAM: address 0x" FMT_PHY_ADDRX ", data %02x", a20addr, *data_ptr));
*(BX_MEM_THIS get_vector(a20addr)) = *data_ptr;
BX_DBG_DIRTY_PAGE(a20addr >> 12);
break;
case 0x0: // Writes to ROM, Inhibit

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: memory.h,v 1.51 2008-05-01 20:28:36 sshwarts Exp $
// $Id: memory.h,v 1.52 2008-07-26 14:44:26 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -159,9 +159,7 @@ BX_CPP_INLINE Bit32u BX_MEM_C::get_num_allocated_pages(void)
}
#if BX_DEBUGGER
# define BX_DBG_DIRTY_PAGE(page) BX_MEM(0)->dbg_dirty_pages[page] = 1;
#else
# define BX_DBG_DIRTY_PAGE(page)
#define BX_DBG_DIRTY_PAGE(page) BX_MEM(0)->dbg_dirty_pages[page] = 1;
#endif
#endif