public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/30049] New: [gdb/tdep, powerpc64le] FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2
@ 2023-01-25 12:15 vries at gcc dot gnu.org
  2023-01-25 12:27 ` [Bug tdep/30049] " cvs-commit at gcc dot gnu.org
  2024-02-14  8:24 ` vries at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2023-01-25 12:15 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30049
           Summary: [gdb/tdep, powerpc64le] FAIL:
                    gdb.base/unwind-on-each-insn.exp: bar: instruction 5:
                    bt 2
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

[ Filing this to be able to reference it from commit message. ]

With the tentative patch for PR30021 comment 5, and an update to
gdb.base/unwind-on-each-insn.exp that adds testing of non-leaf function (that
I'm hoping to commit soon), I run into:
...
Running /home/vries/gdb/src/gdb/testsuite/gdb.base/unwind-on-each-insn.exp ...
FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2
FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: up
FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: [string equal $fid
$::main_fid]
FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 6: bt 2
FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 6: up
FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 6: [string equal $fid
$::main_fid]
...

[ Note that without the tentative patch, I see the same failures, and more. ]

First sign of trouble:
...
(gdb) bt 2^M
#0  0x0000000010000748 in bar ()^M
#1  0x0000000010000744 in bar ()^M
(More stack frames follow...)^M
(gdb) FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2
...

We're expecting bar/main, the same as we get at insn 4:
...
bt 2^M
#0  0x0000000010000744 in bar ()^M
#1  0x00000000100006c8 in main () at
/home/vries/gdb/src/gdb/testsuite/gdb.base/unwind-on-each-insn.c:25^M
(gdb)
...

Disassembly of bar:
...
000000001000071c <bar>:
    1000071c:   02 10 40 3c     lis     r2,4098
    10000720:   00 7f 42 38     addi    r2,r2,32512
    10000724:   a6 02 08 7c     mflr    r0
    10000728:   10 00 01 f8     std     r0,16(r1)
    1000072c:   f8 ff e1 fb     std     r31,-8(r1)
    10000730:   c1 ff 21 f8     stdu    r1,-64(r1)
    10000734:   78 0b 3f 7c     mr      r31,r1
    10000738:   20 00 7f f8     std     r3,32(r31)
    1000073c:   20 00 7f e8     ld      r3,32(r31)
    10000740:   b5 ff ff 4b     bl      100006f4 <foo>
    10000744:   40 00 3f 38     addi    r1,r31,64
    10000748:   10 00 01 e8     ld      r0,16(r1)
    1000074c:   a6 03 08 7c     mtlr    r0
    10000750:   f8 ff e1 eb     ld      r31,-8(r1)
    10000754:   20 00 80 4e     blr
...

The problem occurs when backtracing from pc == 10000748 and 1000074c, inbetween
the restore of stack pointer r1 and frame pointer r31.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tdep/30049] [gdb/tdep, powerpc64le] FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2
  2023-01-25 12:15 [Bug tdep/30049] New: [gdb/tdep, powerpc64le] FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2 vries at gcc dot gnu.org
@ 2023-01-25 12:27 ` cvs-commit at gcc dot gnu.org
  2024-02-14  8:24 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-25 12:27 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ebef88edb6474fa9568123645b6762bcd6872702

commit ebef88edb6474fa9568123645b6762bcd6872702
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Jan 25 13:27:03 2023 +0100

    [gdb/testsuite] Analyze non-leaf fn in gdb.base/unwind-on-each-insn.exp

    In test-case gdb.base/unwind-on-each-insn.exp, we stepi through function
foo
    to check various invariants at each insn, in particular hoping to excercise
    insns that modify stack and frame pointers.

    Function foo is a leaf function, so add a non-leaf function bar, and step
    through it as well (using nexti instead of stepi).

    With the updated test-case, on powerpc64le-linux, I run into PR tdep/30049:
    ...
    FAIL: bar: instruction 5: bt 2
    FAIL: bar: instruction 5: up
    FAIL: bar: instruction 5: [string equal $fid $::main_fid]
    FAIL: bar: instruction 6: bt 2
    FAIL: bar: instruction 6: up
    FAIL: bar: instruction 6: [string equal $fid $::main_fid]
    ...

    Tested on:
    - x86_64-linux (-m64 and -m32)
    - s390x-linux (-m64 and -m31)
    - aarch64-linux
    - powerpc64le-linux

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tdep/30049] [gdb/tdep, powerpc64le] FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2
  2023-01-25 12:15 [Bug tdep/30049] New: [gdb/tdep, powerpc64le] FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2 vries at gcc dot gnu.org
  2023-01-25 12:27 ` [Bug tdep/30049] " cvs-commit at gcc dot gnu.org
@ 2024-02-14  8:24 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2024-02-14  8:24 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |15.1
         Resolution|---                         |FIXED
                 CC|                            |cel at linux dot ibm.com

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by:
...
commit e19e16103fb10ac28b15683f56c821cf1b349c1b
Author: Carl Love <cel@linux.ibm.com>
Date:   Tue Jan 23 17:12:34 2024 -0500

    rs6000, unwind-on-each-instruction fix.
...

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-14  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-25 12:15 [Bug tdep/30049] New: [gdb/tdep, powerpc64le] FAIL: gdb.base/unwind-on-each-insn.exp: bar: instruction 5: bt 2 vries at gcc dot gnu.org
2023-01-25 12:27 ` [Bug tdep/30049] " cvs-commit at gcc dot gnu.org
2024-02-14  8:24 ` vries at gcc dot gnu.org

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).