src/share/vm/utilities/vmError.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8028468 Sdiff src/share/vm/utilities

src/share/vm/utilities/vmError.cpp

Print this page




1023     char* cmd;
1024     const char* ptr = OnError;
1025     while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){
1026       out.print_raw   ("#   Executing ");
1027 #if defined(LINUX) || defined(_ALLBSD_SOURCE)
1028       out.print_raw   ("/bin/sh -c ");
1029 #elif defined(SOLARIS)
1030       out.print_raw   ("/usr/bin/sh -c ");
1031 #endif
1032       out.print_raw   ("\"");
1033       out.print_raw   (cmd);
1034       out.print_raw_cr("\" ...");
1035 
1036       os::fork_and_exec(cmd);
1037     }
1038 
1039     // done with OnError
1040     OnError = NULL;
1041   }
1042 
1043   static bool skip_replay = false;
1044   if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) {
1045     skip_replay = true;
1046     ciEnv* env = ciEnv::current();
1047     if (env != NULL) {
1048       int fd = prepare_log_file(ReplayDataFile, "replay_pid%p.log", buffer, sizeof(buffer));
1049       if (fd != -1) {
1050         FILE* replay_data_file = os::open(fd, "w");
1051         if (replay_data_file != NULL) {
1052           fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
1053           env->dump_replay_data_unsafe(&replay_data_stream);
1054           out.print_raw("#\n# Compiler replay data is saved as:\n# ");
1055           out.print_raw_cr(buffer);
1056         } else {
1057           out.print_raw("#\n# Can't open file to dump replay data. Error: ");
1058           out.print_raw_cr(strerror(os::get_last_error()));
1059         }
1060       }
1061     }
1062   }
1063 




1023     char* cmd;
1024     const char* ptr = OnError;
1025     while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){
1026       out.print_raw   ("#   Executing ");
1027 #if defined(LINUX) || defined(_ALLBSD_SOURCE)
1028       out.print_raw   ("/bin/sh -c ");
1029 #elif defined(SOLARIS)
1030       out.print_raw   ("/usr/bin/sh -c ");
1031 #endif
1032       out.print_raw   ("\"");
1033       out.print_raw   (cmd);
1034       out.print_raw_cr("\" ...");
1035 
1036       os::fork_and_exec(cmd);
1037     }
1038 
1039     // done with OnError
1040     OnError = NULL;
1041   }
1042 
1043   static bool skip_replay = ReplayCompiles; // Do not overwite file during replay
1044   if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) {
1045     skip_replay = true;
1046     ciEnv* env = ciEnv::current();
1047     if (env != NULL) {
1048       int fd = prepare_log_file(ReplayDataFile, "replay_pid%p.log", buffer, sizeof(buffer));
1049       if (fd != -1) {
1050         FILE* replay_data_file = os::open(fd, "w");
1051         if (replay_data_file != NULL) {
1052           fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
1053           env->dump_replay_data_unsafe(&replay_data_stream);
1054           out.print_raw("#\n# Compiler replay data is saved as:\n# ");
1055           out.print_raw_cr(buffer);
1056         } else {
1057           out.print_raw("#\n# Can't open file to dump replay data. Error: ");
1058           out.print_raw_cr(strerror(os::get_last_error()));
1059         }
1060       }
1061     }
1062   }
1063 


src/share/vm/utilities/vmError.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File