From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qN+UIRLLfGJ50wUAWB0awg (envelope-from ) for ; Thu, 12 May 2022 04:53:38 -0400 Received: by simark.ca (Postfix, from userid 112) id 7BCE91E220; Thu, 12 May 2022 04:53:38 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Ug4h8TFH; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.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 0743A1E00D for ; Thu, 12 May 2022 04:53:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 45BA8384F01F for ; Thu, 12 May 2022 08:53:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45BA8384F01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652345617; bh=HJHHanAbg61pKCxzbUwUQ5NHhZ0QxYii0f6tE9f8jXc=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Ug4h8TFHyyDx/lJ94r9a7NLdUVnHQj+Qk0YJhQt3sJ0Htoe6ZukplTC5rrZyUS4U/ 91LtEWU/ZcMAD8mw6itHe6l/xYUTnZoHshsl4Fupk9geQHF7Fd7iA/SqoZfYBSYlio 9aL+jliMXgkVveyrxXG3WjPquAzVwtbzzyGecBic= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 87DB838515D1 for ; Thu, 12 May 2022 08:53:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 87DB838515D1 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BB3BA1F8CA; Thu, 12 May 2022 08:53:17 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9FDEC13ABE; Thu, 12 May 2022 08:53:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ns7iJf3KfGJYJAAAMHmgww (envelope-from ); Thu, 12 May 2022 08:53:17 +0000 Date: Thu, 12 May 2022 10:53:16 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/dw2-out-of-range-end-of-seq.exp on aarch64 Message-ID: <20220512085314.GA6078@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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, On aarch64-linux, with test-case gdb.dwarf2/dw2-out-of-range-end-of-seq.exp I run into: ... (gdb) run ^M Starting program: dw2-out-of-range-end-of-seq ^M ^M Program received signal SIGILL, Illegal instruction.^M main () at src/gdb/testsuite/gdb.dwarf2/main.c:1^M 1 /* This testcase is part of GDB, the GNU debugger.^M (gdb) FAIL: gdb.dwarf2/dw2-out-of-range-end-of-seq.exp: runto: run to main ... There are two problems here: - the test-case contains a hardcoded "DW_LNS_advance_pc 1" which causes the breakpoint pointing in the middle of an insn - the FAIL triggers on aarch64-linux, but not on x86_64-linux, because the test-case uses 'main_label' as the address of the first and only valid entry in the line table, and: - on aarch64-linux, there's no prologue, so main_label and main coincide, while - on x86_64-linux, there's a prologue, so main_label is different from main. Fix these problems by: - eliminating the use of "DW_LNS_advance_pc 1", and using "DW_LNE_set_address $main_end" instead, and - eliminating the use of main_label, using "DW_LNE_set_address $main_start" instead. Tested on both x86_64-linux and aarch64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.dwarf2/dw2-out-of-range-end-of-seq.exp on aarch64 --- gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp index b8da03ddb3d..f030e1edc1f 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp @@ -35,10 +35,16 @@ if !$gcc_compiled { standard_testfile main.c -dw.S +set func_info_vars [get_func_info main] + set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { declare_labels Llines global srcdir subdir srcfile + global func_info_vars + foreach var $func_info_vars { + global $var + } cu {} { compile_unit { @@ -48,7 +54,9 @@ Dwarf::assemble $asm_file { } { subprogram { {external 1 flag} - {MACRO_AT_func {main}} + {name main} + {low_pc $main_start} + {high_pc $main_end addr} } } } @@ -58,11 +66,11 @@ Dwarf::assemble $asm_file { file_name "$srcfile" 1 program { - DW_LNE_set_address main_label + DW_LNE_set_address $main_start line 1 DW_LNS_copy - DW_LNS_advance_pc 1 + DW_LNE_set_address $main_end DW_LNE_end_sequence DW_LNE_set_address 0