Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH] gdb/testsuite: avoid register values in test names
Date: Tue, 24 Nov 2026 11:12:45 +0000	[thread overview]
Message-ID: <0ac8655e6786eb29f91f987edbb6d2b7dc4be8cd.1795518754.git.aburgess@redhat.com> (raw)

The test gdb.arch/amd64-extended-prologue-analysis.exp places modified
callee-saved register values into test names.  I find that if I run
this test from different directories then I often see different values,
and this messes up my test result comparison scripts.

Different values could be triggered by, for example, different
environment blocks on the stack, and indeed, within a single directory,
if I run the test, then set a large environment variable, and finally
re-run the test, the second test run will have different register values
than the first run.

Replace the register values with fixed text strings.  Now the test names
are stable across runs.
---
 .../gdb.arch/amd64-extended-prologue-analysis.exp         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/amd64-extended-prologue-analysis.exp b/gdb/testsuite/gdb.arch/amd64-extended-prologue-analysis.exp
index d511c773dc3..f34e5cc2390 100644
--- a/gdb/testsuite/gdb.arch/amd64-extended-prologue-analysis.exp
+++ b/gdb/testsuite/gdb.arch/amd64-extended-prologue-analysis.exp
@@ -38,7 +38,7 @@ proc test_run {} {
     gdb_assert { $main_r12 ne "null" }
 
     set foo_r12 [expr {$main_r12 + 2}]
-    gdb_test "print \$r12=$foo_r12" "$foo_r12" "Set foo's %r12=$foo_r12"
+    gdb_test "print \$r12=$foo_r12" "$foo_r12" "Set foo's %r12 to a new value"
     gdb_test "up" ".*main.*" "Go up a frame from foo"
     gdb_test "print \$r12" "$main_r12" "foo's %r12 unwound"
     gdb_test "down" ".*foo.*" "Go back down a frame to foo"
@@ -53,9 +53,9 @@ proc offset_test_run {} {
     gdb_assert { $old_reg_val ne "null" }
 
     set new_reg_val [expr {$old_reg_val + 3}]
-    gdb_test "print \$r14=$new_reg_val" "$new_reg_val" "Set %r14=$new_reg_val"
-    gdb_test "print \$r13=$new_reg_val" "$new_reg_val" "Set %r13=$new_reg_val"
-    gdb_test "print \$r12=$new_reg_val" "$new_reg_val" "Set %r12=$new_reg_val"
+    gdb_test "print \$r14=$new_reg_val" "$new_reg_val" "Set %r14 to a new value"
+    gdb_test "print \$r13=$new_reg_val" "$new_reg_val" "Set %r13 to a new value"
+    gdb_test "print \$r12=$new_reg_val" "$new_reg_val" "Set %r12 to a new value"
 
     set addr_past_prologue "null"
     gdb_test_multiple "disassemble" "Disassemble foo" -lbl {

base-commit: c7b0ebeb53518dbdc27624ece3f0581cc3cc33e6
-- 
2.56.1


             reply	other threads:[~2026-11-24 11:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 11:12 Andrew Burgess [this message]
2026-11-24 12:28 ` Rohr, Stephan

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=0ac8655e6786eb29f91f987edbb6d2b7dc4be8cd.1795518754.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