hotspot/src/os/windows/vm/os_windows.cpp
changeset 34305 e399e6b44631
parent 33766 3290cae587f9
child 34306 f64a5e6127f2
equal deleted inserted replaced
34234:e4a23d294f48 34305:e399e6b44631
  4003     fgetc(stdin);
  4003     fgetc(stdin);
  4004   }
  4004   }
  4005 }
  4005 }
  4006 
  4006 
  4007 
  4007 
  4008 int os::message_box(const char* title, const char* message) {
  4008 bool os::message_box(const char* title, const char* message) {
  4009   int result = MessageBox(NULL, message, title,
  4009   int result = MessageBox(NULL, message, title,
  4010                           MB_YESNO | MB_ICONERROR | MB_SYSTEMMODAL | MB_DEFAULT_DESKTOP_ONLY);
  4010                           MB_YESNO | MB_ICONERROR | MB_SYSTEMMODAL | MB_DEFAULT_DESKTOP_ONLY);
  4011   return result == IDYES;
  4011   return result == IDYES;
  4012 }
  4012 }
  4013 
  4013 
  5503     _RtlCaptureStackBackTrace = (RtlCaptureStackBackTrace_Fn)::GetProcAddress(handle, "RtlCaptureStackBackTrace");
  5503     _RtlCaptureStackBackTrace = (RtlCaptureStackBackTrace_Fn)::GetProcAddress(handle, "RtlCaptureStackBackTrace");
  5504     initialized = TRUE;
  5504     initialized = TRUE;
  5505   }
  5505   }
  5506 }
  5506 }
  5507 
  5507 
  5508 
  5508 bool os::start_debugging(char *buf, int buflen) {
       
  5509   int len = (int)strlen(buf);
       
  5510   char *p = &buf[len];
       
  5511 
       
  5512   jio_snprintf(p, buflen-len,
       
  5513              "\n\n"
       
  5514              "Do you want to debug the problem?\n\n"
       
  5515              "To debug, attach Visual Studio to process %d; then switch to thread 0x%x\n"
       
  5516              "Select 'Yes' to launch Visual Studio automatically (PATH must include msdev)\n"
       
  5517              "Otherwise, select 'No' to abort...",
       
  5518              os::current_process_id(), os::current_thread_id());
       
  5519 
       
  5520   bool yes = os::message_box("Unexpected Error", buf);
       
  5521 
       
  5522   if (yes) {
       
  5523     // os::breakpoint() calls DebugBreak(), which causes a breakpoint
       
  5524     // exception. If VM is running inside a debugger, the debugger will
       
  5525     // catch the exception. Otherwise, the breakpoint exception will reach
       
  5526     // the default windows exception handler, which can spawn a debugger and
       
  5527     // automatically attach to the dying VM.
       
  5528     os::breakpoint();
       
  5529     yes = false;
       
  5530   }
       
  5531   return yes;
       
  5532 }
  5509 
  5533 
  5510 #ifndef JDK6_OR_EARLIER
  5534 #ifndef JDK6_OR_EARLIER
  5511 
  5535 
  5512 void os::Kernel32Dll::initialize() {
  5536 void os::Kernel32Dll::initialize() {
  5513   initializeCommon();
  5537   initializeCommon();