From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 6D0543858C62; Mon, 28 Nov 2022 13:23:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D0543858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669641817; bh=QKx8g/fTMQ0OQR+d8BxC8ewFEWrfK+Lq50itt0sidY8=; h=From:To:Subject:Date:From; b=JVUqID3VYpb94TH38WQy2B+lCsIRTNRBQmif3VEiS+t2I4Ra8q0CgM9qHqgMmb7Zn Ys+Dqhx9GewHouZLcRjnKj5V+O//kdpErYeZRk2NrQ5UFESMlH4xbp/4l0baeJqvJ2 4Tk/uIjBWt8SFckfZ8azr8v24LsjRWS/gmdHwWgE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp for powerpc64le X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: ddff2a2dea5261789e1f281f3ee1b33dd5fd8892 X-Git-Newrev: 76cd77dc729b03d6b33c683323594479e33a3f9a Message-Id: <20221128132337.6D0543858C62@sourceware.org> Date: Mon, 28 Nov 2022 13:23:37 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D76cd77dc729b= 03d6b33c683323594479e33a3f9a commit 76cd77dc729b03d6b33c683323594479e33a3f9a Author: Tom de Vries Date: Mon Nov 28 14:23:34 2022 +0100 [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp for powerpc64le =20 On powerpc64le-linux, I run into: ... (gdb) PASS: gdb.opt/solib-intra-step.exp: first-hit step^M 28 { /* first-retry */^M (gdb) FAIL: gdb.opt/solib-intra-step.exp: second-hit ... =20 It's a bit easier to understand what happens if we do a full stepping s= ession: ... Temporary breakpoint 1, main () at solib-intra-step-main.c:23 23 shlib_first (); (gdb) step shlib_first () at solib-intra-step-lib.c:29 29 shlib_second (0); /* first-hit */ (gdb) step 28 { /* first-retry */ (gdb) step 29 shlib_second (0); /* first-hit */ (gdb) step shlib_second (dummy=3D0) at solib-intra-step-lib.c:23 23 abort (); /* second-hit */ ... and compare that to the line info: ... CU: solib-intra-step-lib.c: File name Line number Starting address View = Stmt solib-intra-step-lib.c 22 0x710 = x solib-intra-step-lib.c 23 0x724 = x solib-intra-step-lib.c 28 0x740 = x solib-intra-step-lib.c 29 0x74c = x solib-intra-step-lib.c 28 0x750 = x solib-intra-step-lib.c 29 0x758 = x solib-intra-step-lib.c 30 0x760 = x solib-intra-step-lib.c - 0x77c ... =20 So we step from line 29 to line 28, and back to line 29, which is behav= iour that matches the line table. The peculiar order is due to using optimi= zation. The problem is that the test-case doesn't expect this order. =20 Fix this by allowing this order in the test-case. =20 Tested on powerpc64le-linux. =20 PR testsuite/29792 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29792 Diff: --- gdb/testsuite/gdb.opt/solib-intra-step.exp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb= .opt/solib-intra-step.exp index 0acda6594c5..e803a7db14d 100644 --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp @@ -58,16 +58,35 @@ gdb_test_multiple "step" $test { } } =20 +set in_second 0 set test "second-hit" gdb_test_multiple "step" $test { + -re -wrap " first-retry .*" { + if { $in_second } { + fail $gdb_test_name + } else { + send_gdb "step\n" + exp_continue + } + } + -re -wrap " first-hit .*" { + if { $in_second } { + fail $gdb_test_name + } else { + send_gdb "step\n" + exp_continue + } + } -re -wrap " second-hit .*" { pass $gdb_test_name } -re -wrap " second-retry .*" { + set in_second 1 send_gdb "step\n" exp_continue } -re -wrap "get_pc_thunk.*" { + set in_second 1 send_gdb "step\n" exp_continue }