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;
|
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)
|
inline bool M6502::_execute(uInt32 number)
|
||||||
{
|
{
|
||||||
|
@ -258,23 +273,19 @@ inline bool M6502::_execute(uInt32 number)
|
||||||
{
|
{
|
||||||
bool read = myJustHitReadTrapFlag;
|
bool read = myJustHitReadTrapFlag;
|
||||||
myJustHitReadTrapFlag = myJustHitWriteTrapFlag = false;
|
myJustHitReadTrapFlag = myJustHitWriteTrapFlag = false;
|
||||||
if(myDebugger && myDebugger->start(myHitTrapInfo.message, myHitTrapInfo.address, read))
|
|
||||||
{
|
if (startDebugger(myHitTrapInfo.message, myHitTrapInfo.address, read)) return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myBreakPoints.isInitialized() && myBreakPoints.isSet(PC))
|
if(myBreakPoints.isInitialized() && myBreakPoints.isSet(PC) && startDebugger("BP: ", PC))
|
||||||
if(myDebugger && myDebugger->start("BP: ", PC))
|
return true;
|
||||||
return true;
|
|
||||||
|
|
||||||
int cond = evalCondBreaks();
|
int cond = evalCondBreaks();
|
||||||
if(cond > -1)
|
if(cond > -1)
|
||||||
{
|
{
|
||||||
stringstream msg;
|
stringstream msg;
|
||||||
msg << "CBP[" << Common::Base::HEX2 << cond << "]: " << myCondBreakNames[cond];
|
msg << "CBP[" << Common::Base::HEX2 << cond << "]: " << myCondBreakNames[cond];
|
||||||
if(myDebugger && myDebugger->start(msg.str()))
|
if (startDebugger(msg.str())) return true;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cond = evalCondSaveStates();
|
cond = evalCondSaveStates();
|
||||||
|
|
|
@ -326,6 +326,12 @@ class M6502 : public Serializable
|
||||||
*/
|
*/
|
||||||
bool _execute(uInt32 number);
|
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:
|
private:
|
||||||
/**
|
/**
|
||||||
Bit fields used to indicate that certain conditions need to be
|
Bit fields used to indicate that certain conditions need to be
|
||||||
|
|
Loading…
Reference in New Issue