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 tdep/30021] [gdb/tdep, powerpc64le] previous frame inner to this frame (corrupt stack?)
Date: Mon, 23 Jan 2023 15:33:27 +0000	[thread overview]
Message-ID: <bug-30021-4717-cXuFDxgoSh@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30021-4717@http.sourceware.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cel at us dot ibm.com,
                   |                            |kevinb at redhat dot com,
                   |                            |ulrich.weigand at de dot ibm.com

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
With gcc 4.8.5, I'm running into FAILs in gdb.base/unwind-on-each-insn.exp,
which I assume are a duplicate of this one, for the reason that the same insn
triggers the problem:
...
FAIL: gdb.base/unwind-on-each-insn.exp: instruction 5: $fba_value == $main_fba
FAIL: gdb.base/unwind-on-each-insn.exp: instruction 5: [string equal $fid
$main_fid]
...

Disassembly of foo:
...
00000000100006dc <foo>:
    100006dc:   f8 ff e1 fb     std     r31,-8(r1)
    100006e0:   d1 ff 21 f8     stdu    r1,-48(r1)
    100006e4:   78 0b 3f 7c     mr      r31,r1
    100006e8:   30 00 3f 38     addi    r1,r31,48
    100006ec:   f8 ff e1 eb     ld      r31,-8(r1)
    100006f0:   20 00 80 4e     blr
...

Minimal reproducer:
...
$ gdb -q -batch outputs/gdb.base/unwind-on-each-insn/unwind-on-each-insn \
  -ex "set trace-commands on" \
  -ex "b *foo + 12" \
  -ex "display /x \$r1" \
  -ex "display /x \$r31" \
  -ex run \
  -ex "info frame" \
  -ex "si" \
  -ex "info frame" \
  -ex si \
  -ex "info frame"
+b *foo + 12
Breakpoint 1 at 0x100006e8
+display /x $r1
+display /x $r31
+run

Breakpoint 1, 0x00000000100006e8 in foo ()
1: /x $r1 = 0x7fffffffec80
2: /x $r31 = 0x7fffffffec80
+info frame
Stack level 0, frame at 0x7fffffffecb0:
 pc = 0x100006e8 in foo; saved pc = 0x100006b0
 called by frame at 0x7fffffffed20
 Arglist at 0x7fffffffec80, args: 
 Locals at 0x7fffffffec80, Previous frame's sp is 0x7fffffffecb0
 Saved registers:
  r31 at 0x7fffffffeca8
+si
0x00000000100006ec in foo ()
1: /x $r1 = 0x7fffffffecb0
2: /x $r31 = 0x7fffffffec80
+info frame
Stack level 0, frame at 0x7fffffffecb0:
 pc = 0x100006ec in foo; saved pc = 0x100006b0
 called by frame at 0x7fffffffecf0
 Arglist at 0x7fffffffec80, args: 
 Locals at 0x7fffffffec80, Previous frame's sp in r1
+si
0x00000000100006f0 in foo ()
1: /x $r1 = 0x7fffffffecb0
2: /x $r31 = 0x7fffffffecb0
+info frame
Stack level 0, frame at 0x7fffffffecb0:
 pc = 0x100006f0 in foo; saved pc = 0x100006b0
 called by frame at 0x7fffffffed20
 Arglist at 0x7fffffffecb0, args: 
 Locals at 0x7fffffffecb0, Previous frame's sp in r1
...

Note this line:
...
 called by frame at 0x7fffffffed20
  ...
 called by frame at 0x7fffffffecf0
  ...
 called by frame at 0x7fffffffed20
...

It's correct for the insn first insn (at 100006e8), which is not unwound by the
epilogue unwinder.

It's also correct for the last insn (at 100006f0), which is unwound by the
epilogue unwinder.

It not correct for the middle insn (at 100006ec), which is also unwound by the
epilogue unwinder.

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

  parent reply	other threads:[~2023-01-23 15:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 16:01 [Bug tdep/30021] New: " vries at gcc dot gnu.org
2023-01-19 11:14 ` [Bug tdep/30021] " vries at gcc dot gnu.org
2023-01-23 15:33 ` vries at gcc dot gnu.org [this message]
2023-01-23 15:38 ` vries at gcc dot gnu.org
2023-01-24  0:14 ` vries at gcc dot gnu.org
2023-01-24 10:46 ` vries at gcc dot gnu.org
2023-01-24 11:46 ` vries at gcc dot gnu.org
2023-01-25 12:27 ` cvs-commit at gcc dot gnu.org
2023-01-26 16:12 ` cel at us dot ibm.com
2023-01-26 16:14 ` cel at us dot ibm.com
2023-01-26 16:16 ` 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-30021-4717-cXuFDxgoSh@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).