vfs: check userland buffers before reading them.
[haiku.git] / headers / private / debugger / model / Watchpoint.h
blobfa1ac20f19252df70be4ddc8e85f255836b35618
1 /*
2 * Copyright 2012, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef WATCHPOINT_H
6 #define WATCHPOINT_H
9 #include <ObjectList.h>
10 #include <Referenceable.h>
12 #include "types/Types.h"
15 class Watchpoint : public BReferenceable {
16 public:
17 Watchpoint(target_addr_t address, uint32 type,
18 int32 length);
19 ~Watchpoint();
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,
38 const Watchpoint* b);
39 static int CompareAddressWatchpoint(
40 const target_addr_t* address,
41 const Watchpoint* watchpoint);
43 private:
44 target_addr_t fAddress;
45 uint32 fType;
46 int32 fLength;
48 bool fInstalled;
49 bool fEnabled;
53 typedef BObjectList<Watchpoint> WatchpointList;
56 #endif // WATCHPOINT_H