From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27138 invoked by alias); 9 Feb 2007 09:56:04 -0000 Received: (qmail 27094 invoked by uid 48); 9 Feb 2007 09:55:54 -0000 Date: Fri, 09 Feb 2007 09:56:00 -0000 Message-ID: <20070209095554.27093.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/30498] Support traceback (backtrace) on errors In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-02/txt/msg01001.txt.bz2 ------- Comment #8 from burnus at gcc dot gnu dot org 2007-02-09 09:55 ------- Hi, > I cannot judge how much work this would be, but would it be possible to extend > this patch a little further so that these backtraces can be requested by the > user? Well, this is possible if one combines this patch with the ISO C Bindings of our fortran-experiments branch. One could then simply use: integer, parameter :: SIGBUS = 7 integer :: res interface function kill(pid, signal) bind(c, name='kill') use :: ISO_C_BINDING integer(C_INT),value :: pid, signal integer(C_INT),bind(c) :: kill end function kill end interface res = kill(0,SIGBUS) To get a backtrace. Alternatively, with the current patch and the main branch, one only needs to generate somehow SIGSEGV, SIGFPE, SIGILL or SIGBUS. For instance as follows: -ffpe-trap=zero -fbacktrace with r = 0.0 r = 1.0/r which gives a nice backtrace. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30498