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
18class BMessage;
19class FunctionID;
20class UserBreakpointLocation;
21
22
23class BreakpointSetting {
24public:
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
51private:
52			void				_Unset();
53
54private:
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