2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
8 #include "UserBreakpoint.h"
14 class BreakpointClient
{
16 virtual ~BreakpointClient();
20 class Breakpoint
: public BReferenceable
{
22 Breakpoint(Image
* image
, target_addr_t address
);
25 Image
* GetImage() const { return fImage
; }
26 target_addr_t
Address() const { return fAddress
; }
28 bool IsInstalled() const { return fInstalled
; }
29 void SetInstalled(bool installed
);
31 bool ShouldBeInstalled() const;
32 bool IsUnused() const;
33 bool HasEnabledUserBreakpoint() const;
35 UserBreakpointInstance
* FirstUserBreakpoint() const
36 { return fUserBreakpoints
.Head(); }
37 UserBreakpointInstance
* LastUserBreakpoint() const
38 { return fUserBreakpoints
.Tail(); }
39 const UserBreakpointInstanceList
& UserBreakpoints() const
40 { return fUserBreakpoints
; }
42 void AddUserBreakpoint(
43 UserBreakpointInstance
* instance
);
44 void RemoveUserBreakpoint(
45 UserBreakpointInstance
* instance
);
47 bool AddClient(BreakpointClient
* client
);
48 void RemoveClient(BreakpointClient
* client
);
50 static int CompareBreakpoints(const Breakpoint
* a
,
52 static int CompareAddressBreakpoint(
53 const target_addr_t
* address
,
54 const Breakpoint
* breakpoint
);
57 typedef BObjectList
<BreakpointClient
> ClientList
;
60 target_addr_t fAddress
;
62 UserBreakpointInstanceList fUserBreakpoints
;
68 #endif // BREAKPOINT_H