I’d like to debug a GUI application running with TApplication. My problem is all my backtraces look like this:
#0 0x00007f6ea90a7438 in __GI_raise (sig=sig@entry=6)
#1 0x00007f6ea90a903a in __GI_abort () at abort.c:89
#2 0x00007f6ea96e184d in __gnu_cxx::__verbose_terminate_handler() ()
#3 0x00007f6ea96df6b6 in ?? ()
#4 0x00007f6ea96df701 in std::terminate() ()
#5 0x00007f6ea96df969 in __cxa_rethrow ()
#6 0x00007f6eaa1b8ebc in TSystem::Run() ()
#7 0x00007f6eaa1e190f in TApplication::Run(bool) ()
#8 0x000000000042b283 in main (argc=3, argv=<optimized out>)
is there a way to get information what happened in client classes running under the TApplication, such as where exactly the original exception was thrown?
Since the exception is thrown from ROOT library code, you will need a debug build of ROOT.
On LXPLUS you can get one e.g. with source /cvmfs/sft.cern.ch/lcg/views/LCG_102/x86_64-centos7-gcc11-dbg/setup.sh. Otherwise you will have to compile ROOT from source passing the extra cmake option -DCMAKE_BUILD_TYPE=Debug.
Additionally, if this is an interpreted macro rather than a compiled program, you will have to either transform it to a standard C++ compile program (e.g. adding a main function and including the required headers), or compile it via ACLiC (root macro.C+g, where + compiles via ACLiC rather than using the interpreter and g requests debug symbols), or use the ROOT master branch and have the special CLING_DEBUG=1 environment variable set when calling the interpreter.