public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/25528] step will stopped at any "asm volatile" statement
Date: Wed, 30 Dec 2020 17:16:13 +0000	[thread overview]
Message-ID: <bug-25528-4717-lprt3n9XiB@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25528-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25528

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |NOTABUG

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Yibiao Yang from comment #0)
> $ gdb -q ./a.out
> Reading symbols from ./a.out...
> (gdb) break small.c:9
> Breakpoint 1 at 0x113f: file small.c, line 9.
> (gdb) run
> Starting program: /home/yibiao/cv-gcov/a.out 
> 
> Breakpoint 1, f (delta=-1) at small.c:9
> 9	    if (NM[p] == 0)
> (gdb) step
> 10	      asm volatile("");
> (gdb) c
> Continuing.
> 
> Breakpoint 1, f (delta=-1) at small.c:9
> 9	    if (NM[p] == 0)
> (gdb) step
> 10	      asm volatile("");
> (gdb) q
> A debugging session is active.
> 
> 	Inferior 1 [process 4947] will be killed.
> 
> Quit anyway? (y or n) y
> 
> 
> 
> #############################################################################
> ##
> ### We can find that Line #10 @asm volatile("");@ is executed twice. 
> ### However, it is obvious that Line #9 "if (NM[p] == 0)" is True in the
> second for loop. 
> #############################################################################
> ##

I think this is a different variant of the same problem: the target of the true
_and_ false path end up at the same insn, which has two entries in the line
table.  So either we show the "true" line twice, or the "false" line twice.

Confusing, but not a gdb bug.

On the gcc side, it could be argued that this is exactly what you asked for by
providing an _empty_ asm stmt.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2020-12-30 17:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-25528-4717@http.sourceware.org/bugzilla/>
2020-12-29  3:33 ` yangyibiao at outlook dot com
2020-12-30 17:02 ` vries at gcc dot gnu.org
2020-12-30 17:16 ` vries at gcc dot gnu.org [this message]

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-25528-4717-lprt3n9XiB@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.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).