public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] [gdb] Test-case gdb.base/unwind-on-each-insn.exp improvements
@ 2023-01-19 10:46 Tom de Vries
  2023-01-19 10:46 ` [PATCH 1/4] [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp Tom de Vries
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Tom de Vries @ 2023-01-19 10:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: Bruno Larsen, Andrew Burgess, Luis Machado

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


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

end of thread, other threads:[~2023-01-25 12:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 10:46 [PATCH 0/4] [gdb] Test-case gdb.base/unwind-on-each-insn.exp improvements Tom de Vries
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

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