From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id BB0A0385DDE2 for ; Tue, 9 Jul 2024 15:57:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB0A0385DDE2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB0A0385DDE2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720540648; cv=none; b=A7jM38SxAaGtww5Ul9rkeUQTbLFwGxpWdzDJeoeD54UXJl8GQGbPA4sxN9pTCke/kymu1sh6XPxe2dwr/Sy7AD9CjT29il9i8ko+rvkdwb3jc1o6X4ZYl00FHZfv9xGBvr8QU+vS7xGEIvGqG4iNVSggNt/tu3mwjWeuDdNHpsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720540648; c=relaxed/simple; bh=ABeCsR70jFmaxFYq4sYTxl3MnCjjVe5ua1GzyZNB+rI=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=px9H8rsFn+OHOj9oV7K5U7EYaSla3fPR4Jg8KqZAIizdUML55BbpcBn2Dg1VPnOPgTkNVDRTAjsUeV+Og3IxS6wo94g9gpQTjMkdiCvzXOoTQRdWkJJ4R6vZ5TQ1ebo44J0vllPaG1JWQd65Cjm3dDFoVsDYW8zxCoxkk6S+ayE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRDDa-00046V-5k; Tue, 09 Jul 2024 11:57:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Ctxsb5vb9K9Pv8GGQibx9OrjEhLfo5kPzVBg1IJJ+pk=; b=I2wl4ASdjqm4 JotRyyQZQcJ61/gHnwBse6NyzwzwdY+xk5u9x82utWyYLCM0gLRjehjq/xFdH6WNNo8Jx5zH/ZGXc HrJcAk5I/0FfTtMAce3CaydoejATRbEYZ5xIdcwD8CRA2WNQlcf+kDarLSKYBpjXqNLHAwYdC+Sxs fxVnk/HP2XcL5bJz7tWaGaZI63opxx+tz7zfofaSl3T+/sSOAsikwuFbKsrUjCbGTrTcV8sfDcHbj XOQ7gFJdfkVWV5vZMq424y7X0LXaubqTSSLG3TUhbZ58uj/pCTuukJWFe7bcqwq9NvK7A69l89mZA aiiTYLLcasulkwdwwY31Ew==; Date: Tue, 09 Jul 2024 18:57:23 +0300 Message-Id: <86ikxezhgc.fsf@gnu.org> From: Eli Zaretskii To: Natalia Saiapova Cc: gdb-patches@sourceware.org In-Reply-To: <20240709150410.34624-6-natalia.saiapova@intel.com> (message from Natalia Saiapova on Tue, 9 Jul 2024 15:04:09 +0000) Subject: Re: [PATCH v2 5/6] gdb: refine commands to control scheduler locking. References: <20240709150410.34624-1-natalia.saiapova@intel.com> <20240709150410.34624-6-natalia.saiapova@intel.com> X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,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 List-Id: > From: Natalia Saiapova > Date: Tue, 9 Jul 2024 15:04:09 +0000 > > gdb/NEWS | 20 ++ > gdb/doc/gdb.texinfo | 70 +++++- > gdb/infrun.c | 224 ++++++++++++++---- > .../gdb.mi/user-selected-context-sync.exp | 22 +- > .../gdb.threads/hand-call-in-threads.exp | 10 +- > .../multiple-successive-infcall.exp | 6 +- > gdb/testsuite/gdb.threads/schedlock.exp | 80 ++++++- > gdb/testsuite/lib/gdb.exp | 70 ++++-- > 8 files changed, 400 insertions(+), 102 deletions(-) Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index 47677cb773a..188596b20e7 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -58,6 +58,26 @@ list . > lines. This makes it more obvious that there is no information, as opposed > to implying there is no inferior loaded. > > +set scheduler-locking (on|off) > +show scheduler-locking > + where is one of the following: > + non-step | replay non-step | replay step | step. > + Extend the scheduler locking settings with a set of set/show > + commands, which can be used individually to control the scheduler during > + stepping and non-stepping commands. Stepping commands include step, stepi, next. > + Non-stepping commands include continue, finish, until, jump, return. > + 'non-step' -- when on, the scheduler is locked during non-stepping commands > + in normal mode. > + 'replay non-step' -- when on, the scheduler is locked during non-stepping > + commands in replay mode. > + 'replay step' -- when on, the scheduler is locked during stepping > + commands in replay mode. > + 'step' -- when on, the scheduler is locked during stepping commands > + in normal mode. > + The older scheduler locking settings can be used as shortcuts, their behavior > + is preserved. > + The output of "show scheduler-locking" has changed to support the new settings. > + This part is okay. > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -7175,28 +7175,67 @@ On some OSes, you can modify @value{GDBN}'s default behavior by > locking the OS scheduler to allow only a single thread to run. > > @table @code > -@item set scheduler-locking @var{mode} > @cindex scheduler-locking > +@item set scheduler-locking @var{type} [@code{on}|@code{off}] > +@cindex scheduler locking type > +@cindex lock scheduler > +Set the scheduler locking settings. It applies to normal execution, > +record mode, and replay mode. You can configure scheduler locking separately > +for stepping and non-stepping commands. Examples of stepping commands are: > +@samp{step}, @samp{stepi}, @samp{next}. Examples of non-stepping commands are > +@samp{continue}, @samp{finish}, @samp{jump}, @samp{until}, @samp{return} or > +inferior function calls. Please always put the index entries _before_ the @item. That way, when the reader follows the index entry in the Info reader, he/she will be placed on the line corresponding to @item, not the line after it. > +@item non-step > +When @code{on}, the scheduler is locked for non-stepping commands during > +normal execution and record modes. For non-stepping commands other threads > +may not preempt the current thread. This setting is @code{off} by default. I'd suggest minor rewording, which I think will make this text easier to read and understand: When @code{on}, the scheduler is locked for non-stepping commands during normal execution and record modes. This means other threads may not preempt the current thread when @value{GDBN} executes non-stepping commands. > +@item replay non-step > +When @code{on}, the scheduler is locked for non-stepping commands during > +replay mode. For non-stepping commands other threads may not preempt > +the current thread. This setting is @code{on} by default. > + > +@item replay step > +When @code{on}, the scheduler is locked for stepping commands during replay > +mode. While stepping, other threads may not preempt the current thread, > +so that the focus of debugging does not change unexpectedly. This setting > +is @code{on} by default. > + > +@item step > +When @code{on}, the scheduler is locked for stepping commands during > +normal execution and record modes. While stepping, other threads may not > +preempt the current thread, so that the focus of debugging does not change > +unexpectedly. This setting is @code{off} by default. Similarly with these 3 settings. > +Scheduler locking for stepping commands. W/o arguments locks the scheduler \ > +for stepping."), _("\ This line is too long, I think. It is better to break it into two. OK with those nits fixed. Reviewed-By: Eli Zaretskii