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/29962] FAIL: gdb.reverse/step-reverse.exp: reverse step into fn call
Date: Wed, 11 Jan 2023 10:03:37 +0000	[thread overview]
Message-ID: <bug-29962-4717-XAuHNJEzaf@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29962-4717@http.sourceware.org/bugzilla/>

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #3)
> As mentioned before, this failure shows up with gcc 9.4.0.
> 
> It doesn't show up with gcc 12.2.1, because of a difference in generated
> code.
> 
> In the 12.2.1 case we have 4 insns:
> ...
>   401208:       8b 55 cc                mov    -0x34(%rbp),%edx
>   40120b:       8b 45 d0                mov    -0x30(%rbp),%eax
>   40120e:       29 c2                   sub    %eax,%edx
>   401210:       89 55 d4                mov    %edx,-0x2c(%rbp)
> ...
> each with their line number entry:
> ... 
> step-reverse.c         78            0x401208               x
> step-reverse.c         78            0x40120b               x
> step-reverse.c         78            0x40120e               x
> step-reverse.c         78            0x401210               x
> ...

In the gcc 9.4.0 case, we have 5 insns:
...
  401228:       8b 55 cc                mov    -0x34(%rbp),%edx
  40122b:       8b 45 d0                mov    -0x30(%rbp),%eax
  40122e:       29 c2                   sub    %eax,%edx
  401230:       89 d0                   mov    %edx,%eax
  401232:       89 45 d4                mov    %eax,-0x2c(%rbp)
...
but still 4 line number entries:
...
step-reverse.c           78            0x401228               x
step-reverse.c           78            0x40122b               x
step-reverse.c           78            0x40122e               x
step-reverse.c           78            0x401232               x
...
Note that the insn at 0x401230 doesn't have it's own line number entry.

So, we are at line 79:
...
(gdb) stepi^M
79         callee();    /* STEPI TEST */^M
...
and do a stepi, which lands us, as expected at insn 0x401232:
...
stepi^M
78         a[5] = a[3] - a[4]; /* FINISH TEST */^M
(gdb) PASS: gdb.reverse/step-reverse.exp: simple reverse stepi
print /x $pc^M
$2 = 0x401232^M
(gdb) PASS: gdb.reverse/step-reverse.exp: print /x $pc
...

Then we do a step, which lands us, unexpectedly, at insn 0x40122e:
...
step^M
78         a[5] = a[3] - a[4]; /* FINISH TEST */^M
(gdb) FAIL: gdb.reverse/step-reverse.exp: reverse step into fn call
print /x $pc^M
$3 = 0x40122e^M
(gdb) PASS: gdb.reverse/step-reverse.exp: print /x $pc
...

It's stepping over the 0x401230 insn without line number entry that triggers
the problem.

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

  parent reply	other threads:[~2023-01-11 10:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 10:09 [Bug gdb/29962] New: " vries at gcc dot gnu.org
2023-01-04 13:30 ` [Bug gdb/29962] " vries at gcc dot gnu.org
2023-01-04 17:18 ` vries at gcc dot gnu.org
2023-01-11  9:39 ` vries at gcc dot gnu.org
2023-01-11 10:03 ` vries at gcc dot gnu.org [this message]
2023-01-11 10:06 ` vries at gcc dot gnu.org
2023-01-11 10:08 ` vries at gcc dot gnu.org
2023-01-12 11:55 ` vries at gcc dot gnu.org
2023-01-12 16:30 ` vries 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-29962-4717-XAuHNJEzaf@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).