From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26874 invoked by alias); 14 Nov 2013 17:58:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26863 invoked by uid 89); 14 Nov 2013 17:58:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-we0-f175.google.com Received: from Unknown (HELO mail-we0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 14 Nov 2013 17:58:18 +0000 Received: by mail-we0-f175.google.com with SMTP id t60so2432970wes.34 for ; Thu, 14 Nov 2013 09:58:09 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.102.97 with SMTP id fn1mr3928558wib.32.1384451889191; Thu, 14 Nov 2013 09:58:09 -0800 (PST) Received: by 10.194.37.73 with HTTP; Thu, 14 Nov 2013 09:58:09 -0800 (PST) In-Reply-To: <5284B2BB.3090800@broadcom.com> References: <1384375392-32110-1-git-send-email-tromey@redhat.com> <5284B2BB.3090800@broadcom.com> Date: Thu, 14 Nov 2013 18:11:00 -0000 Message-ID: Subject: Re: [PATCH] use error, not internal_error, in dwarf2-frame.c From: Doug Evans To: Andrew Burgess Cc: gdb-patches@sourceware.org, Tom Tromey Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00379.txt.bz2 On Thu, Nov 14, 2013 at 3:23 AM, Andrew Burgess wrote: > On 13/11/2013 8:43 PM, Tom Tromey wrote: >> >> I think that gdb should not call internal_error for bad DWARF. >> Instead, it should simply throw an ordinary exception. > > Sounds reasonable. > >> >> diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c >> index e05236f..8f55e9f 100644 >> --- a/gdb/dwarf2-frame.c >> +++ b/gdb/dwarf2-frame.c >> @@ -680,8 +680,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"), >> break; >> >> default: >> - internal_error (__FILE__, __LINE__, >> - _("Unknown CFI encountered.")); >> + error (_("Unknown CFI encountered.")); > > I wonder if we could make this error message clearer? Will an "average" > user understand what a CFI is? How about something like: > > "Invalid DWARF debugging information: Unknown CFI encountered" > > This might give a better idea what is going on. If you agree then the > same applies to the rest of these errors too. > > Just a thought. There's a convention for the style of these kinds of messages in dwarf2read.c. IWBN to use the same convention here. "Dwarf Error: blah [in module %s]" E.g., if (header->version != 2 && header->version != 3 && header->version != 4) error (_("Dwarf Error: wrong version in compilation unit header " "(is %d, should be 2, 3, or 4) [in module %s]"), header->version, filename); I didn't check to see whether the file name is available in any of the instances in dwarf2-frame.c, but if available IWBN to print it.