From patchwork Fri Apr 19 15:13:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 88748 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B8540384772B for ; Fri, 19 Apr 2024 15:15:57 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by sourceware.org (Postfix) with ESMTPS id D77E03849ACB for ; Fri, 19 Apr 2024 15:14:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D77E03849ACB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D77E03849ACB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713539666; cv=none; b=kGWYEXBGwMLIsusXre+X4kPCPDBUxynC56erHyNsrPXCR4l9FG9JEOQcAKIWgsG4qPQsf/QN06rQbBIraHIT9/2zvaDq5UCyrfsoHcCnEVFgEfVvhT2QtXMQFotZbZmc5b+QbklbFTNHX2MRM2lt/zyermKChMRAnHV1iGDQGmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713539666; c=relaxed/simple; bh=pQz8DnqMq3IUP9nlbf+ymlv2scpIJdVBIqXgh6VS7jA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=KKiT7p/67BeIs2eUsqc9yJATfMZWOL47TWyzw7KjhDpJ00rUVEZ6ZeGucwkWxVshaivx3dpat4uLOPxFUbB+qydmKFt+YB4T9qKo7LAYLnzm5/EuAZQkkNRyBuCnCJCbbuKcHwEj8XdQx0lYFTHBbCf5y3vsyUe8A/Qsi2tlI9M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-418c979ddd2so15534355e9.3 for ; Fri, 19 Apr 2024 08:14:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539662; x=1714144462; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W9+40qIofqkpwlzQKw/1hgQ6dBROZae/3ZwzHwXk7lw=; b=gguDeVB44G8UkVsvbtRS9LWMFqWaC7eu4dGmuYAH9wqj/DrBxlNft1y/4bMZVD6CaK JqPHq9CPDX+wYafqf+ICTtpNqz3mSodXHB7B4cggBs/rIOAWfz2u12ywLHuY6P/IOAQY elUQv1sJNrJlB+WP6lxm5aVZpSnN9uYQIZRoUf0NP0lo0a+JOaBkjfxW0eIrVBO1GIqb f7utvAKKo1aa5s1P1eqC328it54hKkHDDaKuIMM/gbeo1aZpcEiw6Vo+bcs6bjUlS/Jv 6TGweYaILys5hRLYca99SQ1XT3+wF/pwNdQ1yqdnjscnXYFchKAjOcvr9nI6uXn8Tttt HZ6A== X-Gm-Message-State: AOJu0Yw9cePpAzwRJ3va68TOCpnkqdHYyalD7wnrQ2NN/PtkiRi5jlbK 3h8+US8E5UxpvqOFkjaaMs7QR1t5ayGtfLLDinKyyMvyqoo8RcdkfWDzWJUK X-Google-Smtp-Source: AGHT+IGRYx1IxAWXswhgssBGH/JgQ6fhXhx7ilxtqgQQx+xk97S5jdiOgWXjrdEdq7sSJVQs+6/Ibw== X-Received: by 2002:a05:600c:1e25:b0:419:cf15:f3b9 with SMTP id ay37-20020a05600c1e2500b00419cf15f3b9mr344479wmb.36.1713539662189; Fri, 19 Apr 2024 08:14:22 -0700 (PDT) Received: from localhost ([2001:8a0:f93d:b900:2438:d637:5572:c30a]) by smtp.gmail.com with UTF8SMTPSA id o19-20020a05600c511300b00417e36953a0sm6820024wms.20.2024.04.19.08.14.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Apr 2024 08:14:21 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 12/12] Fix gdb.base/attach.exp --pid test skipping on native-extended-gdbserver Date: Fri, 19 Apr 2024 16:13:42 +0100 Message-ID: <20240419151342.1592474-13-pedro@palves.net> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240419151342.1592474-1-pedro@palves.net> References: <20240419151342.1592474-1-pedro@palves.net> MIME-Version: 1.0 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org 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 --- 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 }