diff --git a/FWCore/Services/plugins/InitRootHandlers.cc b/FWCore/Services/plugins/InitRootHandlers.cc index ee4c24979cc74..408fe9a8cd2b9 100644 --- a/FWCore/Services/plugins/InitRootHandlers.cc +++ b/FWCore/Services/plugins/InitRootHandlers.cc @@ -124,6 +124,7 @@ namespace edm { bool resetErrHandler_; bool loadAllDictionaries_; bool autoLibraryLoader_; + bool interactiveDebug_; std::shared_ptr sigBusHandler_; std::shared_ptr sigSegvHandler_; std::shared_ptr sigIllHandler_; @@ -750,7 +751,8 @@ namespace edm { unloadSigHandler_(pset.getUntrackedParameter("UnloadRootSigHandler")), resetErrHandler_(pset.getUntrackedParameter("ResetRootErrHandler")), loadAllDictionaries_(pset.getUntrackedParameter("LoadAllDictionaries")), - autoLibraryLoader_(loadAllDictionaries_ or pset.getUntrackedParameter("AutoLibraryLoader")) { + autoLibraryLoader_(loadAllDictionaries_ or pset.getUntrackedParameter("AutoLibraryLoader")), + interactiveDebug_(pset.getUntrackedParameter("InteractiveDebug")) { stackTracePause_ = pset.getUntrackedParameter("StackTracePauseTime"); if (unloadSigHandler_) { @@ -870,6 +872,8 @@ namespace edm { ->setComment( "If True, do an abort when a signal occurs that causes a crash. If False, ROOT will do an exit which " "attempts to do a clean shutdown."); + desc.addUntracked("InteractiveDebug", false)->setComment("If True, leave gdb attached to cmsRun after a crash; " + "if False, attach gdb, print a stack trace, and quit gdb"); desc.addUntracked("DebugLevel", 0)->setComment("Sets ROOT's gDebug value."); desc.addUntracked("StackTracePauseTime", 300) ->setComment("Seconds to pause other threads during stack trace."); @@ -889,15 +893,19 @@ namespace edm { //In that case, we are already all setup return; } - if (snprintf(pidString_, - pidStringLength_ - 1, - "date; gdb -quiet -p %d 2>&1 <= pidStringLength_) { std::ostringstream sstr; sstr << "Unable to pre-allocate stacktrace handler information";