Path: blob/master/src/hotspot/os/windows/windbghelp.hpp
40930 views
/*1* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef OS_WINDOWS_WINDBGHELP_HPP25#define OS_WINDOWS_WINDBGHELP_HPP2627#include <windows.h>28#include <imagehlp.h>2930// This is a very plain wrapper for loading dbghelp.dll. It does not offer31// any additional functionality. It takes care of locking.3233class outputStream;3435// Please note: dbghelp.dll may not have been loaded, or it may have been loaded but not36// all functions may be available (because on the target system dbghelp.dll is of an37// older version).38// In all these cases we return an error from the WindowsDbgHelp::symXXXX() wrapper. We never39// assert. It should always be safe to call these functions, but caller has to process the40// return code (which he would have to do anyway).41namespace WindowsDbgHelp {4243DWORD symSetOptions(DWORD);44DWORD symGetOptions(void);45BOOL symInitialize(HANDLE, PCTSTR, BOOL);46BOOL symGetSymFromAddr64(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);47DWORD unDecorateSymbolName(const char*, char*, DWORD, DWORD);48BOOL symSetSearchPath(HANDLE, PCTSTR);49BOOL symGetSearchPath(HANDLE, PTSTR, int);50BOOL stackWalk64(DWORD MachineType,51HANDLE hProcess,52HANDLE hThread,53LPSTACKFRAME64 StackFrame,54PVOID ContextRecord);55PVOID symFunctionTableAccess64(HANDLE hProcess, DWORD64 AddrBase);56DWORD64 symGetModuleBase64(HANDLE hProcess, DWORD64 dwAddr);57BOOL miniDumpWriteDump(HANDLE hProcess, DWORD ProcessId, HANDLE hFile,58MINIDUMP_TYPE DumpType, PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,59PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,60PMINIDUMP_CALLBACK_INFORMATION CallbackParam);61BOOL symGetLineFromAddr64 (HANDLE hProcess, DWORD64 dwAddr,62PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line);6364// Print one liner describing state (if library loaded, which functions are65// missing - if any, and the dbhelp API version)66void print_state_on(outputStream* st);6768// Call at DLL_PROCESS_ATTACH.69void pre_initialize();7071};7273#endif // OS_WINDOWS_WINDBGHELP_HPP747576