openMSX
cpu
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
:
16
enum class
Type
{
READ_IO
,
WRITE_IO
,
READ_MEM
,
WRITE_MEM
};
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
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
BreakPointBase.hh
openmsx::BreakPointBase
Base class for CPU break and watch points.
Definition
BreakPointBase.hh:15
openmsx::TclObject
Definition
TclObject.hh:29
openmsx::WatchPoint
Base class for CPU breakpoints.
Definition
WatchPoint.hh:14
openmsx::WatchPoint::WatchPoint
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
openmsx::WatchPoint::getType
Type getType() const
Definition
WatchPoint.hh:33
openmsx::WatchPoint::getEndAddress
unsigned getEndAddress() const
Definition
WatchPoint.hh:35
openmsx::WatchPoint::~WatchPoint
virtual ~WatchPoint()=default
openmsx::WatchPoint::getBeginAddress
unsigned getBeginAddress() const
Definition
WatchPoint.hh:34
openmsx::WatchPoint::Type
Type
Definition
WatchPoint.hh:16
openmsx::WatchPoint::Type::READ_MEM
@ READ_MEM
openmsx::WatchPoint::Type::WRITE_IO
@ WRITE_IO
openmsx::WatchPoint::Type::WRITE_MEM
@ WRITE_MEM
openmsx::WatchPoint::Type::READ_IO
@ READ_IO
openmsx::WatchPoint::getId
unsigned getId() const
Definition
WatchPoint.hh:32
openmsx
This file implemented 3 utility functions:
Definition
Autofire.cc:11
std
STL namespace.
Generated on Sun Dec 1 2024 22:13:41 for openMSX by
1.9.8