3 #include "TEveManager.h"
5 #include "TApplication.h"
6 #include "TSysEvtHandler.h"
34 SilentMLscribe(
const SilentMLscribe&);
36 const SilentMLscribe&
operator=(
const SilentMLscribe&);
70 void signal_handler_wrapper(
int sid, siginfo_t* sinfo,
void* sctx)
72 std::cerr <<
"Program received signal ID = " << sid << std::endl;
73 std::cerr <<
"Printing stack trace ... " << std::endl;
75 TString gdbCommand(
"scripts/gdb-backtrace.sh");
79 #if defined(R__MACOSX)
80 gdbCommand += TString::Format(
"%s/cmsShow.exe %d", gSystem->Getenv(
"SHELLDIR"), gSystem->GetPid());
82 #elif defined(R__LINUX)
83 gdbCommand += gSystem->GetPid();
86 gSystem->Exec(gdbCommand.Data());
88 Getlinem(kCleanUp, 0);
98 std::auto_ptr<CmsShowMain> pMain(
new CmsShowMain(argc,argv) );
102 gSystem->ResetSignal(kSigBus);
103 gSystem->ResetSignal(kSigSegmentationViolation);
104 gSystem->ResetSignal(kSigIllegalInstruction);
105 gSystem->ResetSignal(kSigSystem);
106 gSystem->ResetSignal(kSigPipe);
107 gSystem->ResetSignal(kSigFloatingException);
109 struct sigaction sac;
110 sac.sa_sigaction = signal_handler_wrapper;
111 sigemptyset(&sac.sa_mask);
112 sac.sa_flags = SA_SIGINFO;
113 sigaction(SIGILL, &sac, 0);
114 sigaction(SIGSEGV, &sac, 0);
115 sigaction(SIGBUS, &sac, 0);
116 sigaction(SIGFPE, &sac, 0);
121 TEveManager::Terminate();
130 const char* dummyArgvArray[] = {
"cmsShow"};
131 char** dummyArgv =
const_cast<char**
>(dummyArgvArray);
133 gEnv->SetValue(
"Gui.BackgroundColor",
"#9f9f9f");
137 if (gSystem->Getenv(
"CMSSW_VERSION"))
139 infoText = gSystem->Getenv(
"CMSSW_VERSION");
143 TString infoFileName(
"data/version.txt");
145 ifstream infoFile(infoFileName);
146 infoText.ReadLine(infoFile);
149 printf(
"Starting cmsShow, version %s.\n", infoText.Data());
156 if (strncmp(argv[
i],
"-r", 2) == 0 ||
157 strncmp(argv[i],
"--root", 6) == 0)
166 std::cerr<<
"WARNING:You are running cmsShow with ROOT prompt enabled."<<std::endl;
167 std::cerr<<
"If you encounter an issue you suspect to be a bug in "<<std::endl;
168 std::cerr<<
"cmsShow, please re-run without this option and try to "<<std::endl;
169 std::cerr<<
"reproduce it before submitting a bug-report. "<<std::endl;
172 TRint app(
"cmsShow", &dummyArgc, dummyArgv);
175 TApplication app(
"cmsShow", &dummyArgc, dummyArgv);
181 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)