< prev index next >

src/os/windows/vm/os_windows.cpp

Print this page
rev 13529 : 8185712: [windows] Improve native symbol decoder
Reviewed-by:

@@ -72,10 +72,11 @@
 #include "utilities/defaultStream.hpp"
 #include "utilities/events.hpp"
 #include "utilities/growableArray.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
+#include "symbolengine.hpp"
 #include "windbghelp.hpp"
 
 
 #ifdef _DEBUG
 #include <crtdbg.h>

@@ -132,10 +133,12 @@
   case DLL_PROCESS_ATTACH:
     vm_lib_handle = hinst;
     if (ForceTimeHighResolution) {
       timeBeginPeriod(1L);
     }
+    WindowsDbgHelp::pre_initialize();
+    SymbolEngine::pre_initialize();
     break;
   case DLL_PROCESS_DETACH:
     if (ForceTimeHighResolution) {
       timeEndPeriod(1L);
     }

@@ -1317,10 +1320,14 @@
 // in case of error it checks if .dll/.so was built for the
 // same architecture as Hotspot is running on
 void * os::dll_load(const char *name, char *ebuf, int ebuflen) {
   void * result = LoadLibrary(name);
   if (result != NULL) {
+    if (InitializeDbgHelpEarly) {
+      // Recalculate pdb search path if a DLL was loaded successfully.
+      SymbolEngine::recalc_search_path();
+    }
     return result;
   }
 
   DWORD errcode = GetLastError();
   if (errcode == ERROR_MOD_NOT_FOUND) {

@@ -4046,10 +4053,14 @@
 
   if (initSock() != JNI_OK) {
     return JNI_ERR;
   }
 
+  if (InitializeDbgHelpEarly) {
+    SymbolEngine::recalc_search_path();
+  }
+
   return JNI_OK;
 }
 
 // Mark the polling page as unreadable
 void os::make_polling_page_unreadable(void) {
< prev index next >