From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1ShjKlhJIWD2QAAAWB0awg (envelope-from ) for ; Mon, 08 Feb 2021 09:23:20 -0500 Received: by simark.ca (Postfix, from userid 112) id A192D1EF4F; Mon, 8 Feb 2021 09:23:20 -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 2E27E1E54D for ; Mon, 8 Feb 2021 09:23:20 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ADCCA3854821; Mon, 8 Feb 2021 14:23:19 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id B939F3854821 for ; Mon, 8 Feb 2021 14:23:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B939F3854821 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 C17CFAD24 for ; Mon, 8 Feb 2021 14:23:15 +0000 (UTC) Date: Mon, 8 Feb 2021 15:23:14 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Use DW_FORM_ref_addr in gdb.dwarf2/enqueued-cu-base-addr.exp Message-ID: <20210208142312.GA30011@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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" Hi, When running test-case gdb.dwarf2/enqueued-cu-base-addr.exp with target board cc-with-dwz, I get: ... gdb compile failed, dwz: enqueued-cu-base-addr: \ Couldn't find DIE at [100] referenced by DW_AT_type from DIE at [d8] ... At 0xd8 we have DIE: ... <1>: Abbrev Number: 3 (DW_TAG_variable) DW_AT_name : foo
DW_AT_type : <0x100> DW_AT_const_value : 1 ... referring to: ... <1><100>: Abbrev Number: 3 (DW_TAG_base_type) <101> DW_AT_byte_size : 4 <102> DW_AT_encoding : 5 (signed) <103> DW_AT_name : int ... The reference is inter-CU, but the used abbrev uses DW_FORM_ref4: ... 3 DW_TAG_variable [no children] DW_AT_name DW_FORM_string DW_AT_type DW_FORM_ref4 DW_AT_const_value DW_FORM_sdata DW_AT value: 0 DW_FORM value: 0 ... which is for intra-CU references. Fix this by using a '%' instead of a ':' label prefix in the dwarf assembly. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Use DW_FORM_ref_addr in gdb.dwarf2/enqueued-cu-base-addr.exp gdb/testsuite/ChangeLog: 2021-02-08 Tom de Vries * gdb.dwarf2/enqueued-cu-base-addr.exp: Fix inter-CU reference. --- gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp index 2b93bc87feb..3cf6b079908 100644 --- a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp +++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp @@ -50,7 +50,7 @@ Dwarf::assemble $asm_file { } { DW_TAG_variable { {name foo} - {type :$int_label} + {type %$int_label} {const_value 1 DW_FORM_sdata} } }