From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id juaNIdf1Lmk2eBAAWB0awg (envelope-from ) for ; Tue, 02 Dec 2025 09:21:11 -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=D1FviibX; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 731B41E0B3; Tue, 02 Dec 2025 09:21:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from 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 2BB661E08D for ; Tue, 02 Dec 2025 09:21:07 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98A9E4BB593E for ; Tue, 2 Dec 2025 14:21:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98A9E4BB593E 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=D1FviibX Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id 2E1974BA23F2 for ; Tue, 2 Dec 2025 14:20:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E1974BA23F2 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 2E1974BA23F2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.51.188.92 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764685242; cv=none; b=cTZMPnmraXvE+cYQVkPCruhrncPgaMWazkH/rpq+jnkYI5JZVrRnrOfb0FkbI7U1782tkhwamyiqnjOy6Ydc1+a86lQHF3BdeMq9dPQ7aLEM4al3hrstXrafsh0HRleWRKYLD+/30zKYoiiOQj0yC0yV947jZHloKsUjMv4sR08= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764685242; c=relaxed/simple; bh=ksSrkQeE7wOiGf8x1XaC9f4fwm3LMzb2RDiDJkKBqp8=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=UtBu1FCrzFGhRadCsQpReHVqyWk9TPiM+PGuZhgjv3kQvk6dzdNG7ieo+L0msIsMhX5uYX8d3JG8sT45ooCM2apH4I6eZOH2J78ZAJnEuLdtFJyimGLiUeZvEICNklM8m1Ei5aeU91f4kLiFynINS/hJm1nioKtFOIg2t3oltV0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E1974BA23F2 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 1vQRFB-0004ee-Nm; Tue, 02 Dec 2025 09:20:41 -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=kni/HOPvtUdyQZsHtk42UcsKl7K2dO3qNkycUeqm920=; b=D1FviibX06ny d18Mh+N2gWBLlZPZnmRUat/DUvELU+hM71mh16rVT7sjw7a4EZjl1Oa74UqjAAigBfLftCNEnZi1+ XFzzx/Xk2N3LwfR7brvJ1vmprO9biw40LztrNyn+LWEHZ/9p8+hTwmY9BLTMlEJy0RyQkjAQgyFy9 dMurci0XS716JfSgbg5PhdnNlMWgceniUeE7k0tjB8EFl5VcBZc+VkUnnG2Lri0lFS22qrF8DFSkB 3xx14IEa1ARScs0ntuo5UDTOivFQpz6hzBI5p6j+yQAM0RMlgYcIdvBCB76KO4mV0SM/00d3OhGqP Xtp1znGn4wNmpxhQR7RCyA==; Date: Tue, 02 Dec 2025 16:20:39 +0200 Message-Id: <864iq93qyw.fsf@gnu.org> From: Eli Zaretskii To: Guinevere Larsen Cc: gdb-patches@sourceware.org In-Reply-To: <20251201170819.1573624-1-guinevere@redhat.com> (message from Guinevere Larsen on Mon, 1 Dec 2025 14:08:19 -0300) Subject: Re: [PATCH] gdb: add tutorial command References: <20251201170819.1573624-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: Mon, 1 Dec 2025 14:08:19 -0300 > > Before this commit, there is little way for a new user to learn how to > use GDB on their own. The documentation contains an example session, > but that isn't contained in GDB itself, and the "help" and "apropos" > commands exist, but they aren't the best to really teach what GDB can > do, only to describe commands on their own. > > This commit changes this by introducing a command called "tutorial", > which takes a page out of common design from the last few decades and > provides a self-contained tutorial for users, walking them through a > simple bug in C code, and explaining several commands in context. Thanks. It's a very good idea to have an interactive tutorial, but I suggest we discuss a few alternatives for implementing it before diving into the details. First, writing this command in Python means that GDB without Python will not have a tutorial, which is IMO a pity. Is it so complicated to have this implemented in C++ instead? The text and the basic script of the tutorial session could be on a text file that code accesses when the tutorial is running, so that only the necessary stuff needs to be in code. Next, I'm not sure we need to compile a program for this purpose. We could use the GDB executable itself instead: that would allow us to show the basic commands without the need for the user to have a compiler and a working development environment to go with it. Also, a tutorial doesn't have to teach people how to debug, it could only teach them the important GDB commands to use for debugging. Doing both makes the tutorial more complex because it teaches two non-trivial subjects instead of just one. What do others think? > diff --git a/gdb/NEWS b/gdb/NEWS > index 01c998f4ea0..4543404d28a 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -59,6 +59,10 @@ maintenance test-remote-args ARGS > Test splitting and joining of inferior arguments ARGS as they would > be split and joined when being passed to a remote target. > > +tutorial > + Guided example session with a generated C file, to teach an entirely > + new user how to use GDB for basic debugging. > + > * Changed commands This part is okay. Should we describe this in the manual as well? Reviewed-By: Eli Zaretskii