From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102941 invoked by alias); 14 May 2019 23:36:51 -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 102933 invoked by uid 89); 14 May 2019 23:36:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 May 2019 23:36:50 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44BCF308425C; Tue, 14 May 2019 23:36:49 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1ABE219C7C; Tue, 14 May 2019 23:36:49 +0000 (UTC) From: Sergio Durigan Junior To: Tom Tromey Cc: GDB Patches Subject: Re: [PATCH] Don't crash if dwarf_decode_macro_bytes's 'body' is NULL References: <871s124foc.fsf@tromey.com> <20190514205458.28796-1-sergiodj@redhat.com> <871s108z6j.fsf@tromey.com> Date: Tue, 14 May 2019 23:36:00 -0000 In-Reply-To: <871s108z6j.fsf@tromey.com> (Tom Tromey's message of "Tue, 14 May 2019 16:10:44 -0600") Message-ID: <87wois4nhr.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00342.txt.bz2 On Tuesday, May 14 2019, Tom Tromey wrote: >>>>>> "Sergio" == Sergio Durigan Junior writes: > > Sergio> OK for master? > > Sergio> gdb/ChangeLog: > Sergio> 2019-05-14 Sergio Durigan Junior > > Sergio> Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192 > Sergio> * dwarf2read.c (dwarf_decode_macro_bytes): Check whether 'body' is > Sergio> NULL, and complain if that's the case. > > Sergio> + complaint (_("debug info gives %s invalid macro definition " > Sergio> + "without body (corrupted?) at line %d"), > Sergio> + at_commandline ? _("command-line") > Sergio> + : _("in-file"), > Sergio> + line == 0 ? _("zero") : _("non-zero"), line); > > This seems weird since it doesn't use current_file, and if I'm reading > correctly, there are 3 arguments but only 2 % substitutions. The > compiler should catch the latter, so that's doubly strange. I think for > a complaint it's fine to emit a line==0 or whatever, mostly it's for > helping to track down the incorrect spot. Sorry, you're right, I left one extra argument there. I was testing the patch on a VM, where I had everything correct, but then I made some extra adjustments and forgot to remove the extra "line == 0 ? _("zero") : _("non-zero")". As for the filename, I was following what other complaints were doing. But I also agree that having a filename would be best. What do you think of: complaint (_("debug info gives %s invalid macro definition " "without body (corrupted?) at line %d" "on file %s"), at_commandline ? _("command-line") : _("in-file"), line, current_file->filename); ? Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/