From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 55536386F45A; Wed, 27 May 2020 13:25:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55536386F45A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590585950; bh=xhxlWX3wTLAKFVAlhSr75NOqGAn/cs87n5kpVRlAeDE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RAVYNh0zhk+wMCrdcplUqY48BW21d6CfhgRG1HJ2Z+yNGA4752Htyz/lNM4uJ87Kc LA6js+360CbzQ6xVUPin0IYa3DPXRu8aOqgruuxkHD++aEfjs5ClxVIjRlWxg/X/17 bFJaVF1EqWHle73AwuZKuj8ESB29/ZsqCQVt1tR8= From: "yangyibiao at hust dot edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/95360] inconsistent behaviors at -O0 Date: Wed, 27 May 2020 13:25:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yangyibiao at hust dot edu.cn X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 13:25:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95360 --- Comment #5 from Yibiao Yang --- (In reply to Tom de Vries from comment #3) > (In reply to Yibiao Yang from comment #0) > > Breakpoint 1, main () at small.c:5 > > 5 for (; d<1; d++) > > (gdb) stepi > > 0x0000000000401154 5 for (; d<1; d++) > > (gdb) stepi > > 0x000000000040115a 5 for (; d<1; d++) > > (gdb) stepi > > 0x000000000040115c 5 for (; d<1; d++) > > (gdb) stepi > > 0x000000000040113b 6 for (; b<1; b++) > > (gdb) stepi > > 0x0000000000401141 6 for (; b<1; b++) > > (gdb) stepi > > 0x0000000000401143 6 for (; b<1; b++) > > (gdb) stepi > > 7 c[b][d+1] =3D 0; > > (gdb) > >=20 > >=20 > > /***************************************************** > > As showed, Line 6 is hit first and then hit Line 7 with stepi. > > However, when using step, gdb is first hit Line 7 and then hit Line 6. > > This is an inconsistent behaviors between stepi and step > > *****************************************************/ >=20 > Gdb is behaving consistently in the following sense: > - when gdb is at a "recommended breakpoint location" it shows the source = line > only with line number prefix. > - otherwise, it shows the source line with both address and line number > prefix. >=20 > So, what the stepi sequence shows it that the next "recommended breakpoint > location" after line 5 is line 7, which is consistent with a step from li= ne > 5 to line 7. I agree that at some time it will step to line 7 after executing line 6 an= d at other times it will step to line 6 after executing line7 as they both at t= he same iteration.=20 However, my concern is that for the "first iteration or first time" line 6 should be hit ahead of line 7 no matter on whether we using step or using stepi. That's to say, the first hit of Line 6 or Line 7 should be consistent between step and stepi.=