equal
deleted
inserted
replaced
1822 // Support for the java launcher's '-XXaltjvm=<path>' option. Check |
1822 // Support for the java launcher's '-XXaltjvm=<path>' option. Check |
1823 // for a JAVA_HOME environment variable and fix up the path so it |
1823 // for a JAVA_HOME environment variable and fix up the path so it |
1824 // looks like jvm.dll is installed there (append a fake suffix |
1824 // looks like jvm.dll is installed there (append a fake suffix |
1825 // hotspot/jvm.dll). |
1825 // hotspot/jvm.dll). |
1826 char* java_home_var = ::getenv("JAVA_HOME"); |
1826 char* java_home_var = ::getenv("JAVA_HOME"); |
1827 if (java_home_var != NULL && java_home_var[0] != 0) { |
1827 if (java_home_var != NULL && java_home_var[0] != 0 && |
|
1828 strlen(java_home_var) < (size_t)buflen) { |
|
1829 |
1828 strncpy(buf, java_home_var, buflen); |
1830 strncpy(buf, java_home_var, buflen); |
1829 |
1831 |
1830 // determine if this is a legacy image or modules image |
1832 // determine if this is a legacy image or modules image |
1831 // modules image doesn't have "jre" subdirectory |
1833 // modules image doesn't have "jre" subdirectory |
1832 size_t len = strlen(buf); |
1834 size_t len = strlen(buf); |
1841 } |
1843 } |
1842 |
1844 |
1843 if (buf[0] == '\0') { |
1845 if (buf[0] == '\0') { |
1844 GetModuleFileName(vm_lib_handle, buf, buflen); |
1846 GetModuleFileName(vm_lib_handle, buf, buflen); |
1845 } |
1847 } |
1846 strcpy(saved_jvm_path, buf); |
1848 strncpy(saved_jvm_path, buf, MAX_PATH); |
1847 } |
1849 } |
1848 |
1850 |
1849 |
1851 |
1850 void os::print_jni_name_prefix_on(outputStream* st, int args_size) { |
1852 void os::print_jni_name_prefix_on(outputStream* st, int args_size) { |
1851 #ifndef _WIN64 |
1853 #ifndef _WIN64 |
2287 return EXCEPTION_CONTINUE_EXECUTION; |
2289 return EXCEPTION_CONTINUE_EXECUTION; |
2288 } |
2290 } |
2289 #endif // !_WIN64 |
2291 #endif // !_WIN64 |
2290 |
2292 |
2291 return EXCEPTION_CONTINUE_SEARCH; |
2293 return EXCEPTION_CONTINUE_SEARCH; |
2292 } |
|
2293 |
|
2294 // Fatal error reporting is single threaded so we can make this a |
|
2295 // static and preallocated. If it's more than MAX_PATH silently ignore |
|
2296 // it. |
|
2297 static char saved_error_file[MAX_PATH] = {0}; |
|
2298 |
|
2299 void os::set_error_file(const char *logfile) { |
|
2300 if (strlen(logfile) <= MAX_PATH) { |
|
2301 strncpy(saved_error_file, logfile, MAX_PATH); |
|
2302 } |
|
2303 } |
2294 } |
2304 |
2295 |
2305 static inline void report_error(Thread* t, DWORD exception_code, |
2296 static inline void report_error(Thread* t, DWORD exception_code, |
2306 address addr, void* siginfo, void* context) { |
2297 address addr, void* siginfo, void* context) { |
2307 VMError err(t, exception_code, addr, siginfo, context); |
2298 VMError err(t, exception_code, addr, siginfo, context); |