public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Allow debug srcfile2 in gdb.base/unwind-on-each-insn.exp
Date: Wed, 25 Jan 2023 15:24:40 +0100	[thread overview]
Message-ID: <20230125142440.29694-1-tdevries@suse.de> (raw)

Test-case gdb.base/unwind-on-each-insn.exp compiles $srcfile with debug info, and
$srcfile2 without.

Occasionally, I try both files with debug info:
...
-             $srcfile $debug_flags $srcfile2 $nodebug_flags]]} {
+             $srcfile $debug_flags $srcfile2 $debug_flags]]} {
...

This shortcuts the test due to no longer recognizing that stepi still lands
in foo.

Fix this by determining whether still in foo by checking the info frame output.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/unwind-on-each-insn.exp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
index d6f90dde8c1..059967a2b2e 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
@@ -142,9 +142,11 @@ proc do_test { function step_cmd } {
 		break
 	    }
 
+	    gdb_test $step_cmd
+
 	    set in_fn 0
-	    gdb_test_multiple $step_cmd "" {
-		-re -wrap "$::hex in $function \\(\\)" {
+	    gdb_test_multiple "info frame" "" {
+		-re -wrap "rip = $::hex in ${function}( \\(.*\\))?;.*" {
 		    set in_fn 1
 		}
 		-re -wrap "" {}

base-commit: 621271c7819c3337e3eb5e48b7a7ee66573543da
-- 
2.35.3


                 reply	other threads:[~2023-01-25 14:24 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=20230125142440.29694-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --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).