From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +LFpCizkW2fptxMAWB0awg (envelope-from ) for ; Fri, 13 Dec 2024 02:37:16 -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=m7DqCDTQ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2615D1E097; Fri, 13 Dec 2024 02:37:16 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.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 autolearn=unavailable autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 8518E1E05C for ; Fri, 13 Dec 2024 02:37:15 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3504C3858C33 for ; Fri, 13 Dec 2024 07:37:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3504C3858C33 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=m7DqCDTQ Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 4E66A3858CD1 for ; Fri, 13 Dec 2024 07:36:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E66A3858CD1 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 4E66A3858CD1 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=1734075402; cv=none; b=fBj7TpmIQPjhRRGaGWfA9ugTD341GEXU6CV11wRVFtTpRNcq147/Dru67BzptyIvenmHEHbDsmc694SiWvScZmi6mv5m5NYHjPXY4R6Fqxgl9QHFeGIBSF/8l788cz1eaUDIIXvSZBKpg8p6iNR4nt6RoyEZkrM8B8VoIKqDIuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734075402; c=relaxed/simple; bh=4YxpD7ISjMk8oeb26g3PE6a9uNnoUXK7Wq2XYe/g2rg=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=tAR6TyLT6DK4fbtTHGhf79tsEFIKpqTAfEpb/6oGJV1Gj7IYHKj1gXZJ3vEx5XLf7BQlp7l0tL8ERdgjpzd2QOo4jfMlGLX8FM48AKnq1gWULC4SHtdqe0VdzGeWk0VvBvPegCRyzlwCCXpRTgldT7E0IG/5qxX7X50W5D5bWWo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E66A3858CD1 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 1tM0E5-0003i0-IU; Fri, 13 Dec 2024 02:36: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=im0ieQfmR69LA58H0BpBmr3UAa3kNonjnPdesEt6y04=; b=m7DqCDTQh3Jz kkzzWsiRMm0rlnlp+bRl2cnFtJb2C4p764hhty6eWTQyWjIOrxSqKf5o6psB45Y5MG8RDxV4AQ162 xP58MF5b/NkNUKhIwmJQ0/sYg9CibvFo/4ekQJanSvaOvaf7jKd+QitthCdBMWNHLp977+Y2aJlm2 bVhHVZWL54TwqWkyHYk7r2C7cUe1XLgAdso3YPiH2UmRo+iy2/DvRX9WYWsTfIzR3XwRqDeqzAZ1K PesW8Y6m91pke0DGvGyR6v5qVXONK9kua9l8j57c2VYUJA2olBd5RfhlPFovlGopAGLK1y5mpkQQf nMff/XYunYMKy8jGHVV0MQ==; Date: Fri, 13 Dec 2024 09:36:38 +0200 Message-Id: <86ttb8xce1.fsf@gnu.org> From: Eli Zaretskii To: Keith Seitz Cc: gdb-patches@sourceware.org In-Reply-To: <08a19a3debe4a1e3c6072a807e79566277a7c0dc.1734022384.git.keiths@redhat.com> (message from Keith Seitz on Thu, 12 Dec 2024 13:07:41 -0800) Subject: Re: [PATCH v2] Add gstack script References: <08a19a3debe4a1e3c6072a807e79566277a7c0dc.1734022384.git.keiths@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: Keith Seitz > Date: Thu, 12 Dec 2024 13:07:41 -0800 > > --- Changes in v2 > - Review feedback from Andrew Burgess > o Don't chmod gstack.in in configure.ac. > o Fix testsuite issues which could mislead users into thinking > that tests succeeded when they did not. > --- Thanks. > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -62,6 +62,9 @@ > * Support for process record/replay and reverse debugging on loongarch*-linux* > targets has been added. > > +* Newly installed $prefix/bin/gstack uses GDB to print stack traces of > + running processes. This is okay, but please say that gstack is a Bash shell script. Also, what did you want to say by the "newly installed" part? > +@node gstack man > +@heading gstack > + > +@c man title gstack Print a stack trace of a running program > + > +@format > +@c man begin SYNOPSIS gstack > +gstack [-h | --help] [-v | --version] @var{pid} > +@c man end > +@end format > + > +@c man begin DESCRIPTION gstack > +Print a stack trace of a running program with process ID @var{pid}. If the process > +is multi-threaded, @command{gstack} outputs backtraces for every thread which exists > +in the process. > +@c man end > + > +@c man begin OPTIONS gstack > +@table @env > +@item --help > +@itemx -h > +List all options, with brief explanations. > + > +@item --version > +@itemx -v > +Print version information and then exit. > +@end table > +@c man end > + > +@c man begin SEEALSO gstack > +@ifset man > +The full documentation for @value{GDBN} is maintained as a Texinfo manual. > +If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo > +documentation are properly installed at your site, the command > + > +@smallexample > +info gdb > +@end smallexample > + > +@noindent > +should give you access to the complete manual. > + > +@cite{Using GDB: A Guide to the GNU Source-Level Debugger}, > +Richard M. Stallman and Roland H. Pesch, July 1991. > +@end ifset > +@c man end Is that all we want to tell in the manual about the script? Even for a man page this is quite terse. Can we expand on this some more? At the very least I think we should tell that the script invokes G|DB to attach to the program and produce the backtraces, then detaches from the program. Also, perhaps tell what happens if PID identifies a non-existent process? > +awk -- "$awk_script" What if the system has only gawk or nawk or mawk? Should the literal "awk" be a variable? Reviewed-By: Eli Zaretskii