public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "yangyibiao at hust dot edu.cn" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/95360] inconsistent behaviors at -O0
Date: Wed, 27 May 2020 13:25:50 +0000	[thread overview]
Message-ID: <bug-95360-4-GVXVqk610Y@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95360-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95360

--- Comment #5 from Yibiao Yang <yangyibiao at hust dot edu.cn> ---
(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] = 0;
> > (gdb)
> > 
> > 
> > /*****************************************************
> > 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
> > *****************************************************/
> 
> 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.
> 
> 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 line
> 5 to line 7.

I agree that at some time it will step to line 7 after executing line 6  and at
other times it will step to line 6 after executing line7  as they both at the
same iteration. 

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.

  parent reply	other threads:[~2020-05-27 13:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 10:05 [Bug debug/95360] New: " yangyibiao at hust dot edu.cn
2020-05-27 10:05 ` [Bug debug/95360] " yangyibiao at hust dot edu.cn
2020-05-27 10:44 ` redi at gcc dot gnu.org
2020-05-27 12:03 ` marxin at gcc dot gnu.org
2020-05-27 12:35 ` vries at gcc dot gnu.org
2020-05-27 13:07 ` vries at gcc dot gnu.org
2020-05-27 13:25 ` yangyibiao at hust dot edu.cn [this message]
2020-05-27 13:33 ` yangyibiao at hust dot edu.cn
2020-05-27 15:53 ` vries at gcc dot gnu.org
2021-07-18 22:20 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-95360-4-GVXVqk610Y@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).