From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id DORNM0Ufc2lvABEAWB0awg (envelope-from ) for ; Fri, 23 Jan 2026 02:12:05 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=mxoYF/Fy; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C43C01E08D; Fri, 23 Jan 2026 02:12:05 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1DD621E08D for ; Fri, 23 Jan 2026 02:12:05 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 65B0C4BC89BA for ; Fri, 23 Jan 2026 07:12:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65B0C4BC89BA Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=mxoYF/Fy Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id D4AD94BCA401 for ; Fri, 23 Jan 2026 07:11:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4AD94BCA401 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 D4AD94BCA401 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=1769152283; cv=none; b=eADbX7XAJRkFpYP+yUPKIAwC8BFfq3F/Ptd92IEIpLCPcHE2vM5yQo8S7hfiByIj8eoEVCpklKi+gpXuP2sEtVhNgcSCOddEMfp7B1YTwIr6PHeIyrLbok7yhyd0/RQLRIsWtpbH7foNTbf9GSApkbRN7S2qcV/vPA2Lrl8WvV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769152283; c=relaxed/simple; bh=5bcSLkyFunSZn1mPoER04+rlr6B21+ZTZHDp+0qYsdU=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=GFPhgv82gt31XumkCSfuh8dg96DyvMhufR3jOrbzOyKz1k55aUXX30fzvmRCc/teezgS3Rx+Vmg6vDsOWOWPnq18tUSsC2yM4o4moPnH5qoZ7p1spOpSwDTczNSfuh7y3KbU9AG++tYvYOQ6us6u2xadvInbjqPZx1KPDb0ATfI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4AD94BCA401 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 1vjBKF-00035A-7k; Fri, 23 Jan 2026 02:11:23 -0500 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=oGgIVC4j3GsIAvvj6r1rbioKxb6B+96HPH74LkP+DSs=; b=mxoYF/FyOszu mdmWdzF1145AXs9Ea/VKFIqqDq0Kqlo8nxQOaAG/SkFed1fW7mW9hdjXmlS/GaHSRjzexv5rvKpFC eHGDjKeJ776wlAMOd/sfA9abN55cO3t16/xANISS3NpehoD8vC7307h+knp9oGgUrp7kWprUZtG0W pur1Hy5xKi0ueiKD4GNYyPRJVV2pKS0kXlKwL/bv3drEx/Zwob6NH8QGX1PUMbv03+9ZBk06PnJ0Y JjfD8mjkzw6eGsz2WJntYKN3ekajn0abmo0pJ7yaTuL3mkytmYUxdRWUoPiuq9bkjLPRvxiR2lkq+ FvqPGLZo1zEDKwfI5VC/Ag==; Date: Fri, 23 Jan 2026 09:11:15 +0200 Message-Id: <86o6mkiz1o.fsf@gnu.org> From: Eli Zaretskii To: Guinevere Larsen Cc: gdb-patches@sourceware.org In-Reply-To: <20260122202834.393095-1-guinevere@redhat.com> (message from Guinevere Larsen on Thu, 22 Jan 2026 17:28:34 -0300) Subject: Re: [PATCH v2] gdb: add tutorial command References: <20260122202834.393095-1-guinevere@redhat.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > From: Guinevere Larsen > Cc: Guinevere Larsen > Date: Thu, 22 Jan 2026 17:28:34 -0300 > > gdb/NEWS | 4 + > gdb/data-directory/Makefile.in | 1 + > gdb/doc/gdb.texinfo | 34 +++ > gdb/python/lib/gdb/command/tutorial.py | 404 +++++++++++++++++++++++++ > gdb/top.c | 5 +- > 5 files changed, 447 insertions(+), 1 deletion(-) > create mode 100644 gdb/python/lib/gdb/command/tutorial.py Thanks. > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -80,6 +80,10 @@ show progress-bars enabled > content, to be disabled (the set command), or to see if > progress-bars are currently enabled or not (the show command). > > +tutorial > + Guided example session with a generated C file, to teach an entirely > + new user how to use GDB for basic debugging. Perhaps "Start a guided example session..." would be more in-line with the style of describing commands? Also, I think we should document that this command is only available if GDB was built with Python, both in NEWS and in the manual. > +@item tutorial > +This command starts an interactive tutorial, teaching you basic commands > +and how you can chain them together for a successful debugging session. > +Warning: If you have an ongoing debug session, this command will kill that I would suggest to give "Warning" the @emph or @strong markup. > +@smallexample > +(@value{GDBP}) tutorial This example takes quite a few lines, but we don't want it to be broken between pages in arbitrary places, I think. So we should use @group..@end group either around the entire text, or at least around each paragraph of it. > +Welcome to GDB! This quick tutorial should be enough to get ^^ There should be two spaces there. > +This means you can use it to prototype a solution without > +needing to recompile the inferior. Try it by setting 'vec' > +to a sorted array, like by using: > + print vec = {0, 1, 2, 3, 4, 5} > +and see how the program would end, with the "continue" > +command again. Isn't it strange to teach newbies that to assign a value to a variable, one must use the 'print' command? Why not "set variable"? > + print("The solution didn't work. Try again!") ^^ > + elif tutorial_state == (len(state_string) - 1): > + print( > + "The tutorial is complete. Exiting tutorial and cleaning up the artifacts" ^^ Two spaces between sentences again. > + This tutorial does not aim to be comprehensive. On the contrary, ^^ And here. > + def invoke(self, arg_str, from_tty): > + global tutorial_state, generated_code > + print( > + """ > +Welcome to GDB! This quick tutorial should be enough to get ^^ Likewise. Reviewed-By: Eli Zaretskii