public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix gdb.base/attach.exp --pid test skipping on native-extended-gdbserver
@ 2024-04-26 20:24 Pedro Alves
  0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2024-04-26 20:24 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=acaf8d85fe9b8231c0b8ba5796a7eb350a04d7c2

commit acaf8d85fe9b8231c0b8ba5796a7eb350a04d7c2
Author: Pedro Alves <pedro@palves.net>
Date:   Wed Apr 17 19:47:51 2024 +0100

    Fix gdb.base/attach.exp --pid test skipping on native-extended-gdbserver
    
    When testing with the native-extended-gdbserver board,
    gdb.base/attach.exp shows a couple failures, like so:
    
     Running /home/pedro/gdb/src/gdb/testsuite/gdb.base/attach.exp ...
     FAIL: gdb.base/attach.exp: do_command_attach_tests: gdb_spawn_attach_cmdline: start gdb with --pid
     FAIL: gdb.base/attach.exp: do_command_attach_tests: gdb_spawn_attach_cmdline: info thread (no thread)
    
    From gdb.log:
    
     builtin_spawn /home/pedro/gdb/build/gdb/testsuite/../../gdb/gdb -nw -nx -q -iex set height 0 -iex set width 0 -data-directory /home/pedro/gdb/build
     /gdb/data-directory -iex set auto-connect-native-target off -iex set sysroot -quiet --pid=2115260
     Don't know how to attach.  Try "help target".
     (gdb) FAIL: gdb.base/attach.exp: do_command_attach_tests: gdb_spawn_attach_cmdline: start gdb with --pid
    
    There is a check for [isnative] to skip the test on anything but
    target native, but that is the wrong check.  native-extended-gdbserver
    is "isnative".  Fix it by using a gdb_protocol check instead.
    
    Change-Id: I37ee730b8d6f1913b12c118838f511bd1c0b3768
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 gdb/testsuite/gdb.base/attach.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index 637f287f59e..831e11f96a6 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -445,7 +445,9 @@ proc_with_prefix do_command_attach_tests {} {
     global gdb_prompt
     global binfile
 
-    if {![isnative]} {
+    # The --pid option is used to attach to a process using the native
+    # target.
+    if { ![gdb_protocol_is_native] } {
 	unsupported "command attach test"
 	return 0
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-26 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 20:24 [binutils-gdb] Fix gdb.base/attach.exp --pid test skipping on native-extended-gdbserver Pedro Alves

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