$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r53766 - trunk/boost/test/impl
From: gennadiy.rozental_at_[hidden]
Date: 2009-06-09 01:08:44
Author: rogeeff
Date: 2009-06-09 01:08:42 EDT (Tue, 09 Jun 2009)
New Revision: 53766
URL: http://svn.boost.org/trac/boost/changeset/53766
Log:
Fixes #2435. Resolves compilation issues with older FreeBSD
Text files modified: 
   trunk/boost/test/impl/execution_monitor.ipp |    92 +++++++++++++++++++++++++++++++++------ 
   1 files changed, 77 insertions(+), 15 deletions(-)
Modified: trunk/boost/test/impl/execution_monitor.ipp
==============================================================================
--- trunk/boost/test/impl/execution_monitor.ipp	(original)
+++ trunk/boost/test/impl/execution_monitor.ipp	2009-06-09 01:08:42 EDT (Tue, 09 Jun 2009)
@@ -144,6 +144,25 @@
 #  include <signal.h>
 #  include <setjmp.h>
 
+#  if defined(__FreeBSD__)  
+
+#    ifndef SIGPOLL
+#      define SIGPOLL SIGIO
+#    endif
+
+#    if (__FreeBSD_version < 70100)
+
+#      define ILL_ILLADR 0 // ILL_RESAD_FAULT
+#      define ILL_PRVOPC ILL_PRIVIN_FAULT
+#      define ILL_ILLOPN 2 // ILL_RESOP_FAULT
+#      define ILL_COPROC ILL_FPOP_FAULT
+
+#      define BOOST_TEST_LIMITED_SIGNAL_DETAILS
+#      define BOOST_TEST_IGNORE_SIGCHLD
+
+#    endif 
+#  endif 
+
 #  if !defined(__CYGWIN__) && !defined(__QNXNTO__)
 #   define BOOST_TEST_USE_ALT_STACK
 #  endif
@@ -292,46 +311,53 @@
     switch( m_sig_info->si_signo ) {
     case SIGILL:
         switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
         case ILL_ILLOPC:
             report_error( execution_exception::system_fatal_error,
                           "signal: illegal opcode; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
-        case ILL_ILLOPN:
+        case ILL_ILLTRP:
             report_error( execution_exception::system_fatal_error,
-                          "signal: illegal operand; address of failing instruction: 0x%08lx",
+                          "signal: illegal trap; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
-        case ILL_ILLADR:
+        case ILL_PRVREG:
             report_error( execution_exception::system_fatal_error,
-                          "signal: illegal addressing mode; address of failing instruction: 0x%08lx",
+                          "signal: privileged register; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
-        case ILL_ILLTRP:
+        case ILL_BADSTK:
             report_error( execution_exception::system_fatal_error,
-                          "signal: illegal trap; address of failing instruction: 0x%08lx",
+                          "signal: internal stack error; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
-        case ILL_PRVOPC:
+#endif
+        case ILL_ILLOPN:
             report_error( execution_exception::system_fatal_error,
-                          "signal: privileged opcode; address of failing instruction: 0x%08lx",
+                          "signal: illegal operand; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
-        case ILL_PRVREG:
+        case ILL_ILLADR:
             report_error( execution_exception::system_fatal_error,
-                          "signal: privileged register; address of failing instruction: 0x%08lx",
+                          "signal: illegal addressing mode; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
-        case ILL_COPROC:
+        case ILL_PRVOPC:
             report_error( execution_exception::system_fatal_error,
-                          "signal: co-processor error; address of failing instruction: 0x%08lx",
+                          "signal: privileged opcode; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
-        case ILL_BADSTK:
+        case ILL_COPROC:
             report_error( execution_exception::system_fatal_error,
-                          "signal: internal stack error; address of failing instruction: 0x%08lx",
+                          "signal: co-processor error; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
+        default: 
+            report_error( execution_exception::system_fatal_error, 
+                          "signal: SIGILL, si_code: %d (illegal instruction; address of failing instruction: 0x%08lx)", 
+                          m_sig_info->si_addr, m_sig_info->si_code ); 
+            break;
         }
         break;
 
@@ -377,11 +403,17 @@
                           "signal: subscript out of range; address of failing instruction: 0x%08lx",
                           m_sig_info->si_addr );
             break;
+        default:
+            report_error( execution_exception::system_error,
+                          "signal: SIGFPE, si_code: %d (errnoneous arithmetic operations; address of failing instruction: 0x%08lx)",
+                          m_sig_info->si_addr, m_sig_info->si_code );
+            break;
         }
         break;
 
     case SIGSEGV:
         switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
         case SEGV_MAPERR:
             report_error( execution_exception::system_fatal_error,
                           "memory access violation at address: 0x%08lx: no mapping at fault address",
@@ -392,11 +424,18 @@
                           "memory access violation at address: 0x%08lx: invalid permissions",
                           m_sig_info->si_addr );
             break;
+#endif
+        default:
+            report_error( execution_exception::system_fatal_error,
+                          "signal: SIGSEGV, si_code: %d (memory access violation at address: 0x%08lx)",
+                          m_sig_info->si_addr, m_sig_info->si_code );
+            break;
         }
         break;
 
     case SIGBUS:
         switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
         case BUS_ADRALN:
             report_error( execution_exception::system_fatal_error,
                           "memory access violation at address: 0x%08lx: invalid address alignment",
@@ -412,11 +451,18 @@
                           "memory access violation at address: 0x%08lx: object specific hardware error",
                           m_sig_info->si_addr );
             break;
+#endif
+        default:
+            report_error( execution_exception::system_fatal_error,
+                          "signal: SIGSEGV, si_code: %d (memory access violation at address: 0x%08lx)",
+                          m_sig_info->si_addr, m_sig_info->si_code );
+            break;
         }
         break;
 
     case SIGCHLD:
         switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
         case CLD_EXITED:
             report_error( execution_exception::system_error,
                           "child has exited; pid: %d; uid: %d; exit value: %d",
@@ -447,6 +493,12 @@
                           "stopped child had continued; pid: %d; uid: %d; exit value: %d",
                           (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status );
             break;
+#endif
+        default:
+            report_error( execution_exception::system_error,
+                          "signal: SIGCHLD, si_code: %d (child process has terminated; pid: %d; uid: %d; exit value: %d)",
+                          (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status, m_sig_info->si_code );
+            break;
         }
         break;
 
@@ -454,6 +506,7 @@
 
     case SIGPOLL:
         switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
         case POLL_IN:
             report_error( execution_exception::system_error,
                           "data input available; band event %d",
@@ -486,6 +539,12 @@
                           (int)m_sig_info->si_band );
             break;
 #endif
+#endif
+        default: 
+            report_error( execution_exception::system_error, 
+                          "signal: SIGPOLL, si_code: %d (asynchronous I/O event occured; band event %d)", 
+                          (int)m_sig_info->si_band, m_sig_info->si_code ); 
+            break; 
         }
         break;
 
@@ -704,7 +763,10 @@
 
 static bool ignore_sigchild( siginfo_t* info )
 {
-    return info->si_signo == SIGCHLD && info->si_code == CLD_EXITED 
+    return info->si_signo == SIGCHLD
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
+            && info->si_code == CLD_EXITED 
+#endif
 #ifdef BOOST_TEST_IGNORE_NON_ZERO_CHILD_CODE
             ;
 #else