[yast-commit] r62669 - in /trunk/pkg-bindings: VERSION package/yast2-pkg-bindings.changes src/Y2PkgFunction.cc src/Y2PkgFunction.h
![](https://seccdn.libravatar.org/avatar/ff2cb327bf0a83604a58d72935bcf7ff.jpg?s=120&d=mm&r=g)
Author: lslezak Date: Fri Oct 22 10:30:07 2010 New Revision: 62669 URL: http://svn.opensuse.org/viewcvs/yast?rev=62669&view=rev Log: - put a backtrace to y2log when an unhandled excecptinon is caught in the global catch section for easy debugging - 2.20.2 Modified: trunk/pkg-bindings/VERSION trunk/pkg-bindings/package/yast2-pkg-bindings.changes trunk/pkg-bindings/src/Y2PkgFunction.cc trunk/pkg-bindings/src/Y2PkgFunction.h Modified: trunk/pkg-bindings/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/VERSION?rev=62669&r1... ============================================================================== --- trunk/pkg-bindings/VERSION (original) +++ trunk/pkg-bindings/VERSION Fri Oct 22 10:30:07 2010 @@ -1 +1 @@ -2.20.1 +2.20.2 Modified: trunk/pkg-bindings/package/yast2-pkg-bindings.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/package/yast2-pkg-bi... ============================================================================== --- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original) +++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Fri Oct 22 10:30:07 2010 @@ -3,6 +3,9 @@ - ignore just the failed repository during autorefresh, load the other repositories (bnc#620895) +- put a backtrace to y2log when an unhandled excecptinon is caught + in the global catch section for easy debugging +- 2.20.2 ------------------------------------------------------------------- Thu Sep 30 17:32:48 UTC 2010 - lslezak@suse.cz Modified: trunk/pkg-bindings/src/Y2PkgFunction.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Y2PkgFunction.cc... ============================================================================== --- trunk/pkg-bindings/src/Y2PkgFunction.cc (original) +++ trunk/pkg-bindings/src/Y2PkgFunction.cc Fri Oct 22 10:30:07 2010 @@ -35,6 +35,10 @@ #include <ycp/y2log.h> +// use backtrace_symbols() +#include <execinfo.h> + + Y2PkgFunction::Y2PkgFunction (string name, PkgFunctions* instance, unsigned int pos) : m_position (pos) , m_instance (instance) @@ -102,6 +106,26 @@ return true; } + void Y2PkgFunction::log_backtrace() + { + // see 'man backtrace_symbols' for more details + #define BACKTRACE_BUFFER_SIZE 100 + void *buffer[BACKTRACE_BUFFER_SIZE]; + int ptrs = backtrace(buffer, BACKTRACE_BUFFER_SIZE); + + char **strings = backtrace_symbols(buffer, ptrs); + if (strings != NULL) { + y2internal("-------- Backtrace begin (use c++filt tool for converting to symbols) --------"); + + for (int j = 0; j < ptrs; j++) + y2internal(" Frame %d: %s", j, strings[j]); + + y2internal("-------- Backtrace end --------"); + + free(strings); + } + } + YCPValue Y2PkgFunction::evaluateCall () { ycpmilestone ("Pkg Builtin called: %s", name().c_str() ); @@ -115,10 +139,12 @@ catch (const std::exception& excpt) { y2internal("Caught an unhandled exception: %s", excpt.what()); + log_backtrace(); } catch (...) { y2internal("Caught an unhandled exception"); + log_backtrace(); } return YCPNull (); Modified: trunk/pkg-bindings/src/Y2PkgFunction.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Y2PkgFunction.h?... ============================================================================== --- trunk/pkg-bindings/src/Y2PkgFunction.h (original) +++ trunk/pkg-bindings/src/Y2PkgFunction.h Fri Oct 22 10:30:07 2010 @@ -16,6 +16,8 @@ YCPValue m_param4; YCPValue m_param5; string m_name; + + void log_backtrace(); public: Y2PkgFunction (string name, PkgFunctions* instance, unsigned int pos); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn2.opensuse.org