From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by sourceware.org (Postfix) with ESMTPS id D20F23858407 for ; Mon, 11 Jul 2022 16:09:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D20F23858407 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-f50.google.com with SMTP id b26so7657449wrc.2 for ; Mon, 11 Jul 2022 09:09: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:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WXiWdUzlq+jzZAzQYMgTJKHA6a59BOfN3Sul8NBy9L4=; b=if3sCfDA4pJ5Bhb67Pe8T2dVVDiRJPUU3+bf7ImDFCPe8mpfSM6ZFuxHGIxpeiOBKK +JErxHWYZgCox858VxT2D1b3D1k5/QaqK7mtMoBYku+s2RDzQF8OJj4RHtFJ6i6qu38Q zx92znXwSAUBJapB4SqawseWzVghoy+OzsUQy9/EJ4UgAUmFr/GrEgBRocyxCYlZaHvd 2FOvSsP0rmHAGRy8Y8WyJTm3cB5/5APGPc6nMi6Em8iMiymylF3reVifw+tpUAfSNGyf td3oDTRGSaltvtV8y/FHfEobqynxupnW8M078d9TfkmQJrpsNrSXj4Fn9/lJTK4B17By E7kg== X-Gm-Message-State: AJIora8CK7NGpXwX0nsl96BFtLBTGh6Kz/3sjgfUVqdZSiKBU24wQtMg 753JMXl8Xl3yeoiTHLrovjxNa8KphgQ= X-Google-Smtp-Source: AGRyM1tj8rkdr6hpuMCAP2p0363anegPaFEEjw9VmJOGkclcYsRa4UCgbVU/HmWGddX5uw1DsKQCEw== X-Received: by 2002:a05:6000:1545:b0:21d:8f3e:a0bd with SMTP id 5-20020a056000154500b0021d8f3ea0bdmr18121851wry.697.1657555755317; Mon, 11 Jul 2022 09:09:15 -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 u9-20020a7bc049000000b0039747cf8354sm6947640wmc.39.2022.07.11.09.09.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jul 2022 09:09:14 -0700 (PDT) Subject: Re: [PATCH 19/25] Don't resume new threads if scheduler-locking is in effect To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20220620225419.382221-1-pedro@palves.net> <20220620225419.382221-20-pedro@palves.net> <83a6a6l1fk.fsf@gnu.org> <72ce23b7-6e3c-b867-6d96-9df93fba5cfb@palves.net> <83mtdfzma7.fsf@gnu.org> From: Pedro Alves Message-ID: Date: Mon, 11 Jul 2022 17:09:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <83mtdfzma7.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 16:09:20 -0000 On 2022-07-11 4:44 p.m., Eli Zaretskii wrote: >> Cc: gdb-patches@sourceware.org >> From: Pedro Alves >> Date: Mon, 11 Jul 2022 15:20:03 +0100 >> >>>> +* If supported by the target, when scheduler-locking is in effect, new >>>> + threads created by the resumed thread are held stopped. >>> ^^^^^^^^^^^^^^^^^^ >>> "a resumed thread", I guess? >> >> When scheduler locking is in effect, execution commands only resume one thread, >> so "the" seems more correct to me. > > I don't think so, because which thread that is, is unknown to the > reader at this point. > > As a compromise, I suggest to say "new threads created by resumed > threads". > >> I wrote the sentence in the manual first, before copying it here, and in the manual, >> the text describing scheduler locking, above my new sentence says for example: >> >> "If @code{on}, then only the current thread may run when the inferior is resumed." > > That's fine, but I don't see how it implies anything for the NEWS > entry. Besides, the m,annual has context that NEWS not necessarily does. You had said "Same here, " for the manual part, and I was explaining that for the manual it makes sense to use "the", and that I just copied it over to NEWS. > >> I notice now that the whole "set scheduler-locking" description doesn't even >> say that not all targets support scheduler locking. Hmm. How about I just >> remove the "If supported by the target" part. We can just consider that targets >> that don't behave that way yet should be fixed (there's a new testcase that >> will fail for such targets), while older GDBservers just can't ever be fixed, >> but such is life of software progress. > > That's okay, but it takes care of a different wording issue. > >> How about this, then, given the explanations above? Is it OK? >> >> diff --git c/gdb/NEWS w/gdb/NEWS >> index 1178a37017e..94553f18608 100644 >> --- c/gdb/NEWS >> +++ w/gdb/NEWS >> @@ -3,6 +3,9 @@ >> >> *** Changes since GDB 12 >> >> +* When scheduler-locking is in effect, new threads created by the >> + resumed thread are held stopped. >> + >> * "info breakpoints" now displays enabled breakpoint locations of >> disabled breakpoints as in the "y-" state. For example: >> >> diff --git c/gdb/doc/gdb.texinfo w/gdb/doc/gdb.texinfo >> index 7a4e337d15b..fc297218696 100644 >> --- c/gdb/doc/gdb.texinfo >> +++ w/gdb/doc/gdb.texinfo >> @@ -6953,6 +6953,9 @@ current thread away from the thread that you are debugging. The >> @code{replay} mode behaves like @code{off} in record mode and like >> @code{on} in replay mode. >> >> +When scheduler-locking is in effect, new threads created by the >> +resumed thread are held stopped. > > This still has the same "the resumed thread" issue. > Sure, because I had explained why I thought it was still better. Let's treat NEWS and manual differently, then. This version adds the missing context in the NEWS entry. WDYT? diff --git c/gdb/NEWS w/gdb/NEWS index 1178a37017e..d474ed21350 100644 --- c/gdb/NEWS +++ w/gdb/NEWS @@ -3,6 +3,13 @@ *** Changes since GDB 12 +* Scheduler-locking and new threads + + When scheduler-locking is in effect, only the current thread may run + when the inferior is resumed. However, previously, new threads + created by the resumed thread would still be able to run free. Now, + they are held stopped. + * "info breakpoints" now displays enabled breakpoint locations of disabled breakpoints as in the "y-" state. For example: diff --git c/gdb/doc/gdb.texinfo w/gdb/doc/gdb.texinfo index 7a4e337d15b..fc297218696 100644 --- c/gdb/doc/gdb.texinfo +++ w/gdb/doc/gdb.texinfo @@ -6953,6 +6953,9 @@ current thread away from the thread that you are debugging. The @code{replay} mode behaves like @code{off} in record mode and like @code{on} in replay mode. +When scheduler-locking is in effect, new threads created by the +resumed thread are held stopped. + @item show scheduler-locking Display the current scheduler locking mode. @end table