public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PUSHED] gdb/testsuite: updates for gdb.arch/{amd64,i386}-disp-step-self-call.exp
Date: Fri,  7 Apr 2023 06:28:44 +0100	[thread overview]
Message-ID: <9340f361097963011369c3339f7d28239d2f851b.1680845304.git.aburgess@redhat.com> (raw)

This commit:

  commit cf141dd8ccd36efe833aae3ccdb060b517cc1112
  Date:   Wed Feb 22 12:15:34 2023 +0000

      gdb: fix reg corruption from displaced stepping on amd64

Added two test scripts gdb.arch/amd64-disp-step-self-call.exp and
gdb.arch/i386-disp-step-self-call.exp.  These scripts contained a test
that included a stack address in the test name, this makes it harder
to compare results between runs.

This commit gives the tests proper names that doesn't include an
address.

Also in gdb.arch/i386-disp-step-self-call.exp I noticed that we were
writing 8-bytes rather than 4 in order to clear the return address
entry on the stack.  This is also fixed in this commit.
---
 gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp | 3 ++-
 gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp
index db44a319a47..ecac3cdc1cf 100644
--- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp
+++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp
@@ -60,7 +60,8 @@ gdb_test_multiple "x/2i \$pc" "get address of next insn" {
 
 # Clear the slot on the stack and confirm it was set to zero.
 set sp [expr $sp - 0x8]
-gdb_test_no_output "set {unsigned long long} $sp = 0"
+gdb_test_no_output "set {unsigned long long} $sp = 0" \
+    "clear stack slot"
 set zero_val 0x[format %016x 0]
 gdb_test "x/1gx 0x[format %x $sp]" "$hex:\\s+${zero_val}" \
     "check return address slot was set to zero"
diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp
index 7ea036fe3e6..034ef4800b4 100644
--- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp
+++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp
@@ -60,7 +60,8 @@ gdb_test_multiple "x/2i \$pc" "get address of next insn" {
 
 # Clear the slot on the stack and confirm it was set to zero.
 set sp [expr $sp - 0x4]
-gdb_test_no_output "set {unsigned long long} $sp = 0"
+gdb_test_no_output "set {unsigned int} $sp = 0" \
+    "clear stack slot"
 set zero_val 0x[format %08x 0]
 gdb_test "x/1wx 0x[format %x $sp]" "$hex:\\s+${zero_val}" \
     "check return address slot was set to zero"

base-commit: a67a3bbd35c3d8f028cad5cb9e3122e56071baee
-- 
2.25.4


                 reply	other threads:[~2023-04-07  5:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=9340f361097963011369c3339f7d28239d2f851b.1680845304.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@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).