Lines Matching refs:option
143 bool Config::ParseValue(const std::string& option, const std::string& value, size_t min_value, in ParseValue() argument
152 error_log("%s: bad value for option '%s': %s", getprogname(), option.c_str(), strerror(errno)); in ParseValue()
156 error_log("%s: bad value for option '%s'", getprogname(), option.c_str()); in ParseValue()
161 option.c_str(), end); in ParseValue()
166 option.c_str(), long_value); in ParseValue()
172 option.c_str(), min_value, long_value); in ParseValue()
177 option.c_str(), max_value, long_value); in ParseValue()
184 bool Config::ParseValue(const std::string& option, const std::string& value, size_t default_value, in ParseValue() argument
190 return ParseValue(option, value, min_value, max_value, new_value); in ParseValue()
193 bool Config::SetGuard(const std::string& option, const std::string& value) { in SetGuard() argument
201 if (!ParseValue(option, value, 1, MAX_GUARD_BYTES, &rear_guard_bytes_)) { in SetGuard()
211 bool Config::SetFrontGuard(const std::string& option, const std::string& value) { in SetFrontGuard() argument
212 if (!ParseValue(option, value, DEFAULT_GUARD_BYTES, 1, MAX_GUARD_BYTES, &front_guard_bytes_)) { in SetFrontGuard()
221 bool Config::SetRearGuard(const std::string& option, const std::string& value) { in SetRearGuard() argument
222 return ParseValue(option, value, DEFAULT_GUARD_BYTES, 1, MAX_GUARD_BYTES, &rear_guard_bytes_); in SetRearGuard()
225 bool Config::SetFill(const std::string& option, const std::string& value) { in SetFill() argument
233 if (!ParseValue(option, value, 1, SIZE_MAX, &fill_on_alloc_bytes_)) { in SetFill()
240 bool Config::SetFillOnAlloc(const std::string& option, const std::string& value) { in SetFillOnAlloc() argument
241 return ParseValue(option, value, SIZE_MAX, 1, SIZE_MAX, &fill_on_alloc_bytes_); in SetFillOnAlloc()
244 bool Config::SetFillOnFree(const std::string& option, const std::string& value) { in SetFillOnFree() argument
245 return ParseValue(option, value, SIZE_MAX, 1, SIZE_MAX, &fill_on_free_bytes_); in SetFillOnFree()
248 bool Config::SetBacktrace(const std::string& option, const std::string& value) { in SetBacktrace() argument
250 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 1, MAX_BACKTRACE_FRAMES, in SetBacktrace()
254 bool Config::SetBacktraceEnableOnSignal(const std::string& option, const std::string& value) { in SetBacktraceEnableOnSignal() argument
256 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 1, MAX_BACKTRACE_FRAMES, in SetBacktraceEnableOnSignal()
260 bool Config::SetBacktraceDumpOnExit(const std::string& option, const std::string& value) { in SetBacktraceDumpOnExit() argument
261 if (Config::VerifyValueEmpty(option, value)) { in SetBacktraceDumpOnExit()
277 bool Config::SetExpandAlloc(const std::string& option, const std::string& value) { in SetExpandAlloc() argument
278 return ParseValue(option, value, DEFAULT_EXPAND_BYTES, 1, MAX_EXPAND_BYTES, &expand_alloc_bytes_); in SetExpandAlloc()
281 bool Config::SetFreeTrack(const std::string& option, const std::string& value) { in SetFreeTrack() argument
290 return ParseValue(option, value, DEFAULT_FREE_TRACK_ALLOCATIONS, 1, MAX_FREE_TRACK_ALLOCATIONS, in SetFreeTrack()
294 bool Config::SetFreeTrackBacktraceNumFrames(const std::string& option, const std::string& value) { in SetFreeTrackBacktraceNumFrames() argument
295 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 0, MAX_BACKTRACE_FRAMES, in SetFreeTrackBacktraceNumFrames()
299 bool Config::SetRecordAllocs(const std::string& option, const std::string& value) { in SetRecordAllocs() argument
303 return ParseValue(option, value, DEFAULT_RECORD_ALLOCS, 1, MAX_RECORD_ALLOCS, in SetRecordAllocs()
317 bool Config::VerifyValueEmpty(const std::string& option, const std::string& value) { in VerifyValueEmpty() argument
321 option.c_str()); in VerifyValueEmpty()
332 bool Config::GetOption(const char** options_str, std::string* option, std::string* value) { in GetOption() argument
345 *option = std::string(start, cur - start); in GetOption()
385 std::string option; in Init() local
388 while (GetOption(&options_str, &option, &value)) { in Init()
389 auto entry = kOptions.find(option); in Init()
391 error_log("%s: unknown option %s", getprogname(), option.c_str()); in Init()
398 if (process_func != nullptr && !(this->*process_func)(option, value)) { in Init()
402 options_ |= info->option; in Init()