Fix debugger start parameters:

* Pass parameters from DispatchResult to debugger
    * Fix default trap type (= read)
    * Remove fallout from branch merge
This commit is contained in:
Christian Speckner 2018-08-06 09:28:56 +02:00
parent 97f761963f
commit 1442876ffa
4 changed files with 6 additions and 23 deletions

View File

@ -43,7 +43,7 @@ class DispatchResult
void setOk(uInt64 cycles);
void setDebugger(uInt64 cycles, const string& message = "", int address = -1, bool wasReadTrap = false);
void setDebugger(uInt64 cycles, const string& message = "", int address = -1, bool wasReadTrap = true);
void setFatal(uInt64 cycles);

View File

@ -238,21 +238,6 @@ bool M6502::execute(uInt64 number)
return result.isSuccess();
}
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 void M6502::_execute(uInt64 cycles, DispatchResult& result)
{

View File

@ -333,12 +333,6 @@ class M6502 : public Serializable
void updateStepStateByInstruction();
#endif // DEBUGGER_SUPPORT
/**
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

View File

@ -685,7 +685,11 @@ double OSystem::dispatchEmulation(EmulationWorker& emulationWorker)
#ifdef DEBUGGER_SUPPORT
// Break or trap? -> start debugger
if (dispatchResult.getStatus() == DispatchResult::Status::debugger) myDebugger->start();
if (dispatchResult.getStatus() == DispatchResult::Status::debugger) myDebugger->start(
dispatchResult.getMessage(),
dispatchResult.getAddress(),
dispatchResult.wasReadTrap()
);
#endif
// Handle frying