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 : debugger(debugger_)
21 , probe(probe_)
22{
23 if (newId != unsigned(-1)) id = newId;
24 setCommand(std::move(command_));
25 setCondition(std::move(condition_));
26 setOnce(once_);
27
28 probe.attach(*this);
29}
30
32{
33 probe.detach(*this);
34}
35
36void ProbeBreakPoint::update(const ProbeBase& /*subject*/) noexcept
37{
38 auto& motherBoard = debugger.getMotherBoard();
39 auto scopedBlock = motherBoard.getStateChangeDistributor().tempBlockNewEventsDuringReplay();
40 auto& reactor = motherBoard.getReactor();
41 auto& cliComm = reactor.getGlobalCliComm();
42 auto& interp = reactor.getInterpreter();
43 bool remove = checkAndExecute(cliComm, interp);
44 if (remove) {
45 debugger.removeProbeBreakPoint(*this);
46 }
47}
48
49void ProbeBreakPoint::subjectDeleted(const ProbeBase& /*subject*/)
50{
51 debugger.removeProbeBreakPoint(*this);
52}
53
54} // namespace openmsx
void setOnce(Interpreter &interp, const TclObject &o)
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