xref: /haiku/src/kits/debugger/settings/BreakpointSetting.h (revision 21258e2674226d6aa732321b6f8494841895af5f)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Copyright 2013-2014, Rene Gollent, rene@gollent.com.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef BREAKPOINT_SETTING_H
7 #define BREAKPOINT_SETTING_H
8 
9 
10 #include <String.h>
11 
12 #include <ObjectList.h>
13 
14 #include "SourceLocation.h"
15 #include "Types.h"
16 
17 
18 class BMessage;
19 class FunctionID;
20 class UserBreakpointLocation;
21 
22 
23 class BreakpointSetting {
24 public:
25 								BreakpointSetting();
26 								BreakpointSetting(
27 									const BreakpointSetting& other);
28 								~BreakpointSetting();
29 
30 			status_t			SetTo(const UserBreakpointLocation& location,
31 									bool enabled, bool hidden,
32 									const BString& conditionExpression);
33 			status_t			SetTo(const BMessage& archive);
34 			status_t			WriteTo(BMessage& archive) const;
35 
36 			FunctionID*			GetFunctionID() const	{ return fFunctionID; }
37 			const BString&		SourceFile() const		{ return fSourceFile; }
38 			SourceLocation		GetSourceLocation() const
39 									{ return fSourceLocation; }
40 			target_addr_t		RelativeAddress() const
41 									{ return fRelativeAddress; }
42 
43 			bool				IsEnabled() const	{ return fEnabled; }
44 			bool				IsHidden() const	{ return fHidden; }
45 
46 			const BString&		Condition() const
47 									{ return fConditionExpression; }
48 
49 			BreakpointSetting&	operator=(const BreakpointSetting& other);
50 
51 private:
52 			void				_Unset();
53 
54 private:
55 			FunctionID*			fFunctionID;
56 			BString				fSourceFile;
57 			SourceLocation		fSourceLocation;
58 			target_addr_t		fRelativeAddress;
59 			bool				fEnabled;
60 			bool				fHidden;
61 			BString				fConditionExpression;
62 };
63 
64 
65 #endif	// BREAKPOINT_SETTING_H
66