openMSX
ProbeBreakPoint.cc
Go to the documentation of this file.
1#include "ProbeBreakPoint.hh"
2
3#include "Debugger.hh"
4#include "Probe.hh"
5
6#include "MSXMotherBoard.hh"
7#include "Reactor.hh"
9#include "TclObject.hh"
10
11namespace openmsx {
12
14 TclObject command_,
15 TclObject condition_,
16 Debugger& debugger_,
17 ProbeBase& probe_,
18 bool once_,
19 unsigned newId /*= -1*/)
20 : BreakPointBase(std::move(command_), std::move(condition_), once_)
21 , debugger(debugger_)
22 , probe(probe_)
23 , id((newId == unsigned(-1)) ? ++lastId : newId)
24{
25 probe.attach(*this);
26}
27
29{
30 probe.detach(*this);
31}
32
33void ProbeBreakPoint::update(const ProbeBase& /*subject*/) noexcept
34{
35 auto& motherBoard = debugger.getMotherBoard();
36 auto scopedBlock = motherBoard.getStateChangeDistributor().tempBlockNewEventsDuringReplay();
37 auto& reactor = motherBoard.getReactor();
38 auto& cliComm = reactor.getGlobalCliComm();
39 auto& interp = reactor.getInterpreter();
40 bool remove = checkAndExecute(cliComm, interp);
41 if (remove) {
42 debugger.removeProbeBreakPoint(*this);
43 }
44}
45
46void ProbeBreakPoint::subjectDeleted(const ProbeBase& /*subject*/)
47{
48 debugger.removeProbeBreakPoint(*this);
49}
50
51} // namespace openmsx
uintptr_t id
Base class for CPU break and watch points.
void removeProbeBreakPoint(ProbeBreakPoint &bp)
Definition Debugger.cc:149
ProbeBreakPoint(TclObject command, TclObject condition, Debugger &debugger, ProbeBase &probe, bool once, unsigned newId=-1)
void detach(Observer< T > &observer)
Definition Subject.hh:60
void attach(Observer< T > &observer)
Definition Subject.hh:54
This file implemented 3 utility functions:
Definition Autofire.cc:11
STL namespace.