openMSX
WatchPoint.hh
Go to the documentation of this file.
1 #ifndef WATCHPOINT_HH
2 #define WATCHPOINT_HH
3 
4 #include "BreakPointBase.hh"
5 #include <cassert>
6 
7 namespace openmsx {
8 
13 class WatchPoint : public BreakPointBase
14 {
15 public:
17 
20  WatchPoint(TclObject command_, TclObject condition_,
21  Type type_, unsigned beginAddr_, unsigned endAddr_,
22  bool once_, unsigned newId = -1)
23  : BreakPointBase(command_, condition_, once_)
24  , id((newId == unsigned(-1)) ? ++lastId : newId)
25  , beginAddr(beginAddr_), endAddr(endAddr_), type(type_)
26  {
27  assert(beginAddr <= endAddr);
28  }
29 
30  virtual ~WatchPoint() = default; // needed for dynamic_cast
31 
32  unsigned getId() const { return id; }
33  Type getType() const { return type; }
34  unsigned getBeginAddress() const { return beginAddr; }
35  unsigned getEndAddress() const { return endAddr; }
36 
37 private:
38  unsigned id;
39  unsigned beginAddr;
40  unsigned endAddr;
41  Type type;
42 
43  static inline unsigned lastId = 0;
44 };
45 
46 } // namespace openmsx
47 
48 #endif
Type getType() const
Definition: WatchPoint.hh:33
unsigned getEndAddress() const
Definition: WatchPoint.hh:35
WatchPoint(TclObject command_, TclObject condition_, Type type_, unsigned beginAddr_, unsigned endAddr_, bool once_, unsigned newId=-1)
Begin and end address are inclusive (IOW range = [begin, end])
Definition: WatchPoint.hh:20
unsigned getId() const
Definition: WatchPoint.hh:32
Base class for CPU breakpoints.
Definition: WatchPoint.hh:13
Base class for CPU break and watch points.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
virtual ~WatchPoint()=default
unsigned getBeginAddress() const
Definition: WatchPoint.hh:34