2 * Copyright 2012, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
9 #include <ObjectList.h>
10 #include <Referenceable.h>
12 #include "types/Types.h"
15 class Watchpoint
: public BReferenceable
{
17 Watchpoint(target_addr_t address
, uint32 type
,
21 target_addr_t
Address() const { return fAddress
; }
22 uint32
Type() const { return fType
; }
23 int32
Length() const { return fLength
; }
25 bool IsInstalled() const { return fInstalled
; }
26 void SetInstalled(bool installed
);
28 bool IsEnabled() const { return fEnabled
; }
29 void SetEnabled(bool enabled
);
30 // WatchpointManager only
32 bool ShouldBeInstalled() const
33 { return fEnabled
&& !fInstalled
; }
35 bool Contains(target_addr_t address
) const;
37 static int CompareWatchpoints(const Watchpoint
* a
,
39 static int CompareAddressWatchpoint(
40 const target_addr_t
* address
,
41 const Watchpoint
* watchpoint
);
44 target_addr_t fAddress
;
53 typedef BObjectList
<Watchpoint
> WatchpointList
;
56 #endif // WATCHPOINT_H