2 * Copyright 2012, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
6 #include "Watchpoint.h"
9 Watchpoint::Watchpoint(target_addr_t address
, uint32 type
, int32 length
)
20 Watchpoint::~Watchpoint()
26 Watchpoint::SetInstalled(bool installed
)
28 fInstalled
= installed
;
33 Watchpoint::SetEnabled(bool enabled
)
40 Watchpoint::Contains(target_addr_t address
) const
42 return address
>= fAddress
&& address
<= (fAddress
+ fLength
);
47 Watchpoint::CompareWatchpoints(const Watchpoint
* a
, const Watchpoint
* b
)
49 if (a
->Address() < b
->Address())
51 return a
->Address() == b
->Address() ? 0 : 1;
56 Watchpoint::CompareAddressWatchpoint(const target_addr_t
* address
,
57 const Watchpoint
* watchpoint
)
59 if (*address
< watchpoint
->Address())
61 return *address
== watchpoint
->Address() ? 0 : 1;