Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: runtime/vm/native_symbol_win.cc

Issue 2772563002: Fix the fix for the native symbol resolver on Windows. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698