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
7namespace openmsx {
8
14{
15public:
16 enum Type { READ_IO = 0, WRITE_IO = 1, READ_MEM = 2, WRITE_MEM = 3 };
17
20 WatchPoint(TclObject command_, TclObject condition_,
21 Type type_, unsigned beginAddr_, unsigned endAddr_,
22 bool once_, unsigned newId = -1)
23 : BreakPointBase(std::move(command_), std::move(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 [[nodiscard]] unsigned getId() const { return id; }
33 [[nodiscard]] Type getType() const { return type; }
34 [[nodiscard]] unsigned getBeginAddress() const { return beginAddr; }
35 [[nodiscard]] unsigned getEndAddress() const { return endAddr; }
36
37private:
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
Base class for CPU break and watch points.
Base class for CPU breakpoints.
Definition WatchPoint.hh:14
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
Type getType() const
Definition WatchPoint.hh:33
unsigned getEndAddress() const
Definition WatchPoint.hh:35
virtual ~WatchPoint()=default
unsigned getBeginAddress() const
Definition WatchPoint.hh:34
unsigned getId() const
Definition WatchPoint.hh:32
This file implemented 3 utility functions:
Definition Autofire.cc:9
STL namespace.