author | stuefe |
Fri, 18 Aug 2017 09:05:42 +0200 | |
changeset 47086 | 2b35673f6297 |
parent 31352 | a6ab7217b5cc |
permissions | -rw-r--r-- |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
1 |
/* |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
4 |
* |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
8 |
* |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
13 |
* accompanied this code). |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
14 |
* |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
18 |
* |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
21 |
* questions. |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
22 |
* |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
23 |
*/ |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
24 |
|
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
26 |
#include "prims/jvm.h" |
15855
2ac9ebea17f3
8008959: Fix non-PCH build on Linux, Windows and MacOS X
simonis
parents:
15186
diff
changeset
|
27 |
#include "runtime/arguments.hpp" |
25468
5331df506290
8048241: Introduce umbrella header os.inline.hpp and clean up includes
goetz
parents:
19952
diff
changeset
|
28 |
#include "runtime/os.hpp" |
11483 | 29 |
#include "decoder_windows.hpp" |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
30 |
#include "windbghelp.hpp" |
11483 | 31 |
|
32 |
WindowsDecoder::WindowsDecoder() { |
|
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
33 |
_can_decode_in_vm = true; |
11483 | 34 |
_decoder_status = no_error; |
35 |
initialize(); |
|
36 |
} |
|
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
37 |
|
11483 | 38 |
void WindowsDecoder::initialize() { |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
39 |
if (!has_error()) { |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
40 |
HANDLE hProcess = ::GetCurrentProcess(); |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
41 |
WindowsDbgHelp::symSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_EXACT_SYMBOLS); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
42 |
if (!WindowsDbgHelp::symInitialize(hProcess, NULL, TRUE)) { |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
43 |
_decoder_status = helper_init_error; |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
44 |
return; |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
45 |
} |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
46 |
|
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
47 |
// set pdb search paths |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
48 |
char paths[MAX_PATH]; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
49 |
int len = sizeof(paths); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
50 |
if (!WindowsDbgHelp::symGetSearchPath(hProcess, paths, len)) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
51 |
paths[0] = '\0'; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
52 |
} else { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
53 |
// available spaces in path buffer |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
54 |
len -= (int)strlen(paths); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
55 |
} |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
56 |
|
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
57 |
char tmp_path[MAX_PATH]; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
58 |
DWORD dwSize; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
59 |
HMODULE hJVM = ::GetModuleHandle("jvm.dll"); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
60 |
tmp_path[0] = '\0'; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
61 |
// append the path where jvm.dll is located |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
62 |
if (hJVM != NULL && (dwSize = ::GetModuleFileName(hJVM, tmp_path, sizeof(tmp_path))) > 0) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
63 |
while (dwSize > 0 && tmp_path[dwSize] != '\\') { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
64 |
dwSize --; |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
65 |
} |
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
66 |
|
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
67 |
tmp_path[dwSize] = '\0'; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
68 |
|
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
69 |
if (dwSize > 0 && len > (int)dwSize + 1) { |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
70 |
strncat(paths, os::path_separator(), 1); |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
71 |
strncat(paths, tmp_path, dwSize); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
72 |
len -= dwSize + 1; |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
73 |
} |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
74 |
} |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
75 |
|
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
76 |
// append $JRE/bin. Arguments::get_java_home actually returns $JRE |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
77 |
// path |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
78 |
char *p = Arguments::get_java_home(); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
79 |
assert(p != NULL, "empty java home"); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
80 |
size_t java_home_len = strlen(p); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
81 |
if (len > (int)java_home_len + 5) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
82 |
strncat(paths, os::path_separator(), 1); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
83 |
strncat(paths, p, java_home_len); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
84 |
strncat(paths, "\\bin", 4); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
85 |
len -= (int)(java_home_len + 5); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
86 |
} |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
87 |
|
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
88 |
// append $JDK/bin path if it exists |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
89 |
assert(java_home_len < MAX_PATH, "Invalid path length"); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
90 |
// assume $JRE is under $JDK, construct $JDK/bin path and |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
91 |
// see if it exists or not |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
92 |
if (strncmp(&p[java_home_len - 3], "jre", 3) == 0) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
93 |
strncpy(tmp_path, p, java_home_len - 3); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
94 |
tmp_path[java_home_len - 3] = '\0'; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
95 |
strncat(tmp_path, "bin", 3); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
96 |
|
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
97 |
// if the directory exists |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
98 |
DWORD dwAttrib = GetFileAttributes(tmp_path); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
99 |
if (dwAttrib != INVALID_FILE_ATTRIBUTES && |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
100 |
(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
101 |
// tmp_path should have the same length as java_home_len, since we only |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
102 |
// replaced 'jre' with 'bin' |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
103 |
if (len > (int)java_home_len + 1) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
104 |
strncat(paths, os::path_separator(), 1); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
105 |
strncat(paths, tmp_path, java_home_len); |
15186
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
106 |
} |
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
107 |
} |
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
108 |
} |
1a255c84cf6a
7152671: RFE: Windows decoder should add some std dirs to the symbol search path
zgu
parents:
13963
diff
changeset
|
109 |
|
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
110 |
WindowsDbgHelp::symSetSearchPath(hProcess, paths); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
111 |
|
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
112 |
// find out if jvm.dll contains private symbols, by decoding |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
113 |
// current function and comparing the result |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
114 |
address addr = (address)Decoder::demangle; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
115 |
char buf[MAX_PATH]; |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
116 |
if (decode(addr, buf, sizeof(buf), NULL, NULL, true /* demangle */)) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
117 |
_can_decode_in_vm = !strcmp(buf, "Decoder::demangle"); |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
118 |
} |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
119 |
} |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
120 |
} |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
121 |
|
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
122 |
void WindowsDecoder::uninitialize() {} |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
123 |
|
11483 | 124 |
bool WindowsDecoder::can_decode_C_frame_in_vm() const { |
125 |
return (!has_error() && _can_decode_in_vm); |
|
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
126 |
} |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
127 |
|
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
128 |
|
31352
a6ab7217b5cc
8079473: allow demangling to be optional in dll_address_to_function_name
bdelsart
parents:
25468
diff
changeset
|
129 |
bool WindowsDecoder::decode(address addr, char *buf, int buflen, int* offset, const char* modulepath, bool demangle_name) { |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
130 |
if (!has_error()) { |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
131 |
PIMAGEHLP_SYMBOL64 pSymbol; |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
132 |
char symbolInfo[MAX_PATH + sizeof(IMAGEHLP_SYMBOL64)]; |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
133 |
pSymbol = (PIMAGEHLP_SYMBOL64)symbolInfo; |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
134 |
pSymbol->MaxNameLength = MAX_PATH; |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
135 |
pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
136 |
DWORD64 displacement; |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
137 |
if (WindowsDbgHelp::symGetSymFromAddr64(::GetCurrentProcess(), (DWORD64)addr, &displacement, pSymbol)) { |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
138 |
if (buf != NULL) { |
31352
a6ab7217b5cc
8079473: allow demangling to be optional in dll_address_to_function_name
bdelsart
parents:
25468
diff
changeset
|
139 |
if (!(demangle_name && demangle(pSymbol->Name, buf, buflen))) { |
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
140 |
jio_snprintf(buf, buflen, "%s", pSymbol->Name); |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
141 |
} |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
142 |
} |
11483 | 143 |
if(offset != NULL) *offset = (int)displacement; |
144 |
return true; |
|
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
145 |
} |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
146 |
} |
11483 | 147 |
if (buf != NULL && buflen > 0) buf[0] = '\0'; |
148 |
if (offset != NULL) *offset = -1; |
|
149 |
return false; |
|
7447
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
150 |
} |
32c42d627f41
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
diff
changeset
|
151 |
|
11483 | 152 |
bool WindowsDecoder::demangle(const char* symbol, char *buf, int buflen) { |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
153 |
if (!has_error()) { |
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
154 |
return WindowsDbgHelp::unDecorateSymbolName(symbol, buf, buflen, UNDNAME_COMPLETE) > 0; |
19952
bc974e92f881
8022335: Native stack walk while generating hs_err does not work on Windows x64
iklam
parents:
15855
diff
changeset
|
155 |
} |
47086
2b35673f6297
8186349: [windows] Centralize dbghelp handling code
stuefe
parents:
31352
diff
changeset
|
156 |
return false; |
19952
bc974e92f881
8022335: Native stack walk while generating hs_err does not work on Windows x64
iklam
parents:
15855
diff
changeset
|
157 |
} |
bc974e92f881
8022335: Native stack walk while generating hs_err does not work on Windows x64
iklam
parents:
15855
diff
changeset
|
158 |