From patchwork Mon Jan 9 22:33:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 135128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 16C92B6FD4 for ; Tue, 10 Jan 2012 09:34:06 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1326753248; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=iBtBjKgML+D3hJ4Yo27vThZmg8s=; b=qvFgktxK9zzkxdF ypEOYgywYaLo5ROf1ZCfoXwLZmB8KahtN0DPJjAARcbTSsigaZid65H01FP6KwPq b8gz7gIaea7uDDSGpQyAoC2dKzioblw9tl74VIVk2ZXqhypzSc2hcdLz/USRVt31 ODsPsgjc8Mel3m1Af5p4NNuNSD0I= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=P+1w6G2zgQwI1xfXFQfcLg04kVk5a/bmWB5qYZD0sNqHEsbMFh+mCs9a1KfTVV /BpVHDo5tsn9nZnEO8GWNWRiEdBfTiFFJSxa6AmtxzVJ8ERW9Z9rjBPXV5C7P7zW bzx/l3k7EGVOLeTO2mnGtDGe7AP8Pfx1P+AcX1kr7/9io=; Received: (qmail 5562 invoked by alias); 9 Jan 2012 22:34:02 -0000 Received: (qmail 5376 invoked by uid 22791); 9 Jan 2012 22:34:01 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Jan 2012 22:33:49 +0000 Received: from [192.168.178.22] (port-92-204-59-150.dynamic.qsc.de [92.204.59.150]) by mx01.qsc.de (Postfix) with ESMTP id 6EE0D3C943; Mon, 9 Jan 2012 23:33:47 +0100 (CET) Message-ID: <4F0B6B4A.8010203@net-b.de> Date: Mon, 09 Jan 2012 23:33:46 +0100 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Janne Blomqvist CC: gcc patches , gfortran Subject: Re: [Patch, Fortran] PR51197 - print signal number before backtrace [RFC] References: <4F0B3E3B.7040608@net-b.de> In-Reply-To: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Dear Janne, > - The integer values for the signal numbers are not standardized, > hence printing them might give the user a false impression that these > numbers convey some information beyond whichever SIG* macro they map > to on that particular target. > > - It doesn't test all the signals which are actually handled, see > compile_options.c:set_options(). Also, as a minor point, there's no > need to have #ifdef tests for the C89 signals, again see > set_options(). How about the attached version? The description is based on IEEE Std 1003.1:2003, though I additionally left "segmentation fault" and "floating-point exception" as those names are presumably better known that the long description and as SIGSEGV/SIGFPE. "Bus error" is also somewhat known, but SIGBUS should be sufficient. Tobias 2012-01-09 Tobias Burnus PR fortran/51197 * runtime/compile_options.c (show_signal): List more signals. Index: libgfortran/runtime/compile_options.c =================================================================== --- libgfortran/runtime/compile_options.c (Revision 183034) +++ libgfortran/runtime/compile_options.c (Arbeitskopie) @@ -43,37 +43,72 @@ show_signal (int signum) switch (signum) { -#if defined(SIGSEGV) +#if defined(SIGQUIT) + case SIGQUIT: + name = "SIGQUIT"; + desc = "Terminal quit signal"; + break; +#endif + + /* The following 4 signals are defined by C89. */ + case SIGILL: + name = "SIGILL"; + desc = "Illegal instruction"; + break; + + case SIGABRT: + name = "SIGABRT"; + desc = "Process abort signal"; + break; + + case SIGFPE: + name = "SIGFPE"; + desc = "Floating-point exception - erroneous arithmetic operation"; + break; + case SIGSEGV: name = "SIGSEGV"; - desc = "Segmentation fault"; + desc = "Segmentation fault - invalid memory reference"; break; -#endif #if defined(SIGBUS) case SIGBUS: name = "SIGBUS"; - desc = "Bus error"; + desc = "Access to an undefined portion of a memory object"; break; #endif -#if defined(SIGILL) - case SIGILL: - name = "SIGILL"; - desc = "Illegal instruction"; +#if defined(SIGSYS) + case SIGSYS: + name = "SIGSYS"; + desc = "Bad system call"; break; #endif -#if defined(SIGFPE) - case SIGFPE: - name = "SIGFPE"; - desc = "Floating-point exception"; +#if defined(SIGTRAP) + case SIGTRAP: + name = "SIGTRAP"; + desc = "Trace/breakpoint trap"; break; #endif + +#if defined(SIGXCPU) + case SIGXCPU: + name = "SIGXCPU"; + desc = "CPU time limit exceeded"; + break; +#endif + +#if defined(SIGXFSZ) + case SIGXFSZ: + name = "SIGXFSZ"; + desc = "File size limit exceeded"; + break; +#endif } if (name) - st_printf ("\nProgram received signal %d (%s): %s.\n", signum, name, desc); + st_printf ("\nProgram received signal %s: %s.\n", name, desc); else st_printf ("\nProgram received signal %d.\n", signum); }