Search code examples
c++c++11debuggingc++14error-logging

How can I get some information about crashed program in c++ for future debugging


I would like to know is there any way to capture some information when a program crashes in c++. This information can be used for future debugging by developers. For example, this information provides that my program crashes in which line of code and in which function or preferably why.


Solution

  • google::InstallFailureSignalHandler(); can provide us the information. It also automatically prints call stack. It is very easy to use. For more information please see http://rpg.ifi.uzh.ch/docs/glog.html