From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 966A63857350; Wed, 26 Jul 2023 11:42:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 966A63857350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690371774; bh=g8w4S3n1Vq/0U1VRtmIxa/0IW1YSNL61o65A6uDIhN4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n+q7ctMyhzUs1EH/D3fR3/e17tEVL/UYT8GrhqBkblrFeddItRSUr5W0GoINz2VBy 2bfQMs69NBowQQaa66JLGEzz85pGVfbZX0OQ11h2L4ODqGF7+PrudsFOo1PhQcz9Jk NO1rGH1vKFK34hWqQs5XUKPmMnNYPjrfDXMQxIos= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/30633] [gdb/testsuite, native-gdbserver] FAIL: gdb.dwarf2/typeddwarf.exp: runto: run to main Date: Wed, 26 Jul 2023 11:42:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30633 --- Comment #2 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dbcf43b33cfd3= a8415bf272a3ca1af04ec8b9d622 commit bcf43b33cfd3a8415bf272a3ca1af04ec8b9d622 Author: Tom de Vries Date: Wed Jul 26 13:42:32 2023 +0200 [gdb/testsuite] Drop -nostdlib in gdb.dwarf2/typeddwarf.exp As reported in PR testsuite/30633, when running test-case gdb.dwarf2/typeddwarf.exp with target board native-gdbserver on Ubuntu 22.04.2, we run into: ... (gdb) continue^M Continuing.^M ^M Program received signal SIGSEGV, Segmentation fault.^M 0x0000000000000001 in ?? ()^M (gdb) FAIL: gdb.dwarf2/typeddwarf.exp: runto: run to main ... We run into the FAIL as follows: - due to using gdbserver, we attach at the point of the first instructi= on, in _start - we then set a breakpoint at main - the test-case is a .s file, that has main renamed to _start in the assembly, but not in the debuginfo - setting a breakpoint at main sets the breakpoint at the same instruct= ion we're currently stopped at - continue doesn't hit the breakpoint, and we return out of _start, whi= ch causes a sigsegv Note that this is for the amd64 case (using gdb.dwarf2/typeddwarf-amd64= .S). For the i386 case (using gdb.dwarf2/typeddwarf.S), setting a breakpoint= in main sets it one insn after function entry, and consequently the problem does not occur. The FAIL is a regression since commit 90cce6c0551 ("[gdb/testsuite] Add nopie in a few test-cases"). Without nopie the executable is PIE, with nopie it's static instead. In the PIE case, we attach at the point of _start in the dynamic linker, and consequently we do not skip the breakpoint in main, and also don't run = into the FAIL. Fix this by: - removing the -nostdlib setting, and - renaming _start to main in both .S files. The change to use -nostdlib and rename main to _start was originally ad= ded in commit 6edba76fe8b (submitted here: https://sourceware.org/pipermail/gdb-patches/2011-May/082657.html ) , I assume to fix the problem now fixed by using nopie. Tested on x86_64-linux. Reported-By: Simon Marchi Tested-By: Simon Marchi Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30633 --=20 You are receiving this mail because: You are on the CC list for the bug.=