userver: userver/utils/debugging.hpp Source File
Loading...
Searching...
No Matches
debugging.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/utils/debugging.hpp
4/// @brief Utility for runtime debugger detection
5
6USERVER_NAMESPACE_BEGIN
7
8namespace utils {
9
10/// @brief Checks whether a debugger is attached to the current process.
11///
12/// This function offers a cross-platform method for detecting the presence of a debugger.
13/// - If C++26's `__cpp_lib_debugging` feature is available, it calls `std::is_debugger_present()` directly.
14/// - If not, it performs platform-specific checks to make this determination.
15///
16/// Supported platforms: **Linux** and **Apple**.
17/// On unsupported platforms, this function returns `false`.
18///
19/// @return `true` if a debugger is attached to the process, `false` otherwise.
20bool IsDebuggerPresent() noexcept;
21
22} // namespace utils
23
24USERVER_NAMESPACE_END