xref: /freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_dbghelp.h (revision f976241773df2260e6170317080761d1c5814fe5)
1 //===-- sanitizer_dbghelp.h ------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Wrappers for lazy loaded dbghelp.dll. Provides function pointers and a
10 // callback to initialize them.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef SANITIZER_SYMBOLIZER_WIN_H
15 #define SANITIZER_SYMBOLIZER_WIN_H
16 
17 #if !SANITIZER_WINDOWS
18 #error "sanitizer_dbghelp.h is a Windows-only header"
19 #endif
20 
21 #define WIN32_LEAN_AND_MEAN
22 #include <windows.h>
23 #include <dbghelp.h>
24 
25 namespace __sanitizer {
26 
27 extern decltype(::StackWalk64) *StackWalk64;
28 extern decltype(::SymCleanup) *SymCleanup;
29 extern decltype(::SymFromAddr) *SymFromAddr;
30 extern decltype(::SymFunctionTableAccess64) *SymFunctionTableAccess64;
31 extern decltype(::SymGetLineFromAddr64) *SymGetLineFromAddr64;
32 extern decltype(::SymGetModuleBase64) *SymGetModuleBase64;
33 extern decltype(::SymGetSearchPathW) *SymGetSearchPathW;
34 extern decltype(::SymInitialize) *SymInitialize;
35 extern decltype(::SymSetOptions) *SymSetOptions;
36 extern decltype(::SymSetSearchPathW) *SymSetSearchPathW;
37 extern decltype(::UnDecorateSymbolName) *UnDecorateSymbolName;
38 
39 }  // namespace __sanitizer
40 
41 #endif  // SANITIZER_SYMBOLIZER_WIN_H
42