From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id 438A43858402 for ; Fri, 24 Sep 2021 15:20:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 438A43858402 Received: by mail-io1-xd30.google.com with SMTP id e82so12958771iof.5 for ; Fri, 24 Sep 2021 08:20:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=iW0JxU/kMAato2kgOHOOC8R/8NtzFHCzD4DgSPi9qtM=; b=2vl0X7Itt33zHG7UIh6NVbLKDtnahhKpn3GDZzDW8F4V2Jg/JnKz/qN1K8dOyvcgSj 1XjQYJ12D4ag1p5MyGcqcPXLnPwO67oFQtAZIpcCNFPJH7hDDqAWFgVPOxZYL9gU9cD3 PIAlyalNSyxeSq7QgXabV2TI2xffUu0qBGyu34WnxVWpf9ODmUvNmv96VGxNa2ZUX6RS qfWy6DAMQWzpvs5FUOe39bPLCLhHFbStG5I7Kk7jRXrxEzk6Uz7+6zhOUdSLBbBNdWz0 aSKsHnQLQwGFXvH3ahzVOQIN/YfL+BaQiU0Z+rvgAAcTSXYsAGca1XQCSpEN+ziwrmlf qGvw== X-Gm-Message-State: AOAM533QW0LKPC1AtJNDe5+MpqG07jPGuBZWoh4VsIypoJhKAE4Z+EDQ /HRtb0sYEacS/kecjdZXW65n5Q== X-Google-Smtp-Source: ABdhPJxl3/faCVfA5Admr9z6muE3KF4tgHWB2yukXqGTzHCCqq9vAYJoY4RgDAFKlNY6xmOlzfEhUg== X-Received: by 2002:a02:710d:: with SMTP id n13mr9614507jac.31.1632496807103; Fri, 24 Sep 2021 08:20:07 -0700 (PDT) Received: from murgatroyd (174-16-0-219.hlrn.qwest.net. [174.16.0.219]) by smtp.gmail.com with ESMTPSA id h1sm3767856iow.12.2021.09.24.08.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 08:20:06 -0700 (PDT) From: Tom Tromey To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix handling of DW_AT_data_bit_offset References: <20210823191743.509898-1-tromey@adacore.com> <87mtomj37i.fsf@tromey.com> <87ilzaj0hp.fsf@tromey.com> X-Attribution: Tom Date: Fri, 24 Sep 2021 09:20:04 -0600 In-Reply-To: <87ilzaj0hp.fsf@tromey.com> (Tom Tromey's message of "Wed, 08 Sep 2021 14:06:26 -0600") Message-ID: <87lf3m2e6z.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 24 Sep 2021 15:20:10 -0000 >>>>> "Tom" == Tom Tromey writes: Tom> A new test case is included. This test fails with GCC 11, but passes Tom> with an earlier version of GCC. >> I'm checking this in now. Tom> I spoke too soon - the new test fails now with the Fedora 34 system gcc. Tom> I'll debug it a bit and see what sort of change is needed. I finally looked. The working DWARF has an array in a structure that looks like: <3><11f9>: Abbrev Number: 10 (DW_TAG_array_type) <11fa> DW_AT_name : (indirect string, offset: 0x1a4d): pr__response__T2b <11fe> DW_AT_type : <0x1248> <1202> DW_AT_sibling : <0x1210> <4><1206>: Abbrev Number: 11 (DW_TAG_subrange_type) <1207> DW_AT_type : <0x1241> <120b> DW_AT_upper_bound : <0x11a7> ... where the upper bound points at the first member of the enclosing struct. However, the failing DWARF does: <3><1058>: Abbrev Number: 11 (DW_TAG_array_type) <1059> DW_AT_name : (indirect string, offset: 0x1a87): pr__response__T2b <105d> DW_AT_type : <0x10a7> <1061> DW_AT_sibling : <0x106f> <4><1065>: Abbrev Number: 12 (DW_TAG_subrange_type) <1066> DW_AT_type : <0x10a0> <106a> DW_AT_upper_bound : 3 byte block: 97 94 4 (DW_OP_push_object_address; DW_OP_deref_size: 4) Here, and I think correctly, gdb uses the address of the array in the struct as the object address -- but gcc apparently expects the object address to be the address of the enclosing structure. This fix is in gcc 12, so I'm going to update the test case to xfail for earlier versions of gcc, and then check it in. Tom