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: [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp
Date: Mon, 27 May 2024 22:26:10 +0100	[thread overview]
Message-ID: <8d696883107c9d3b44aa35ee92d1d5199a12f93d.1716845155.git.aburgess@redhat.com> (raw)

When running gdb.testsuite/gdb-caching-proc-consistency.exp with the
native-gdbserver board, I see an error reported:

  ERROR: gdbserver does not support attach 2036113 without extended-remote

and a test is reported UNRESOLVED:

   UNRESOLVED: gdb.testsuite/gdb-caching-proc-consistency.exp: testcase '<snip>/gdb.testsuite/gdb-caching-proc-consistency.exp' aborted due to Tcl error

The problem is that we are calling the can_spawn_for_attach_1 caching
proc directly, rather than through the can_spawn_for_attach wrapper
proc (which is not caching).

To fix this, in gdb-caching-proc-consistency.exp, I did consider
having 'test_file' spot 'can_spawn_for_attach_1' and test
'can_spawn_for_attach' instead, but that runs into problems as the
'test_proc' procedure does expect to be calling a caching proc, not a
non-caching wrapper proc.

I could make 'test_proc' smarter, but in the end I just opted to
replicate the condition checks from 'can_spawn_for_attach' inside the
'test_file' procedure, there's only two of them, this seems like the
easiest fix.

If we end up with more cases like this then it might be worth
restructuring things in here to better handle wrapper procs, but for
now that doesn't feel necessary.
---
 .../gdb.testsuite/gdb-caching-proc-consistency.exp        | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
index 572ffb526ba..5312b395283 100644
--- a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
+++ b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
@@ -91,6 +91,14 @@ proc test_file { file } {
 		"target_is_gdbserver" { set setup_gdb 1 }
 		"supports_memtag" { set setup_gdb 1 }
 		"have_native_target" { set setup_gdb 1 }
+		"can_spawn_for_attach_1" {
+		    # This replicates the checks found in
+		    # 'can_spawn_for_attach'.
+		    if {[is_remote target] \
+			    || [target_info exists use_gdb_stub]} {
+			continue
+		    }
+		}
 		default {set setup_gdb 0 }
 	    }
 

base-commit: bdc10cded85aa8995e80394099c9e542b6172979
-- 
2.25.4


             reply	other threads:[~2024-05-27 21:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 21:26 Andrew Burgess [this message]
2024-05-27 22:00 ` Tom de Vries
2024-06-03 18:19   ` Andrew Burgess
2024-05-28 15:19 ` Tom Tromey

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=8d696883107c9d3b44aa35ee92d1d5199a12f93d.1716845155.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).