-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stacktrace #4692
Comments
What about cross library calls when some unexported functions are on the stack? In one of our implementations to dump stack using
|
Symbols must exist for trace to work and in this case they seem to be missing. Probably best to ask in cpptrace or backtrace forums. |
* chore(CppUnit): disable MSVC secure warning * chore(Data): regenerate VS projects * chore(DataTest): regenerate VS projects * chore(Data/testsuite): regenerate VS projects * chore(DataTest): fix VS90 project * fix(ODBC): Failed to insert Poco::Nullable< Poco::Data::Date> data into MSSQL using ODBC #2808 * chore(Foundation): add Trace to VS project * chore(Trace): add Trace VS projects #4692 * fix: g++ and clang build #2808
Is your feature request related to a problem? Please describe.
When an exception occurs, it is often not easy to determine the location of it and the execution path leading to it.
Describe the solution you'd like
There should be a way to determine where an exception occurred and what exactly lead to it, ie a stack backtrace with reasonable amount of information that is readily available from the exception. This information should be automatically embedded into the exception message in
Poco::Exception
ctorsDescribe alternatives you've considered
Anything and everything, from embedding the location of the exception into the message string to using NDC. Helpful, but laborious and not fully satisfactory.
Additional context
After some research, the best solution available seems to be cpptrace.
Worklist:
Poco::Exception
POCO_ENABLE_TRACE
is defined (default off), otherwise nothing changes and there is no dependencyPOCO_ENABLE_TRACE
disables strippinglibbacktrace works well on Linux; on mac, it does not give any meaningful output (see discussion here)
CPPTRACE_GET_SYMBOLS_WITH_LIBDL
CPPTRACE_DEMANGLE_WITH_CXXABI
CPPTRACE_UNWIND_WITH_UNWIND
DWARF
should be the best choice for Mactried both clang built-in and separate libdwarf (a bit troubling due to LGPL mixed-in code), with poor results (see discussion here)
Tradeoffs:
Output from trace example, debug build
The text was updated successfully, but these errors were encountered: