Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add example backtrace in exceptions #278

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

patrickjwhite commented Aug 30, 2013

A pull request only for you to see the code...

I always find myself missing backtraces in c++ exceptions. I don't know if this is a totally terrible idea for some reason, but I tried this out and it works OK. The method it uses doesn't give line numbers, but you can at least find the function that the exception was thrown from.

I have only tested this on Linux, but if it makes sense could investigate other platforms.

Thoughts?

Contributor

tokiloki commented Sep 11, 2013

There is opened issue http://sourceforge.net/p/poco/bugs/567/ with more elaborate stacktrace. But I would like to see libunwind based implementation, like this https://github.com/facebook/folly/blob/master/folly/experimental/exception_tracer/StackTrace.c

Owner

aleks-f commented Sep 11, 2013

IMO, backtrace would be a welcome and helpful addition, more platforms we can cover, the better; the mentioned SF patch is probably a good starting point; it should be done in a similar fashion like e.g. Thread / ThreadImpl - front-end .cpp/.h, including and privately inheriting from platform-specific back-ends, with default front-end (for not implemented platforms) doing nothing. Also, I'd be inclined to have backtracing in Poco::Exception disabled by default through a preprocessor macro.

@aleks-f aleks-f added the enhancement label May 28, 2014

Owner

aleks-f commented Jan 26, 2015

@patrickjwhite : any plans to work on this?

@aleks-f aleks-f closed this Oct 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment