comparison src/os/windows/vm/os_windows.cpp @ 2022:2d4762ec74af

7003748: Decode C stack frames when symbols are presented (PhoneHome project) Summary: Implemented in-process C native stack frame decoding when symbols are available. Reviewed-by: coleenp, never
author zgu
date Sat, 11 Dec 2010 13:20:56 -0500
parents f95d63e2154a
children 54f5dd2aa1d9
comparison
equal deleted inserted replaced
1972:f95d63e2154a 2022:2d4762ec74af
61 #include "runtime/threadCritical.hpp" 61 #include "runtime/threadCritical.hpp"
62 #include "runtime/timer.hpp" 62 #include "runtime/timer.hpp"
63 #include "services/attachListener.hpp" 63 #include "services/attachListener.hpp"
64 #include "services/runtimeService.hpp" 64 #include "services/runtimeService.hpp"
65 #include "thread_windows.inline.hpp" 65 #include "thread_windows.inline.hpp"
66 #include "utilities/decoder.hpp"
66 #include "utilities/defaultStream.hpp" 67 #include "utilities/defaultStream.hpp"
67 #include "utilities/events.hpp" 68 #include "utilities/events.hpp"
68 #include "utilities/growableArray.hpp" 69 #include "utilities/growableArray.hpp"
69 #include "utilities/vmError.hpp" 70 #include "utilities/vmError.hpp"
70 #ifdef TARGET_ARCH_x86 71 #ifdef TARGET_ARCH_x86
1367 } 1368 }
1368 } 1369 }
1369 1370
1370 bool os::dll_address_to_function_name(address addr, char *buf, 1371 bool os::dll_address_to_function_name(address addr, char *buf,
1371 int buflen, int *offset) { 1372 int buflen, int *offset) {
1372 // Unimplemented on Windows - in order to use SymGetSymFromAddr(), 1373 if (Decoder::decode(addr, buf, buflen, offset) == Decoder::no_error) {
1373 // we need to initialize imagehlp/dbghelp, then load symbol table 1374 return true;
1374 // for every module. That's too much work to do after a fatal error. 1375 }
1375 // For an example on how to implement this function, see 1.4.2. 1376 if (offset != NULL) *offset = -1;
1376 if (offset) *offset = -1; 1377 if (buf != NULL) buf[0] = '\0';
1377 if (buf) buf[0] = '\0';
1378 return false; 1378 return false;
1379 } 1379 }
1380 1380
1381 void* os::dll_lookup(void* handle, const char* name) { 1381 void* os::dll_lookup(void* handle, const char* name) {
1382 return GetProcAddress((HMODULE)handle, name); 1382 return GetProcAddress((HMODULE)handle, name);