From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4gd5ExQSX2EnbgAAWB0awg (envelope-from ) for ; Thu, 07 Oct 2021 11:28:20 -0400 Received: by simark.ca (Postfix, from userid 112) id 39F291EE21; Thu, 7 Oct 2021 11:28:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 47B031EE1F for ; Thu, 7 Oct 2021 11:28:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E84B83857C47 for ; Thu, 7 Oct 2021 15:28:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E84B83857C47 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633620498; bh=EBBncixsXYGW4XdkFcsHTrWCYatYyGfVOwLVXCWBiP8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=yAdIPMf1CDxHjpa5dhHIFuh8XeEr1MAVdQgS3oU0zZ9bGEMB2x50OOxbxC1IFKL/l dJ32DBNADI3xPpaePWdYdPZZRVBj8RAZOZ3XWadcjdirPmAQQ3G7EXv+rjeAnskJGQ CQZltMCGEkQWnb20PuLtOnGvVxyJEtbYOXVjIqGU= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 388953857C71 for ; Thu, 7 Oct 2021 15:27:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 388953857C71 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 197FR1fM018710 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Oct 2021 11:27:06 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 197FR1fM018710 Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 491131E4A3; Thu, 7 Oct 2021 11:27:01 -0400 (EDT) Subject: Re: [PATCH][gdb/testsuite] Fix gdb.guile/scm-type.exp with gcc 4.8 To: Tom de Vries , gdb-patches@sourceware.org References: <20210915132528.GA29670@delia> Message-ID: <68468963-bfa7-a5a6-6987-6586397e53d1@polymtl.ca> Date: Thu, 7 Oct 2021 11:27:00 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210915132528.GA29670@delia> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 7 Oct 2021 15:27:01 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-09-15 9:25 a.m., Tom de Vries wrote: > Hi, > > With gcc 7.5.0, I get: > ... > (gdb) guile (print (type-range (field-type (type-field (value-type \ > (value-dereference f)) "items"))))^M > = (0 0)^M > (gdb) PASS: gdb.guile/scm-type.exp: lang_cpp: test_range: \ > on flexible array member: $cmd > ... > but with gcc 4.8.5, I get instead: > ... > (gdb) guile (print (type-range (field-type (type-field (value-type \ > (value-dereference f)) "items"))))^M > = (0 -1)^M > (gdb) FAIL: gdb.guile/scm-type.exp: lang_cpp: test_range: \ > on flexible array member: $cmd > ... > > There's a difference in debug info. With gcc 4.8.5, we have: > ... > <2><224>: Abbrev Number: 15 (DW_TAG_member) > <225> DW_AT_name : items > <22b> DW_AT_type : <0x231> > <1><231>: Abbrev Number: 4 (DW_TAG_array_type) > <232> DW_AT_type : <0x105> > <2><23a>: Abbrev Number: 16 (DW_TAG_subrange_type) > <23b> DW_AT_type : <0x11a> > <23f> DW_AT_upper_bound : 0xffffffffffffffff > ... > and with gcc 7.5.0, we have instead: > ... > <2><89f>: Abbrev Number: 12 (DW_TAG_member) > <8a0> DW_AT_name : items > <8a6> DW_AT_type : <0x8ac> > <1><8ac>: Abbrev Number: 17 (DW_TAG_array_type) > <8ad> DW_AT_type : <0x29d> > <2><8b5>: Abbrev Number: 41 (DW_TAG_subrange_type) > <2><8b6>: Abbrev Number: 0 > ... > > As mentioned in commit 858c8f2c1b9 "gdb/testsuite: adjust > gdb.python/flexible-array-member.exp expected pattern": > ... > Ideally, GDB would present a consistent and documented value for an > array member declared with size 0, regardless of how the debug info > looks like. > ... > > As in gdb.python/flexible-array-member.exp, change the test to accept the two > values. > > Tested on x86_64-linux. > > > Any comments? LGTM, thanks. Simon