From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7833) id 59A4F3858D28; Thu, 10 Nov 2022 09:43:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59A4F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668073411; bh=nYxjpN2JGO6106oyq8wDgTV9RUB9ljuBuxXdfH5nc5g=; h=From:To:Subject:Date:From; b=xYu8AL5R4SmnVkbCyXhdRQZRuV5rKPVXzcxSFpIL97vx3arp/MUyReoxOBcFkrRK6 Z53UF7RX7SA3XweuyU91bkxMUMcl608dYnW7gIBAKFWI5UZED2eogxM1gDUCe5LVGO FFKGSZeVdtmcN+pWIbOexcINSe9HIJiWVTfux+aU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Lancelot SIX To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: Fix rtld-step-nodebugsym.exp X-Act-Checkin: binutils-gdb X-Git-Author: Lancelot SIX X-Git-Refname: refs/heads/master X-Git-Oldrev: 64713044a4fa24a8694d7bfc9649f5d69b7e2ac1 X-Git-Newrev: f735116b3fb6dc30912e969d6e8c1b15bbaef510 Message-Id: <20221110094331.59A4F3858D28@sourceware.org> Date: Thu, 10 Nov 2022 09:43:31 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df735116b3fb6= dc30912e969d6e8c1b15bbaef510 commit f735116b3fb6dc30912e969d6e8c1b15bbaef510 Author: Lancelot SIX Date: Wed Nov 9 23:02:44 2022 +0000 gdb/testsuite: Fix rtld-step-nodebugsym.exp =20 The test case introduced in bafcc335266 (Fix stepping in rtld without debug symbol) fails on some systems as reported by PR/29768. This can be seen if the system does not have debug info for the libc: =20 (gdb) step^M Single stepping until exit from function main,^M which has no line number information.^M hello world[Inferior 1 (process 48203) exited normally]^M (gdb) PASS: gdb.base/rtld-step-nodebugsym.exp: step continue^M The program is not being run.^M (gdb) FAIL: gdb.base/rtld-step-nodebugsym.exp: continue until exit (t= he program is no longer running) =20 Without glibc debug info, GDB steps until the program finishes, and then "gdb_continue_to_end" fails. =20 As this test was designed to check that GDB does not crash in the "step" command, the continue does not carry real meaning to the test. =20 Replace it by "print 0" so we still check that after the step command GDB is still alive, which is what we care about. =20 Tested on Ubuntu-22.04 x86_64, with and without libc6-dbg. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29768 Approved-By: Simon Marchi Diff: --- gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp b/gdb/testsuit= e/gdb.base/rtld-step-nodebugsym.exp index 1c8fa478cb8..80ff1572c1a 100644 --- a/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp +++ b/gdb/testsuite/gdb.base/rtld-step-nodebugsym.exp @@ -29,4 +29,6 @@ if { ![runto_main] } { =20 gdb_test "step" "Single stepping until exit from function.*" =20 -gdb_continue_to_end "" continue 1 +# GDB used to crash while doing the step command. Check that this bug is +# fixed and that GDB is still alive at this point. +gdb_test "print 0" "=3D 0"