| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 if (start != NULL) { | 56 if (start != NULL) { |
| 57 *start = NULL; | 57 *start = NULL; |
| 58 } | 58 } |
| 59 memset(&buffer[0], 0, sizeof(buffer)); | 59 memset(&buffer[0], 0, sizeof(buffer)); |
| 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 BOOL r = SymFromAddr(hProcess, address, NULL, pSymbol); | 65 DWORD64 displacement; |
| 66 BOOL r = SymFromAddr(hProcess, address, &displacement, pSymbol); |
| 66 if (r == FALSE) { | 67 if (r == FALSE) { |
| 67 return NULL; | 68 return NULL; |
| 68 } | 69 } |
| 70 *start = pc - displacement; |
| 69 return strdup(pSymbol->Name); | 71 return strdup(pSymbol->Name); |
| 70 } | 72 } |
| 71 | 73 |
| 72 | 74 |
| 73 void NativeSymbolResolver::FreeSymbolName(char* name) { | 75 void NativeSymbolResolver::FreeSymbolName(char* name) { |
| 74 free(name); | 76 free(name); |
| 75 } | 77 } |
| 76 | 78 |
| 77 | 79 |
| 78 bool NativeSymbolResolver::LookupSharedObject(uword pc, | 80 bool NativeSymbolResolver::LookupSharedObject(uword pc, |
| 79 uword* dso_base, | 81 uword* dso_base, |
| 80 char** dso_name) { | 82 char** dso_name) { |
| 81 return false; | 83 return false; |
| 82 } | 84 } |
| 83 | 85 |
| 84 } // namespace dart | 86 } // namespace dart |
| 85 | 87 |
| 86 #endif // defined(HOST_OS_WINDOWS) | 88 #endif // defined(HOST_OS_WINDOWS) |
| OLD | NEW |