From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Bruno Larsen <blarsen@redhat.com>,
Andrew Burgess <aburgess@redhat.com>,
Luis Machado <luis.machado@arm.com>
Subject: [PATCH 0/4] [gdb] Test-case gdb.base/unwind-on-each-insn.exp improvements
Date: Thu, 19 Jan 2023 11:46:14 +0100 [thread overview]
Message-ID: <20230119104618.15503-1-tdevries@suse.de> (raw)
While analyzing PR record/29721 "[gdb, record, aarch64] FAIL:
gdb.reverse/solib-precsave.exp: reverse-next third shr1", I came to realize
that I was a looking at the aarch64 variant of x86_64 PR record/16678 (as
indeed suggested by Bruno in the PR).
The test-case gdb.base/unwind-on-each-insn.exp was added in the commit to fix
PR record/16678, to detect similar problems on other architectures, but it
passes on aarch64 and doesn't detect record/29721, because the function that
is checked is too simple on aarch64:
...
00000000004005fc <foo>:
4005fc: d503201f nop
400600: d65f03c0 ret
...
This series first simplifies, and then improves test-case
gdb.base/unwind-on-each-insn.exp to detect PR record/16678, or more precisely,
the two spinoff PRs I filed that have reproducers that do not involve reverse
execution:
- PR30010 - [gdb/tdep, aarch64] Incorrect frame address for last insn
(non-leaf case)
- PR30011 - [gdb/tdep, aarch64] Incorrect frame address for last insn
(leaf case)
In short, we have following patches:
- [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp
Remove unnecessary and fragile complication of analyzing disassembly.
- [gdb/testsuite] Improve gdb.base/unwind-on-each-insn.exp
Detect PR30011.
- [gdb/tdep, aarch64] Fix frame address of last insn in leaf function
Fix for PR30011.
- [gdb/testsuite] Analyze non-leaf fn in gdb.base/unwind-on-each-insn.exp
Detect PR30010.
Improving the test-case also detected a problem on powerpc64le, filed as PR
tdep/30021 - "[gdb/tdep, powerpc64le] previous frame inner to this frame
(corrupt stack?)".
Due to unavailability I haven't tested the last patch on powerpc64le-linux.
While doing this investigation I also ran into PR tdep/30019 -
"[gdb/tdep, i386] frame address at first insn in main is zero", but the
test-case doesn't trigger this. I've not tried adding this.
Finally, I'm considering moving the test-case to gdb.arch, but I haven't
included a patch for this.
Tom de Vries (4):
[gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp
[gdb/testsuite] Improve gdb.base/unwind-on-each-insn.exp
[gdb/tdep, aarch64] Fix frame address of last insn in leaf function
[gdb/testsuite] Analyze non-leaf fn in
gdb.base/unwind-on-each-insn.exp
gdb/aarch64-tdep.c | 6 +-
.../gdb.base/unwind-on-each-insn-foo.c | 8 +-
gdb/testsuite/gdb.base/unwind-on-each-insn.c | 6 +-
.../gdb.base/unwind-on-each-insn.exp | 167 ++++++++----------
4 files changed, 89 insertions(+), 98 deletions(-)
base-commit: b8d21eb0cd10d6127e77cc437d82e949adb0c454
--
2.35.3
next reply other threads:[~2023-01-19 10:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 10:46 Tom de Vries [this message]
2023-01-19 10:46 ` [PATCH 1/4] [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp Tom de Vries
2023-01-23 9:36 ` Tom de Vries
2023-01-19 10:46 ` [PATCH 2/4] [gdb/testsuite] Improve gdb.base/unwind-on-each-insn.exp Tom de Vries
2023-01-23 9:55 ` Luis Machado
2023-01-19 10:46 ` [PATCH 3/4] [gdb/tdep, aarch64] Fix frame address of last insn in leaf function Tom de Vries
2023-01-20 10:25 ` Tom de Vries
2023-01-23 10:07 ` Luis Machado
2023-01-23 11:59 ` Tom de Vries
2023-01-23 12:09 ` Luis Machado
2023-01-19 10:46 ` [PATCH 4/4] [gdb/testsuite] Analyze non-leaf fn in gdb.base/unwind-on-each-insn.exp Tom de Vries
2023-01-23 10:18 ` Luis Machado
2023-01-25 12:32 ` [PATCH 0/4] [gdb] Test-case gdb.base/unwind-on-each-insn.exp improvements Tom de Vries
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=20230119104618.15503-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=aburgess@redhat.com \
--cc=blarsen@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@arm.com \
/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).