openMSX
ProbeBreakPoint.cc
Go to the documentation of this file.
1 #include "ProbeBreakPoint.hh"
2 #include "Probe.hh"
3 #include "Debugger.hh"
4 #include "MSXMotherBoard.hh"
5 #include "Reactor.hh"
6 #include "TclObject.hh"
7 
8 namespace openmsx {
9 
10 unsigned ProbeBreakPoint::lastId = 0;
11 
13  TclObject command,
14  TclObject condition,
15  Debugger& debugger_,
16  ProbeBase& probe_,
17  unsigned newId /*= -1*/)
18  : BreakPointBase(command, condition)
19  , debugger(debugger_)
20  , probe(probe_)
21  , id((newId == unsigned(-1)) ? ++lastId : newId)
22 {
23  probe.attach(*this);
24 }
25 
27 {
28  probe.detach(*this);
29 }
30 
31 void ProbeBreakPoint::update(const ProbeBase& /*subject*/)
32 {
33  auto& reactor = debugger.getMotherBoard().getReactor();
34  auto& cliComm = reactor.getGlobalCliComm();
35  auto& interp = reactor.getInterpreter();
36  checkAndExecute(cliComm, interp);
37 }
38 
39 void ProbeBreakPoint::subjectDeleted(const ProbeBase& /*subject*/)
40 {
41  debugger.removeProbeBreakPoint(*this);
42 }
43 
44 } // namespace openmsx
MSXMotherBoard & getMotherBoard()
Definition: Debugger.hh:42
void removeProbeBreakPoint(ProbeBreakPoint &bp)
Definition: Debugger.cc:142
void attach(Observer< T > &observer)
Definition: Subject.hh:52
Base class for CPU break and watch points.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void checkAndExecute(GlobalCliComm &cliComm, Interpreter &interp)
GlobalCliComm & getGlobalCliComm()
Definition: Reactor.hh:79
ProbeBreakPoint(TclObject command, TclObject condition, Debugger &debugger, ProbeBase &probe, unsigned newId=-1)
void detach(Observer< T > &observer)
Definition: Subject.hh:58