From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PqSsMk3mU2I7IgAAWB0awg (envelope-from ) for ; Mon, 11 Apr 2022 04:26:53 -0400 Received: by simark.ca (Postfix, from userid 112) id BD3B51F202; Mon, 11 Apr 2022 04:26:53 -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=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 4662C1E150 for ; Mon, 11 Apr 2022 04:26:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DB4E385CFC0 for ; Mon, 11 Apr 2022 08:26:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DB4E385CFC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649665612; bh=Wl8qLPnHUMQ6l8ZaBpSN/RibX8sm6oTVih4v9FPAKjI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=uYzYhQRA9MJXTliix2BJ/T7ePuvpKq8Wk19i60qbOOFHJunZUYcrdbGUbcAMFr+s8 WbRm8yRAcQqMGElE3ARnbw0UY4wc/6kkp8pnRlEc/usVdvxG9KlaD00f5gqh1Kh3m1 LEMxdF/sAYmKG8t/Apq9fxkOrMvcDsc7jXMc+3kw= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id E1A1D3858418 for ; Mon, 11 Apr 2022 08:26:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1A1D3858418 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 0F26F1F38C for ; Mon, 11 Apr 2022 08:26:33 +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 ECA0C13AB5 for ; Mon, 11 Apr 2022 08:26:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dEJYODjmU2KCLQAAMHmgww (envelope-from ) for ; Mon, 11 Apr 2022 08:26:32 +0000 Date: Mon, 11 Apr 2022 10:26:31 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp for m32 pie Message-ID: <20220411082630.GA31063@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, As reported in PR29043, when running test-case gdb.dwarf2/dw2-lines.exp with target board unix/-m32/-fPIE/-pie, we run into: ... Breakpoint 2, 0x56555540 in bar ()^M (gdb) PASS: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: \ continue to breakpoint: foo \(1\) next^M Single stepping until exit from function bar,^M which has no line number information.^M 0x56555587 in main ()^M (gdb) FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: \ next to foo (2) ... The problem is that the bar breakpoint ends up at an unexpected location because: - the synthetic debug info is incomplete and doesn't provide line info for the prologue part of the function, so consequently gdb uses the i386 port prologue skipper to get past the prologue - the i386 port prologue skipper doesn't get past a get_pc_thunk call. Work around this in the test-case by breaking on bar_label instead. Tested on x86_64-linux with target boards unix, unix/-m32, unix/-fPIE/-pie and unix/-m32/-fPIE/-pie. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp for m32 pie --- gdb/testsuite/gdb.dwarf2/dw2-lines.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp index e36064460fd..3cbbd28fd48 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp @@ -114,7 +114,7 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} { return -1 } - gdb_breakpoint "bar" + gdb_breakpoint "bar_label" gdb_continue_to_breakpoint "foo \\(1\\)" gdb_test "next" "foo \\(2\\).*" "next to foo (2)"