From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by sourceware.org (Postfix) with ESMTPS id 9770D3858D1E for ; Wed, 16 Mar 2022 14:58:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9770D3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f51.google.com with SMTP id u10so3338921wra.9 for ; Wed, 16 Mar 2022 07:58:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=3HzTpPu5bnd9lSLGC3ERBCKH56ej7lIR91lmbkT9hzc=; b=Why3yzAFkR8gX6ro26mpV236eZzBpCBnk2ofeWtvIY2zdiyRBjNpobY5ydT7LpdOgq CysuCVdMt9BdzOseJxtYfAbdf5lSAW4xzZHqRXH+7pm+zl80gYOFOEuJmNVmlob29rzE LSBNrD5/jFVz35k1IA9g8vVQHSnkKC+332UAlsEKfDYWLvDjTY0u4b4XXK8hU5FpDI1v +AMWZJiHsGmKqvqtgJJOUIi19uJ07xOoZ+HUPOz96VB3lsZuwDKij5qq02iUKK1gsz9P LgpWoKGdt1rcNwlWQB2AiPPhvdr0I9vilU1GKb6zzTa+wZURIecNiDYXMBevm5KvErpA dH0g== X-Gm-Message-State: AOAM531enRP57pPlGrC37k05bzYqWEnLf8w/U62oiO8qZCxCQM+ltTgO 5HkazZQYlWKjFp96zImbEiaPrNQ9iF9LJQ== X-Google-Smtp-Source: ABdhPJwFuaHHdNXwYQL7r+MsqqWcvl2Xll14RK9tad6On+NdT3GLf1yrKkaFQwh+Yjmxwkin7tKVdg== X-Received: by 2002:a05:6000:168e:b0:1f1:faf0:d2ba with SMTP id y14-20020a056000168e00b001f1faf0d2bamr282502wrd.432.1647442696534; Wed, 16 Mar 2022 07:58:16 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id l5-20020a5d6745000000b001f1e4e40e42sm1776607wrw.77.2022.03.16.07.58.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Mar 2022 07:58:15 -0700 (PDT) Message-ID: <4f443800-59d7-5e87-f89e-b2d574ed071a@palves.net> Date: Wed, 16 Mar 2022 14:58:14 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Issue with multiple threads using remote protocol on riscv32 Content-Language: en-US To: "Denio, Mike" , "gdb@sourceware.org" References: <0f242330e5e242dea1957fbab47a6473@ti.com> From: Pedro Alves In-Reply-To: <0f242330e5e242dea1957fbab47a6473@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2022 14:58:19 -0000 Hi! On 2022-03-16 14:45, Denio, Mike via Gdb wrote: > (gdb) c -a& > > 'vCont;c:1' ---> > <--- '$OK#9a' > <--- '%Stop:T05thread:1;#b7' // THIS STOP IS LOST BECAUSE GDB IMMEDIATELY TELLS THREAD 1 TO CONTINUE This stop hasn't been acknowledged yet with vStopped at this point, so ... > 'vCont;c' ---> > <--- '$OK#9a' ... from this 'vCont;c''s perspective, thread 1 is still running, so the server should ignore the 'c' action for thread 1. gdbserver does this here, in linux-low.c::linux_set_resume_request ... /* If the thread has a pending event that has already been reported to GDBserver core, but GDB has not pulled the event out of the vStopped queue yet, likewise, ignore the (wildcard) resume request. */ if (in_queued_stop_replies (thread->id)) { threads_debug_printf ("not resuming LWP %ld: has queued stop reply", lwpid_of (thread)); continue; } ... Pedro Alves