SVN: backtracexx: backtracexx.cpp backtracexx.hpp

pluto pluto at pld-linux.org
Thu Nov 15 20:34:53 CET 2007


Author: pluto
Date: Thu Nov 15 20:34:52 2007
New Revision: 9057

Modified:
   backtracexx/backtracexx.cpp
   backtracexx/backtracexx.hpp
Log:
- keep signalTrampoline flag as boost::logic::tribool.
- support gcc < 4.2.


Modified: backtracexx/backtracexx.cpp
==============================================================================
--- backtracexx/backtracexx.cpp	(original)
+++ backtracexx/backtracexx.cpp	Thu Nov 15 20:34:52 2007
@@ -72,14 +72,23 @@
 
 		_Unwind_Reason_Code helper( struct _Unwind_Context* ctx, Trace* trace )
 		{
-			int beforeInsn;
-			_Unwind_Ptr ip = _Unwind_GetIPInfo( ctx, &beforeInsn );
 			Frame frame;
-			frame.address = ip;
+			_Unwind_Ptr ip;
+
+#if ( __GNUC__ >= 4 ) && ( __GNUC_PATCHLEVEL__ >= 2 )
+
+			int beforeInsn;
+			ip = _Unwind_GetIPInfo( ctx, &beforeInsn );
 			if ( beforeInsn )
 				frame.signalTrampoline = true;
-			else
-				frame.address = frame.address;
+
+#else
+
+			ip = _Unwind_GetIP( ctx );
+
+#endif
+
+			frame.address = ip;
 			lookupSymbol( frame );
 			trace->push_back( frame );
 			return _URC_NO_REASON;
@@ -131,7 +140,7 @@
 
 	Frame::Frame()
 	:
-		address(), displacement(), lineNumber(), signalTrampoline()
+		address(), displacement(), lineNumber(), signalTrampoline( boost::logic::indeterminate )
 	{
 	}
 

Modified: backtracexx/backtracexx.hpp
==============================================================================
--- backtracexx/backtracexx.hpp	(original)
+++ backtracexx/backtracexx.hpp	Thu Nov 15 20:34:52 2007
@@ -1,6 +1,7 @@
 #ifndef backtracexx_hpp
 #define backtracexx_hpp
 
+#include <boost/logic/tribool.hpp>
 #include <iosfwd>
 #include <string>
 #include <list>
@@ -42,7 +43,7 @@
 		unsigned long moduleBaseAddress;
 		std::string fileName;
 		unsigned long lineNumber;
-		bool signalTrampoline;
+		boost::logic::tribool signalTrampoline;
 	};
 
 	typedef std::list< Frame > Trace;


More information about the pld-cvs-commit mailing list