mirror of https://github.com/stella-emu/stella.git
Make sure that the hardware state is up to date before entering the debugger.
This commit is contained in:
parent
36997d4d7a
commit
d8178f546b
|
@ -237,6 +237,21 @@ bool M6502::execute(uInt32 number)
|
|||
return status;
|
||||
}
|
||||
|
||||
bool M6502::startDebugger(const string& message, int address, bool read) {
|
||||
handleHalt();
|
||||
|
||||
mySystem->tia().updateEmulation();
|
||||
mySystem->m6532().updateEmulation();
|
||||
|
||||
#ifndef DEBUGGER_SUPPORT
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!myDebugger) return false;
|
||||
|
||||
return myDebugger->start(message, address, read);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
inline bool M6502::_execute(uInt32 number)
|
||||
{
|
||||
|
@ -258,14 +273,11 @@ inline bool M6502::_execute(uInt32 number)
|
|||
{
|
||||
bool read = myJustHitReadTrapFlag;
|
||||
myJustHitReadTrapFlag = myJustHitWriteTrapFlag = false;
|
||||
if(myDebugger && myDebugger->start(myHitTrapInfo.message, myHitTrapInfo.address, read))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (startDebugger(myHitTrapInfo.message, myHitTrapInfo.address, read)) return true;
|
||||
}
|
||||
|
||||
if(myBreakPoints.isInitialized() && myBreakPoints.isSet(PC))
|
||||
if(myDebugger && myDebugger->start("BP: ", PC))
|
||||
if(myBreakPoints.isInitialized() && myBreakPoints.isSet(PC) && startDebugger("BP: ", PC))
|
||||
return true;
|
||||
|
||||
int cond = evalCondBreaks();
|
||||
|
@ -273,8 +285,7 @@ inline bool M6502::_execute(uInt32 number)
|
|||
{
|
||||
stringstream msg;
|
||||
msg << "CBP[" << Common::Base::HEX2 << cond << "]: " << myCondBreakNames[cond];
|
||||
if(myDebugger && myDebugger->start(msg.str()))
|
||||
return true;
|
||||
if (startDebugger(msg.str())) return true;
|
||||
}
|
||||
|
||||
cond = evalCondSaveStates();
|
||||
|
|
|
@ -326,6 +326,12 @@ class M6502 : public Serializable
|
|||
*/
|
||||
bool _execute(uInt32 number);
|
||||
|
||||
/**
|
||||
Make sure that the current hardware state is up to date (TIA & RIOT) and dispatch
|
||||
debugger.
|
||||
*/
|
||||
bool startDebugger(const string& message = "", int address = -1, bool read = true);
|
||||
|
||||
private:
|
||||
/**
|
||||
Bit fields used to indicate that certain conditions need to be
|
||||
|
|
Loading…
Reference in New Issue