src/os/windows/vm/os_windows.cpp

Print this page

        

*** 1418,1427 **** --- 1418,1430 ---- return 0; } bool os::dll_address_to_library_name(address addr, char* buf, int buflen, int* offset) { + // buf is not optional, but offset is optional + assert(buf != NULL, "sanity check"); + // NOTE: the reason we don't use SymGetModuleInfo() is it doesn't always // return the full path to the DLL file, sometimes it returns path // to the corresponding PDB file (debug info); sometimes it only // returns partial path, which makes life painful.
*** 1433,1455 **** if (enumerate_modules(pid, _locate_module_by_addr, (void *)&mi)) { // buf already contains path name if (offset) *offset = addr - mi.base_addr; return true; } else { ! if (buf) buf[0] = '\0'; if (offset) *offset = -1; return false; } } bool os::dll_address_to_function_name(address addr, char *buf, int buflen, int *offset) { if (Decoder::decode(addr, buf, buflen, offset)) { return true; } if (offset != NULL) *offset = -1; ! if (buf != NULL) buf[0] = '\0'; return false; } // save the start and end address of jvm.dll into param[0] and param[1] static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr, --- 1436,1461 ---- if (enumerate_modules(pid, _locate_module_by_addr, (void *)&mi)) { // buf already contains path name if (offset) *offset = addr - mi.base_addr; return true; } else { ! buf[0] = '\0'; if (offset) *offset = -1; return false; } } bool os::dll_address_to_function_name(address addr, char *buf, int buflen, int *offset) { + // buf is not optional, but offset is optional + assert(buf != NULL, "sanity check"); + if (Decoder::decode(addr, buf, buflen, offset)) { return true; } if (offset != NULL) *offset = -1; ! buf[0] = '\0'; return false; } // save the start and end address of jvm.dll into param[0] and param[1] static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,