Am Tue, 27 Feb 2018 23:12:51 +0530
schrieb Ramakanth Kesireddy <rama.k...@gmail.com>:

> Hi,
> 
> As mentioned in http://doc.qt.io/archives/qt-4.8/exceptionsafety.html, the
> below code is being used to catch the exceptions in application:-
> 
> QApplication app(argc, argv);
> ...
> try {
> app.exec();
> } catch (const std::bad_alloc &) {
> //clean up code and log the exception info
> // retrieve class name and method name of object
> return 0; // exit the application
> }
> 
> Please let me know if there any means to get the runtime object info like
> class name, method name(if possible line number) throwing the exception
> std::bad_alloc in catch block?

beside your origin question:
bad_alloc is mostly thrown due to too view memory for the request in question.
so when you continue your program, chances are good to see more bad_allocs.

to your question:
you may try stacktracers, like mentioned here: 
https://stackoverflow.com/a/691742

alex

-- 
/*
 *No violence, gentlemen -- no violence, I beg of you!  Consider the furniture!
 *    -- Sherlock Holmes
 */
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to