BDE 4.39.x 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`.
116///
117/// See @ref balst_stacktraceconfigurationutil
119
120 // CLASS METHODS
121
122 /// Disable symbol, source file name, and line number resolution in stack traces performed by `balst`.
123 ///
124 /// \note Note that such resolution is
125 /// expensive, involving disk access, and on Windows platforms has
126 /// thread-safety concerns if the application is using `dbghelp.dll`.
127 /// Disabling resolution allows an application owner to globally prevent
128 /// any resolution of symbols (by `balst`) in the process.
129 static
131
132 /// Enable symbol resolution and source file name & line number
133 /// resolution on platforms that support them in stack traces performed by `balst`.
134 ///
135 /// \note Note that such resolution is expensive, involving disk
136 /// access, and on Windows platforms has thread-safety concerns if the
137 /// application is using `dbghelp.dll`. Enabling resolution (the
138 /// default state) results in `balst` stack traces giving as much
139 /// information as is available on the platform.
140 static
142
143 /// Return whether symbol and line number resolution in stack traces is disabled.
144 ///
145 /// \note Note that if neither `disableResolution` nor
146 /// `enableResolution` have ever been called, this defaults to `false`.
147 static
149};
150
151} // close package namespace
152
153
154#endif
155
156// ----------------------------------------------------------------------------
157// Copyright 2021 Bloomberg Finance L.P.
158//
159// Licensed under the Apache License, Version 2.0 (the "License");
160// you may not use this file except in compliance with the License.
161// You may obtain a copy of the License at
162//
163// http://www.apache.org/licenses/LICENSE-2.0
164//
165// Unless required by applicable law or agreed to in writing, software
166// distributed under the License is distributed on an "AS IS" BASIS,
167// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
168// See the License for the specific language governing permissions and
169// limitations under the License.
170// ----------------------------- END-OF-FILE ----------------------------------
171
172/** @} */
173/** @} */
174/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition balst_objectfileformat.h:152
Definition balst_stacktraceconfigurationutil.h:118