BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balst_stacktraceconfigurationutil.h
Go to the documentation of this file.
1/// @file balst_stacktraceconfigurationutil.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// balst_stacktraceconfigurationutil.h -*-C++-*-
8#ifndef INCLUDED_BALST_STACKTRACECONFIGURATIONUTIL
9#define INCLUDED_BALST_STACKTRACECONFIGURATIONUTIL
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup balst_stacktraceconfigurationutil balst_stacktraceconfigurationutil
15/// @brief Provide utility for global configuration of stack trace.
16/// @addtogroup bal
17/// @{
18/// @addtogroup balst
19/// @{
20/// @addtogroup balst_stacktraceconfigurationutil
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#balst_stacktraceconfigurationutil-purpose"> Purpose</a>
25/// * <a href="#balst_stacktraceconfigurationutil-classes"> Classes </a>
26/// * <a href="#balst_stacktraceconfigurationutil-description"> Description </a>
27/// * <a href="#balst_stacktraceconfigurationutil-configuration-options"> Configuration Options </a>
28/// * <a href="#balst_stacktraceconfigurationutil-usage"> Usage </a>
29/// * <a href="#balst_stacktraceconfigurationutil-example-1-evaluating-boolean-value"> Example 1: Evaluating Boolean Value </a>
30///
31/// # Purpose {#balst_stacktraceconfigurationutil-purpose}
32/// Provide utility for global configuration of stack trace.
33///
34/// # Classes {#balst_stacktraceconfigurationutil-classes}
35///
36/// - balst::StackTraceConfigurationUtil: global configuration of stack trace
37///
38/// # Description {#balst_stacktraceconfigurationutil-description}
39/// This component provides global configuration for stack traces
40/// provided by the `balst` package.
41///
42/// Resolution of symbols, line numbers, and source file names is generally very
43/// expensive and involves a lot of disk access. On Windows, such resolution
44/// can also be very problematic for other reasons.
45///
46/// Note that line number and source file name information is not available on
47/// all platforms. If resolution is enabled, the stack trace will give as much
48/// information as `balst` has implemented for the platform. All platforms
49/// support symbol names.
50///
51/// ## Configuration Options {#balst_stacktraceconfigurationutil-configuration-options}
52///
53///
54/// Currently this component provides one configuration option:
55///
56/// * [disable|enable]Resolution: Configures whether operations in `balst`
57/// resolve symbols, line numbers, and source file names. By default,
58/// resolution is enabled. Resolution of symbols, line numbers, and source
59/// file names is generally expensive and involves disk access. On Windows
60/// platforms there are also thread-safety concerns with `dbghlp.dll`. This
61/// option allows an application owner to globally prevent any resolution of
62/// symbols, line numbers, or source file names (by 'balst) in an
63/// application.
64///
65/// ## Usage {#balst_stacktraceconfigurationutil-usage}
66///
67///
68/// This section illustrates intended use of this component.
69///
70/// ### Example 1: Evaluating Boolean Value {#balst_stacktraceconfigurationutil-example-1-evaluating-boolean-value}
71///
72///
73/// If neither `enableResolution` nor `disableResolution` have been called, the
74/// default value of `isResolutionDisabled` is `false`.
75/// @code
76/// assert(false ==
77/// balst::StackTraceConfigurationUtil::isResolutionDisabled());
78/// @endcode
79/// After that, the value tracks whether `disableResolution` or
80/// `enableResolution` has been called.
81/// @code
82/// balst::StackTraceConfigurationUtil::disableResolution();
83///
84/// assert(true == balst::StackTraceConfigurationUtil::isResolutionDisabled());
85///
86/// balst::StackTraceConfigurationUtil::enableResolution();
87///
88/// assert(false ==
89/// balst::StackTraceConfigurationUtil::isResolutionDisabled());
90/// @endcode
91/// @}
92/** @} */
93/** @} */
94
95/** @addtogroup bal
96 * @{
97 */
98/** @addtogroup balst
99 * @{
100 */
101/** @addtogroup balst_stacktraceconfigurationutil
102 * @{
103 */
104
105#include <balscm_version.h>
106
107
108namespace balst {
109
110 // =================================
111 // class StackTraceConfigurationUtil
112 // =================================
113
114/// This `struct` provides a namespace for functions that configure the
115/// behavior of stack traces performed by `balst`.
117
118 // CLASS METHODS
119
120 /// Disable symbol, source file name, and line number resolution in
121 /// stack traces performed by `balst`. Note that such resolution is
122 /// expensive, involving disk access, and on Windows platforms has
123 /// thread-safety concerns if the application is using `dbghelp.dll`.
124 /// Disabling resolution allows an application owner to globally prevent
125 /// any resolution of symbols (by `balst`) in the process.
126 static
128
129 /// Enable symbol resolution and source file name & line number
130 /// resolution on platforms that support them in stack traces performed
131 /// by `balst`. Note that such resolution is expensive, involving disk
132 /// access, and on Windows platforms has thread-safety concerns if the
133 /// application is using `dbghelp.dll`. Enabling resolution (the
134 /// default state) results in `balst` stack traces giving as much
135 /// information as is available on the platform.
136 static
138
139 /// Return whether symbol and line number resolution in stack traces is
140 /// disabled. Note that if neither `disableResolution` nor
141 /// `enableResolution` have ever been called, this defaults to `false`.
142 static
144};
145
146} // close package namespace
147
148
149#endif
150
151// ----------------------------------------------------------------------------
152// Copyright 2021 Bloomberg Finance L.P.
153//
154// Licensed under the Apache License, Version 2.0 (the "License");
155// you may not use this file except in compliance with the License.
156// You may obtain a copy of the License at
157//
158// http://www.apache.org/licenses/LICENSE-2.0
159//
160// Unless required by applicable law or agreed to in writing, software
161// distributed under the License is distributed on an "AS IS" BASIS,
162// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
163// See the License for the specific language governing permissions and
164// limitations under the License.
165// ----------------------------- END-OF-FILE ----------------------------------
166
167/** @} */
168/** @} */
169/** @} */
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition balst_objectfileformat.h:161
Definition balst_stacktraceconfigurationutil.h:116