1 : // Copyright 2013 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : //
15 : // Utilities for dealing with the dbghelp library.
16 :
17 : #ifndef SYZYGY_COMMON_DBGHELP_UTIL_H_
18 : #define SYZYGY_COMMON_DBGHELP_UTIL_H_
19 :
20 : #include <windows.h>
21 :
22 m : namespace common {
23 :
24 : // A wrapper for SymInitialize. It looks like it has an internal race condition
25 : // that can ocassionaly fail, so we wrap it and retry a finite number of times.
26 : // Ugly, but necessary. Logs verbosely on failure.
27 : // @param process Handle of the running process, or of the process being
28 : // debugged. Must not be NULL.
29 : // @param user_search_path Semi-colon separated list of paths that will be
30 : // used to search for symbol files. May be NULL.
31 : // @param invade_process If this is true then the modules of the process will be
32 : // enumerated and have each of their symbols loaded.
33 : // @returns true on success, false otherwise.
34 : // @note Use of this function incurs a dependency on dbghelp.dll.
35 m : bool SymInitialize(HANDLE process,
36 m : const char* user_search_path,
37 m : bool invade_process);
38 :
39 m : } // namespace common
40 :
41 : #endif // SYZYGY_COMMON_DBGHELP_UTIL_H_
|