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 testsuite/29792] New: [gdb/testsuite, powerpc] FAIL: gdb.opt/solib-intra-step.exp: second-hit
Date: Wed, 16 Nov 2022 14:56:56 +0000	[thread overview]
Message-ID: <bug-29792-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 29792
           Summary: [gdb/testsuite, powerpc] FAIL:
                    gdb.opt/solib-intra-step.exp: second-hit
           Product: gdb
           Version: 12.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On powerpc64le-linux, I ran 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
...

First let's do a stepping session:
...
$ ./build/gdb/gdb -q outputs/gdb.opt/solib-intra-step/solib-intra-step-main
Reading symbols from outputs/gdb.opt/solib-intra-step/solib-intra-step-main...
(gdb) start
Temporary breakpoint 1 at 0x10000718: file
/suse/tdevries/gdb/src/gdb/testsuite/gdb.opt/solib-intra-step-main.c, line 23.
Starting program:
/suse/tdevries/gdb/build/gdb/testsuite/outputs/gdb.opt/solib-intra-step/solib-intra-step-main 

Temporary breakpoint 1, main ()
    at /suse/tdevries/gdb/src/gdb/testsuite/gdb.opt/solib-intra-step-main.c:23
23        shlib_first ();
(gdb) step
shlib_first () at
/suse/tdevries/gdb/src/gdb/testsuite/gdb.opt/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=0)
    at /suse/tdevries/gdb/src/gdb/testsuite/gdb.opt/solib-intra-step-lib.c:23
23        abort (); /* second-hit */
...

So the problem is that we arrive at line 29, then step back to 28, and again to
29 before stepping into shlib_second.

Looking at objdump output, shlib_first starts at 0x740, and with readline -wL,
we see:
...
CU: /suse/tdevries/gdb/src/gdb/testsuite/gdb.opt/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
...

So, that makes sense.  When stepping into shlib_first, we skip the first entry
at 28 due to prologue skipping, then step to the entry at 28 and then back to
the entry at 29, which is where the call to shlib_second is.

GDB uses the line info available (which is weird because of optimization), and
does this correctly.

The test-case needs to be updated to handle this.

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

             reply	other threads:[~2022-11-16 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 14:56 vries at gcc dot gnu.org [this message]
2022-11-16 15:04 ` [Bug testsuite/29792] " vries at gcc dot gnu.org
2022-11-16 15:11 ` vries at gcc dot gnu.org
2022-11-16 15:14 ` vries at gcc dot gnu.org
2022-11-28 13:23 ` cvs-commit at gcc dot gnu.org
2022-11-28 13:25 ` 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-29792-4717@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).