3 #include "TEveManager.h"
5 #include "TApplication.h"
6 #include "TSysEvtHandler.h"
34 SilentMLscribe(
const SilentMLscribe&);
36 const SilentMLscribe&
operator=(
const SilentMLscribe&);
69 void signal_handler_wrapper(
int sid, siginfo_t* sinfo,
void* sctx)
71 std::cerr <<
"Program received signal ID = " << sid << std::endl;
72 std::cerr <<
"Printing stack trace ... " << std::endl;
74 TString gdbCommand(
"scripts/gdb-backtrace.sh");
78 #if defined(R__MACOSX)
79 gdbCommand += TString::Format(
"%s/cmsShow.exe %d", gSystem->Getenv(
"SHELLDIR"), gSystem->GetPid());
81 #elif defined(R__LINUX)
82 gdbCommand += gSystem->GetPid();
85 gSystem->Exec(gdbCommand.Data());
87 Getlinem(kCleanUp, 0);
97 std::auto_ptr<CmsShowMain> pMain(
new CmsShowMain(argc,argv) );
101 gSystem->ResetSignal(kSigBus);
102 gSystem->ResetSignal(kSigSegmentationViolation);
103 gSystem->ResetSignal(kSigIllegalInstruction);
104 gSystem->ResetSignal(kSigSystem);
105 gSystem->ResetSignal(kSigPipe);
106 gSystem->ResetSignal(kSigFloatingException);
108 struct sigaction sac;
109 sac.sa_sigaction = signal_handler_wrapper;
110 sigemptyset(&sac.sa_mask);
111 sac.sa_flags = SA_SIGINFO;
112 sigaction(SIGILL, &sac, 0);
113 sigaction(SIGSEGV, &sac, 0);
114 sigaction(SIGBUS, &sac, 0);
115 sigaction(SIGFPE, &sac, 0);
120 TEveManager::Terminate();
129 const char* dummyArgvArray[] = {
"cmsShow"};
130 char** dummyArgv =
const_cast<char**
>(dummyArgvArray);
132 gEnv->SetValue(
"Gui.BackgroundColor",
"#9f9f9f");
136 if (gSystem->Getenv(
"CMSSW_VERSION"))
138 infoText = gSystem->Getenv(
"CMSSW_VERSION");
142 TString infoFileName(
"data/version.txt");
144 std::ifstream infoFile(infoFileName);
145 infoText.ReadLine(infoFile);
148 printf(
"Starting cmsShow, version %s.\n", infoText.Data());
155 if (strncmp(argv[
i],
"-r", 2) == 0 ||
156 strncmp(argv[i],
"--root", 6) == 0)
165 std::cerr<<
"WARNING:You are running cmsShow with ROOT prompt enabled."<<std::endl;
166 std::cerr<<
"If you encounter an issue you suspect to be a bug in "<<std::endl;
167 std::cerr<<
"cmsShow, please re-run without this option and try to "<<std::endl;
168 std::cerr<<
"reproduce it before submitting a bug-report. "<<std::endl;
171 TRint app(
"cmsShow", &dummyArgc, dummyArgv);
174 TApplication app(
"cmsShow", &dummyArgc, dummyArgv);
180 std::cerr <<
"CmsShow unhandled exception "<<iException.what()<<std::endl;
static unsigned char messageLoggerScribeIsRunning
static void setMLscribe_ptr(boost::shared_ptr< edm::service::AbstractMLscribe > m)
void run_app(TApplication &app, int argc, char **argv)
static MessageDrop * instance()
void operator=(AbstractMLscribe const &)
static const unsigned char MLSCRIBE_RUNNING_INDICATOR
int main(int argc, char **argv)
virtual void runCommand(MessageLoggerQ::OpCode opcode, void *operand)