From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64874 invoked by alias); 29 May 2017 20:55:33 -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 64851 invoked by uid 89); 29 May 2017 20:55:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=played X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 May 2017 20:55:31 +0000 Received: by simark.ca (Postfix, from userid 33) id 76FF61E4E3; Mon, 29 May 2017 16:55:33 -0400 (EDT) To: Tom Tromey Subject: Re: [RFA] Fix size check in dwarf2_evaluate_loc_desc_full X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 29 May 2017 20:55:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <20170529162544.8652-1-tom@tromey.com> References: <20170529162544.8652-1-tom@tromey.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.5 X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00609.txt.bz2 On 2017-05-29 18:25, Tom Tromey wrote: > This Rust bug report: > > https://github.com/rust-lang/rust/issues/41970 > > noted an error from gdb. What is happening here (for me, the original > report had a different error) is that a pieced DWARF expression is not > writing to every byte in the resulting value. GDB errors in this > case. However, it seems to me that it is always valid to write fewer > bytes; the issue comes from writing too many -- that is, the test is > reversed. The test was also checking the sub-object, but this also > seems incorrect, as it's expected for the expression to write the > entirety of the enclosing object. So, this patch reverses the test > and applies it to the outer type, not the subobject type. Your explanation sounds sensible to me (and the tests suggests it's good). Andreas, since you played with DWARF pieces quite a bit, do you have an opinion on this? Would it be possible to test the error case as well by feeding bad DWARF info in the test case? Thanks! Simon