delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/08/23/03:26:27

Date: Sun, 23 Aug 1998 10:25:25 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Message-ID: <Pine.SUN.3.91.980823102257.417B-100000@is>
MIME-Version: 1.0

As you might remember, when a user-defined SIGSEGV handler returns from a 
*real* exception, dpmiexcp.c prints only the signal numeric code, as 
opposed to the default handler which prints its mnemonic.  This small 
change makes all these cases print the same.

*** src/libc/go32/dpmiexcp.c~0	Sun Jun 28 23:32:32 1998
--- src/libc/go32/dpmiexcp.c	Mon Aug 17 12:05:30 1998
*************** signal(int sig, SignalHandler func)
*** 293,298 ****
--- 293,314 ----
  
  static const char signames[] = "ABRTFPE ILL SEGVTERMALRMHUP INT KILLPIPEQUITUSR1USR2NOFPTRAP";
  
+ static void print_signal_name(int sig)
+ {
+   err("Exiting due to signal ");
+   if (sig >= SIGABRT && sig <= SIGTRAP)
+   {
+     err("SIG");
+     _write(STDERR_FILENO, signames+(sig-SIGABRT)*4, 4);
+   }
+   else
+   {
+     err("0x");
+     itox(sig, 4);
+   }
+   err("\r\n");
+ }
+     
  void __djgpp_traceback_exit(int);
  
  void __djgpp_traceback_exit(int sig)
*************** void __djgpp_traceback_exit(int sig)
*** 316,331 ****
  	   inside exceptn.S, for SIGQUIT.  */
  	__djgpp_exception_state->__signum = 0x7a + 1 + sig - SIGABRT;
      }
- 
-     err("Exiting due to signal SIG");
-     _write(STDERR_FILENO, signames+(sig-SIGABRT)*4, 4);
    }
!   else
!   {
!     err("Exiting due to signal 0x");
!     itox(sig, 4);
!   }
!   err("\r\n");
    if(__djgpp_exception_state_ptr)
      /* This exits, does not return.  */
      do_faulting_finish_message(__djgpp_exception_state == fake_exception);
--- 332,339 ----
  	   inside exceptn.S, for SIGQUIT.  */
  	__djgpp_exception_state->__signum = 0x7a + 1 + sig - SIGABRT;
      }
    }
!   print_signal_name(sig);
    if(__djgpp_exception_state_ptr)
      /* This exits, does not return.  */
      do_faulting_finish_message(__djgpp_exception_state == fake_exception);
*************** __djgpp_exception_processor(void)
*** 369,377 ****
    if(__djgpp_exception_state->__signum >= EXCEPTION_COUNT) /* Not exception so continue OK */
      longjmp(__djgpp_exception_state, __djgpp_exception_state->__eax);
    /* User handler did not exit or longjmp, we must exit */
!   err("Cannot continue from exception, exiting due to signal ");
!   itox(sig, 4);
!   err("\r\n");
    do_faulting_finish_message(0);
  }
  
--- 377,384 ----
    if(__djgpp_exception_state->__signum >= EXCEPTION_COUNT) /* Not exception so continue OK */
      longjmp(__djgpp_exception_state, __djgpp_exception_state->__eax);
    /* User handler did not exit or longjmp, we must exit */
!   err("Cannot continue from exception, ");
!   print_signal_name(sig);
    do_faulting_finish_message(0);
  }
  

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019