From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6ykbEf+KU2HMEAAAWB0awg (envelope-from ) for ; Tue, 28 Sep 2021 17:37:03 -0400 Received: by simark.ca (Postfix, from userid 112) id 33F231EE25; Tue, 28 Sep 2021 17:37:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7B4101EDF0 for ; Tue, 28 Sep 2021 17:37:02 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB7A8385803C for ; Tue, 28 Sep 2021 21:37:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB7A8385803C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632865021; bh=3wkvNxCiC9fftL9rVqd4DiZOoi4JLPfp79hDxkvgAmk=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=OCG8g/68itpQLpfOiRksGYijw+9t/une/OeuoIkum/gmlUY1syMPXG4Z7tNZnjVZY u0E7QP+Gcn9IauD3TWRKQBaiaE2f1kVW+D4Tm6i02nYSWbRS201Y7uqUCxGdmmBF/K sfRPnjxWR4ATyEUPQr/iqNEWKwB+w28CJ6U62E/E= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id E6950385800F; Tue, 28 Sep 2021 21:35:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6950385800F Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 18SLYeZx026854 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Sep 2021 17:34:45 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 18SLYeZx026854 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B7D731EDF0; Tue, 28 Sep 2021 17:34:39 -0400 (EDT) Message-ID: <16e63c8d-121b-83cb-1631-37e96864a1c0@polymtl.ca> Date: Tue, 28 Sep 2021 17:34:38 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: How to combine two GDB commands into one Content-Language: en-US To: Philippe Waroquiers , =?UTF-8?B?5ZGo5pil5piOKOaXpeaciCk=?= , Gdb-patches , gdb-patches References: <9bd8f786-daaa-47d5-a4a1-926fdd3f7137.riyue.zcm@alibaba-inc.com> <08e408898e2d476ec4d185e0bc112c1faa10e3a6.camel@skynet.be> In-Reply-To: <08e408898e2d476ec4d185e0bc112c1faa10e3a6.camel@skynet.be> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 28 Sep 2021 21:34:40 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-09-28 17:18, Philippe Waroquiers wrote: > On Tue, 2021-09-28 at 18:24 +0800, 周春明(日月) via Gdb-patches wrote: >> Dear GDB experts, >> >> I have a request, in some scene, I want to "set scheduler-locking on", then "next", then "scheduler-locking off", >> Can I combine the three commands into one? >> >> Thanks, >> -Riyue > > In your .gdbinit, something like: > define schedlock-next > set scheduler-locking on > next > set scheduler-locking off > end > > and then the newly defined schedlock-next command should do what you want. > > See e.g. https://sourceware.org/gdb/current/onlinedocs/gdb/Sequences.html#Sequences > for more details. > > You can also extend GDB using python or guile. Not the original question, but why not use "set scheduler-locking step"? Simon