OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(HOST_OS_WINDOWS) | 6 #if defined(HOST_OS_WINDOWS) |
7 | 7 |
8 #include "vm/lockers.h" | 8 #include "vm/lockers.h" |
9 #include "vm/native_symbol.h" | 9 #include "vm/native_symbol.h" |
10 #include "vm/os_thread.h" | 10 #include "vm/os_thread.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 HANDLE hProcess = GetCurrentProcess(); | 60 HANDLE hProcess = GetCurrentProcess(); |
61 DWORD64 address = static_cast<DWORD64>(pc); | 61 DWORD64 address = static_cast<DWORD64>(pc); |
62 PSYMBOL_INFO pSymbol = reinterpret_cast<PSYMBOL_INFO>(&buffer[0]); | 62 PSYMBOL_INFO pSymbol = reinterpret_cast<PSYMBOL_INFO>(&buffer[0]); |
63 pSymbol->SizeOfStruct = kSymbolInfoSize; | 63 pSymbol->SizeOfStruct = kSymbolInfoSize; |
64 pSymbol->MaxNameLen = kMaxNameLength; | 64 pSymbol->MaxNameLen = kMaxNameLength; |
65 DWORD64 displacement; | 65 DWORD64 displacement; |
66 BOOL r = SymFromAddr(hProcess, address, &displacement, pSymbol); | 66 BOOL r = SymFromAddr(hProcess, address, &displacement, pSymbol); |
67 if (r == FALSE) { | 67 if (r == FALSE) { |
68 return NULL; | 68 return NULL; |
69 } | 69 } |
70 *start = pc - displacement; | 70 if (start != NULL) { |
| 71 *start = pc - displacement; |
| 72 } |
71 return strdup(pSymbol->Name); | 73 return strdup(pSymbol->Name); |
72 } | 74 } |
73 | 75 |
74 | 76 |
75 void NativeSymbolResolver::FreeSymbolName(char* name) { | 77 void NativeSymbolResolver::FreeSymbolName(char* name) { |
76 free(name); | 78 free(name); |
77 } | 79 } |
78 | 80 |
79 | 81 |
80 bool NativeSymbolResolver::LookupSharedObject(uword pc, | 82 bool NativeSymbolResolver::LookupSharedObject(uword pc, |
81 uword* dso_base, | 83 uword* dso_base, |
82 char** dso_name) { | 84 char** dso_name) { |
83 return false; | 85 return false; |
84 } | 86 } |
85 | 87 |
86 } // namespace dart | 88 } // namespace dart |
87 | 89 |
88 #endif // defined(HOST_OS_WINDOWS) | 90 #endif // defined(HOST_OS_WINDOWS) |
OLD | NEW |