From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48404 invoked by alias); 9 Jul 2017 18:28:03 -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 48325 invoked by uid 89); 9 Jul 2017 18:28:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*tom, disagree, perfect X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Jul 2017 18:27:59 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v69IRqS6028630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 9 Jul 2017 14:27:57 -0400 Received: by simark.ca (Postfix, from userid 112) id 2416E1EF05; Sun, 9 Jul 2017 14:27:52 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 29AE91EF01; Sun, 9 Jul 2017 14:27:50 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 09 Jul 2017 18:28:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] compile-loc2c: Fix uninitialized variable error In-Reply-To: <8760f1o8zm.fsf@tromey.com> References: <1497124148-11187-1-git-send-email-simon.marchi@ericsson.com> <3ec2d2df8170bea2b43c095996ad7278@polymtl.ca> <8760f1o8zm.fsf@tromey.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 9 Jul 2017 18:27:52 +0000 X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00049.txt.bz2 On 2017-07-09 18:44, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Sorry about the delay on this. I've been away. > >>> * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Read >>> address when op is DW_OP_addr. > > Simon> As you are the original author of that code, would it be > possible for > Simon> you to take a quick look, if you remember any of this :) ? > > This patch looks correct to me. I'm sure the earlier state was just an > oversight. Thanks! Pushing it now. > FWIW in gimli's DWARF expression code, I separated the format decoder > from the evaluator to avoid this sort of problem. Each operation is > decoded to an object; and then evaluation is done using the object. > This isn't perfect, as different users of the decoded objects can still > disagree about the semantics of the operation, but an approach like > this > would have caught this bug. Indeed, that sounds like a good design. Simon