From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0NW+JxG5vl8kFwAAWB0awg (envelope-from ) for ; Wed, 25 Nov 2020 15:05:37 -0500 Received: by simark.ca (Postfix, from userid 112) id A0B481F0AB; Wed, 25 Nov 2020 15:05:37 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E3B1F1E552 for ; Wed, 25 Nov 2020 15:05:36 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4E948384A032; Wed, 25 Nov 2020 20:05:36 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id F1EEB3851C1A for ; Wed, 25 Nov 2020 20:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F1EEB3851C1A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EE9BBAC48; Wed, 25 Nov 2020 20:05:32 +0000 (UTC) To: Gary Benson , Tom Tromey , Gary Benson via Gdb-patches References: <1605547055-25778-1-git-send-email-gbenson@redhat.com> <87mtzek5fv.fsf@tromey.com> <0a3f590c-2a76-e470-136f-e8f88aef1d17@suse.de> <87y2iwgh90.fsf@tromey.com> <55e92b95-8b3b-6c4f-a572-9d7f836a1758@suse.de> <874klkgeff.fsf@tromey.com> <20201125145014.GA16439@blade.nx> <20201125152527.GA17604@blade.nx> From: Tom de Vries Subject: Re: [PATCH][gdb/symtab] Fix gdb.base/vla-optimized-out.exp with clang Message-ID: <47a57380-6fe8-53b6-cde9-98dc04f986dc@suse.de> Date: Wed, 25 Nov 2020 21:05:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201125152527.GA17604@blade.nx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 11/25/20 4:25 PM, Gary Benson wrote: > Gary Benson wrote: >> Thank you for picking this up Tom (de Vries). Your patch looks good, >> however I wanted to point out that the location expressions Clang >> generates for gdb.base/vla-ptr.exp don't end with DW_OP_stack_value: >> >> < 2><0x000000a3> DW_TAG_variable >> DW_AT_location len 0x0002: 9168: DW_OP_fbreg -24 >> DW_AT_name __vla_expr0 >> DW_AT_type <0x00000118> >> DW_AT_artificial yes(1) >> < 2><0x000000af> DW_TAG_variable >> DW_AT_location len 0x0002: 9160: DW_OP_fbreg -32 >> DW_AT_name __vla_expr1 >> DW_AT_type <0x00000118> >> DW_AT_artificial yes(1) >> >> It wasn't obvious to me how GDB with your patch would handle these. >> Did you check your patch using that test? > Yes. > I forgot to add, that I did, and the final test failed with my setup: > > gdb.base/vla-ptr.exp > ... > print td_vla > GCC compiled: $6 = {4, 5, 6, 7, 8} > Clang-12 compiled: $6 = 0x7fffffffc0d0 > > But! This is potentially a different issue. I don't think that test > accesses the array's size, and I've definitely seen typedef-related > failures with Clang compared with GCC. > > (I don't need you to debug this for me, I'm just making sure you're > aware!) Yes, I've seen this, I've filed a clang PR ( https://bugs.llvm.org/show_bug.cgi?id=48247 ), then committed an xfail in gdb ( https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=da39d3ba57639b715dea7ce68b6a4a3d70dfcb03 ). Thanks, - Tom