VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/xpcom/base/nsStackFrameWin.h@ 4837

Last change on this file since 4837 was 1, checked in by vboxsync, 54 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * The Original Code is nsStackFrameWin.h code, released
17 * December 20, 2000.
18 *
19 * The Initial Developer of the Original Code is
20 * Netscape Communications Corporation.
21 * Portions created by the Initial Developer are Copyright (C) 2000
22 * the Initial Developer. All Rights Reserved.
23 *
24 * Contributor(s):
25 * Michael Judge, 20-December-2000
26 *
27 * Alternatively, the contents of this file may be used under the terms of
28 * either of the GNU General Public License Version 2 or later (the "GPL"),
29 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
38 *
39 * ***** END LICENSE BLOCK ***** */
40#ifndef nsStackFrameWin_h___
41#define nsStackFrameWin_h___
42
43
44#if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
45#include "nspr.h"
46#include <windows.h>
47#include <imagehlp.h>
48
49// Define these as static pointers so that we can load the DLL on the
50// fly (and not introduce a link-time dependency on it). Tip o' the
51// hat to Matt Pietrick for this idea. See:
52//
53// http://msdn.microsoft.com/library/periodic/period97/F1/D3/S245C6.htm
54//
55PR_BEGIN_EXTERN_C
56
57typedef DWORD (__stdcall *SYMSETOPTIONSPROC)(DWORD);
58extern SYMSETOPTIONSPROC _SymSetOptions;
59
60typedef BOOL (__stdcall *SYMINITIALIZEPROC)(HANDLE, LPSTR, BOOL);
61extern SYMINITIALIZEPROC _SymInitialize;
62
63typedef BOOL (__stdcall *SYMCLEANUPPROC)(HANDLE);
64extern SYMCLEANUPPROC _SymCleanup;
65
66typedef BOOL (__stdcall *STACKWALKPROC)(DWORD,
67 HANDLE,
68 HANDLE,
69 LPSTACKFRAME,
70 LPVOID,
71 PREAD_PROCESS_MEMORY_ROUTINE,
72 PFUNCTION_TABLE_ACCESS_ROUTINE,
73 PGET_MODULE_BASE_ROUTINE,
74 PTRANSLATE_ADDRESS_ROUTINE);
75extern STACKWALKPROC _StackWalk;
76
77typedef LPVOID (__stdcall *SYMFUNCTIONTABLEACCESSPROC)(HANDLE, DWORD);
78extern SYMFUNCTIONTABLEACCESSPROC _SymFunctionTableAccess;
79
80typedef DWORD (__stdcall *SYMGETMODULEBASEPROC)(HANDLE, DWORD);
81extern SYMGETMODULEBASEPROC _SymGetModuleBase;
82
83typedef BOOL (__stdcall *SYMGETSYMFROMADDRPROC)(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
84extern SYMGETSYMFROMADDRPROC _SymGetSymFromAddr;
85
86typedef DWORD ( __stdcall *SYMLOADMODULE)(HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD);
87extern SYMLOADMODULE _SymLoadModule;
88
89typedef DWORD ( __stdcall *SYMUNDNAME)(PIMAGEHLP_SYMBOL, PSTR, DWORD);
90extern SYMUNDNAME _SymUnDName;
91
92typedef DWORD ( __stdcall *SYMGETMODULEINFO)( HANDLE, DWORD, PIMAGEHLP_MODULE);
93extern SYMGETMODULEINFO _SymGetModuleInfo;
94
95typedef BOOL ( __stdcall *ENUMLOADEDMODULES)( HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
96extern ENUMLOADEDMODULES _EnumerateLoadedModules;
97
98typedef BOOL (__stdcall *SYMGETLINEFROMADDRPROC)(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
99extern SYMGETLINEFROMADDRPROC _SymGetLineFromAddr;
100
101PRBool EnsureSymInitialized();
102
103PRBool EnsureImageHlpInitialized();
104
105/*
106 * SymGetModuleInfoEspecial
107 *
108 * Attempt to determine the module information.
109 * Bug 112196 says this DLL may not have been loaded at the time
110 * SymInitialize was called, and thus the module information
111 * and symbol information is not available.
112 * This code rectifies that problem.
113 * Line information is optional.
114 */
115BOOL SymGetModuleInfoEspecial(HANDLE aProcess, DWORD aAddr, PIMAGEHLP_MODULE aModuleInfo, PIMAGEHLP_LINE aLineInfo);
116
117
118void DumpStackToFile(FILE* out);
119
120PR_END_EXTERN_C
121
122#endif //WIN32
123
124#endif //nsStackFrameWin_h___
125
126
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use