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
8namespace openmsx {
9
11 TclObject command_,
12 TclObject condition_,
13 Debugger& debugger_,
14 ProbeBase& probe_,
15 bool once_,
16 unsigned newId /*= -1*/)
17 : BreakPointBase(std::move(command_), std::move(condition_), once_)
18 , debugger(debugger_)
19 , probe(probe_)
20 , id((newId == unsigned(-1)) ? ++lastId : newId)
21{
22 probe.attach(*this);
23}
24
26{
27 probe.detach(*this);
28}
29
30void ProbeBreakPoint::update(const ProbeBase& /*subject*/) noexcept
31{
32 auto& reactor = debugger.getMotherBoard().getReactor();
33 auto& cliComm = reactor.getGlobalCliComm();
34 auto& interp = reactor.getInterpreter();
35 bool remove = checkAndExecute(cliComm, interp);
36 if (remove) {
37 debugger.removeProbeBreakPoint(*this);
38 }
39}
40
41void ProbeBreakPoint::subjectDeleted(const ProbeBase& /*subject*/)
42{
43 debugger.removeProbeBreakPoint(*this);
44}
45
46} // namespace openmsx
uintptr_t id
Definition: Interpreter.cc:26
Base class for CPU break and watch points.
void removeProbeBreakPoint(ProbeBreakPoint &bp)
Definition: Debugger.cc:141
ProbeBreakPoint(TclObject command, TclObject condition, Debugger &debugger, ProbeBase &probe, bool once, unsigned newId=-1)
void detach(Observer< T > &observer)
Definition: Subject.hh:56
void attach(Observer< T > &observer)
Definition: Subject.hh:50
This file implemented 3 utility functions:
Definition: Autofire.cc:9
auto remove(ForwardRange &&range, const T &value)
Definition: ranges.hh:232
STL namespace.