forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemchecksettings.h
232 lines (209 loc) · 6.82 KB
/
memchecksettings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// Copyright : (C) 2015 Eran Ifrah
// File name : memchecksettings.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
/**
* @file
* @author pavel.iqx
* @date 2014
* @copyright GNU General Public License v2
*/
#ifndef _MEMCHECKSETTINGS_H_
#define _MEMCHECKSETTINGS_H_
#include "cl_config.h"
//////////////////////////////////////////////////////////////
// default settings values
//////////////////////////////////////////////////////////////
#define CONFIG_ITEM_NAME_VALGRIND "Valgrind"
#define VALGRIND_BINARY "/usr/bin/valgrind"
#define VALGRIND_OUTPUT_IN_PRIVATE_FOLDER true
#define VALGRIND_OUTPUT_FILE ""
#define VALGRIND_MANDATORY_OPTIONS "--tool=memcheck --xml=yes --fullpath-after= --gen-suppressions=all"
#define VALGRIND_OUTPUT_FILE_OPTION "--xml-file"
#define VALGRIND_SUPPRESSION_FILE_OPTION "--suppressions"
#define VALGRIND_OPTIONS "--leak-check=yes --track-origins=yes"
#define VALGRIND_SUPP_FILE_IN_PRIVATE_FOLDER true
#define CONFIG_ITEM_NAME_MEMCHECK "MemCheck"
#define RESULT_PAGE_SIZE 50
#define RESULT_PAGE_SIZE_MAX 200
#define OMIT_NONWORKSPACE false
#define OMIT_DUPLICATIONS false
#define OMIT_SUPPRESSED true
#define MEMCHECK_CONFIG_FILE "memcheck.conf"
/////////////////////////////////////////////////////////////////
class ValgrindSettings: public clConfigItem
{
public:
ValgrindSettings();
virtual ~ ValgrindSettings() {
}
virtual void FromJSON(const JSONElement & json);
virtual JSONElement ToJSON() const;
private:
wxString m_binary;
bool m_outputInPrivateFolder;
wxString m_outputFile;
wxString m_mandatoryOptions;
wxString m_outputFileOption;
wxString m_suppressionFileOption;
wxString m_options;
bool m_suppFileInPrivateFolder;
wxArrayString m_suppFiles;
public:
void SetBinary(const wxString & binary) {
m_binary = binary;
}
const wxString & GetBinary() const {
return m_binary;
}
void SetOutputInPrivateFolder(bool outputInPrivateFolder) {
m_outputInPrivateFolder = outputInPrivateFolder;
}
bool GetOutputInPrivateFolder() const {
return m_outputInPrivateFolder;
}
void SetOutputFile(const wxString & outputFile) {
m_outputFile = outputFile;
}
const wxString & GetOutputFile() const {
return m_outputFile;
}
// void SetMandatoryOptions(const wxString & mandatoryOptions) {
// m_mandatoryOptions = mandatoryOptions;
// }
const wxString & GetMandatoryOptions() const {
//return wxString::Format(m_mandatoryOptions, m_outputFile);
return m_mandatoryOptions;
}
void SetOutputFileOption(const wxString& outputFileOption) {
m_outputFileOption = outputFileOption;
}
const wxString& GetOutputFileOption() const {
return m_outputFileOption;
}
void SetSuppressionFileOption(const wxString& suppressionFileOption) {
m_suppressionFileOption = suppressionFileOption;
}
const wxString& GetSuppressionFileOption() const {
return m_suppressionFileOption;
}
void SetOptions(const wxString& options) {
m_options = options;
}
const wxString & GetOptions() const {
return m_options;
}
void SetSuppFileInPrivateFolder(bool suppFileInPrivateFolder) {
m_suppFileInPrivateFolder = suppFileInPrivateFolder;
}
bool GetSuppFileInPrivateFolder() const {
return m_suppFileInPrivateFolder;
}
void SetSuppFiles(const wxArrayString& suppFiles) {
m_suppFiles = suppFiles;
}
const wxArrayString& GetSuppFiles() const {
return m_suppFiles;
}
};
class MemCheckSettings: public clConfigItem
{
public:
MemCheckSettings();
virtual ~ MemCheckSettings() {
}
virtual void FromJSON(const JSONElement & json);
virtual JSONElement ToJSON() const;
private:
wxString m_engine;
wxArrayString m_availableEngines;
size_t m_result_page_size;
size_t m_result_page_size_max;
bool m_omitNonWorkspace;
bool m_omitDuplications;
bool m_omitSuppressed;
/**
* @brief place for particular subsetting nodes
*
* May be remake to list of several processor settings.
*/
ValgrindSettings m_valgrindSettings;
public:
void SetEngine(const wxString & engine) {
m_engine = engine;
}
const wxString & GetEngine() const {
return m_engine;
}
// void SetAvailableEngines(const wxArrayString & availableEngines) {
// m_availableEngines = availableEngines;
// }
const wxArrayString & GetAvailableEngines() const {
return m_availableEngines;
}
void SetResultPageSize(size_t result_page_size) {
m_result_page_size = result_page_size;
}
size_t GetResultPageSize() const {
return m_result_page_size;
}
// void SetResultPageSizeMax(size_t result_page_size_max) {
// m_result_page_size_max = result_page_size_max;
// }
size_t GetResultPageSizeMax() const {
return m_result_page_size_max;
}
void SetOmitNonWorkspace(bool omitNonWorkspace) {
m_omitNonWorkspace = omitNonWorkspace;
}
bool GetOmitNonWorkspace() const {
return m_omitNonWorkspace;
}
void SetOmitDuplications(bool omitDuplications) {
m_omitDuplications = omitDuplications;
}
bool GetOmitDuplications() const {
return m_omitDuplications;
}
void SetOmitSuppressed(bool omitSuppressed) {
m_omitSuppressed = omitSuppressed;
}
bool GetOmitSuppressed() const {
return m_omitSuppressed;
}
/**
* @brief place for particular handlers of subsetting nodes
*/
ValgrindSettings & GetValgrindSettings() {
return m_valgrindSettings;
}
void SavaToConfig() {
clConfig conf(MEMCHECK_CONFIG_FILE);
conf.WriteItem(this);
}
void LoadFromConfig() {
clConfig conf(MEMCHECK_CONFIG_FILE);
conf.ReadItem(this);
}
};
#endif