www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/12/14/06:32:37

Date: Sun, 14 Dec 1997 13:31:08 +0200 (IST)
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, Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Subject: `abort' with traceback
Message-ID: <Pine.SUN.3.91.971214132544.20627C-100000@is>
MIME-Version: 1.0

AFAIK, according to POSIX, `abort' should dump core.  In our environment,
this means a crash traceback.  The changes below make this happen. 

I would like to ask once again whether there is something magic about the 
fake exceptions used between exceptn.S and dpmiexcp.c (last time I asked, 
nobody answered).  I want to know if there are any dangers in inventing 
new fake exception numbers like the patches below do.

*** src/libc/ansi/stdlib/abort.c~0	Sun Oct  6 00:33:20 1996
--- src/libc/ansi/stdlib/abort.c	Sat Dec 13 15:11:02 1997
*************** void
*** 9,14 ****
--- 9,15 ----
  abort()
  {
    _write(STDERR_FILENO, msg, sizeof(msg)-1);
+   __asm__ __volatile__ ("movb $0x7f,%al;call ___djgpp_hw_exception");
    _exit(1);
  }
  
*** src/libc/go32/dpmiexcp.c~1	Sun Dec  7 13:59:52 1997
--- src/libc/go32/dpmiexcp.c	Sat Dec 13 15:12:06 1997
*************** except_to_sig(int excep)
*** 84,89 ****
--- 84,91 ----
        return SIGINT;
      else if(excep == 0x7a)
        return SIGQUIT;
+     else if(excep == 0x7f)	/* fake exception used by `abort' */
+       return SIGABRT;
      else
        return SIGILL;
    }
*************** do_faulting_finish_message(void)
*** 177,188 ****
    exception_names[signum];
    if (signum == 0x75)
      en = "Floating Point exception";
!   if (signum == 0x1b)
      en = "Control-Break Pressed";
!   if (signum == 0x79)
      en = "INTR key Pressed";
!   if (signum == 0x7a)
      en = "QUIT key Pressed";
    if (en == 0)
    {
      err("Exception ");
--- 179,192 ----
    exception_names[signum];
    if (signum == 0x75)
      en = "Floating Point exception";
!   else if (signum == 0x1b)
      en = "Control-Break Pressed";
!   else if (signum == 0x79)
      en = "INTR key Pressed";
!   else if (signum == 0x7a)
      en = "QUIT key Pressed";
+   else if (signum == 0x7f)
+     en = "Program Aborted";
    if (en == 0)
    {
      err("Exception ");

- Raw text -


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