From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by sourceware.org (Postfix) with ESMTPS id 4F5883894C0F for ; Tue, 13 Oct 2020 15:44:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4F5883894C0F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f66.google.com with SMTP id n18so24643714wrs.5 for ; Tue, 13 Oct 2020 08:44:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JzL1FVBW9lGrzf/POoOB6o3UYoel84Rs1QAo1O1yrC0=; b=FXK01c9uPcni4z4ajHbOGdu64LT2SCqWQ9BIHvndt81sEp4tWguCUyZzifiWdkRevq Jb8norS3Mepc2DfI5BXJbj5Fj5ugXKZFk5fYIZZ4s8oMGqGwoxEQsFIkxehItwI/iW6H lniLKGtP1nwD0GDwfW3XLOQDvFXUi3ING283yggv4iQsGD6yRuECtQsdIcDGXLnzZaix SX+PP/8DLBdnmtZH5ZwZSOUmqdNaySCpf835I/AZwnjppKZGhklVVwEKnzT78VYk1Rt0 CIEanfBbWfg3QNcu9oe6Dj0v2gWN3RmiePp4a4A5Kwc8ocWElJNF3XP4PGZBe2hui4qo YESA== X-Gm-Message-State: AOAM5320STg1SbBiwrBCjxwf9xM0l8DTdbm0/Cwy/ZPVYuIb2HCno33N b37fO9mmaF8jJcRo+ol9sVn2WFIxhRGXWQ== X-Google-Smtp-Source: ABdhPJxQEAw6+YIgJ5Ho+Pd2R9xyLmbht6gJOA9V6eHlbGhG6IOtuPvp9m8N/TDF0n+FxyNXt7c0Ig== X-Received: by 2002:a5d:680a:: with SMTP id w10mr289490wru.5.1602603844712; Tue, 13 Oct 2020 08:44:04 -0700 (PDT) Received: from ?IPv6:2001:8a0:f91e:6d00:c80a:ea25:47ef:5f73? ([2001:8a0:f91e:6d00:c80a:ea25:47ef:5f73]) by smtp.gmail.com with ESMTPSA id y4sm28446733wrp.74.2020.10.13.08.44.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Oct 2020 08:44:03 -0700 (PDT) Subject: Re: [PATCH v2] gdb: don't pass TARGET_WNOHANG to targets that can't async (PR 26642) To: Simon Marchi , gdb-patches@sourceware.org References: <20201001025656.2561757-1-simon.marchi@polymtl.ca> <20201013152705.36523-1-simon.marchi@polymtl.ca> From: Pedro Alves Message-ID: <5ede20ac-5b58-5693-eeb2-bf61095d078d@palves.net> Date: Tue, 13 Oct 2020 16:44:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 15:44:07 -0000 On 10/13/20 4:31 PM, Simon Marchi via Gdb-patches wrote: >> +standard_testfile >> + >> +save_vars { GDBFLAGS } { >> + # Enable target-async off this way, because with board >> + # native-extended-gdbserver, the remote target is already open when >> + # returning from prepare_for_testing, and that would be too late to toggle >> + # it. >> + append GDBFLAGS { -ex "maintenance set target-async off" } >> + >> + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { >> + return >> + } >> + >> + # Make sure our command-line flag worked. >> + gdb_test "maintenance show target-async" "Controlling the inferior in asynchronous mode is off\\." >> + >> + if { ![runto_main] } { >> + fail "can't run to main" >> + return >> + } >> + >> + gdb_continue_to_end >> +} Note the save_vars scope only needs to be around prepare_for_testing. Anyway, LGTM.