GSTACK(1)
π gstack β GSTACK(1) π
okay bestie, welcome to the GNU Development Tools manual page for gstack β yes, that's GSTACK(1), and it is literally here to print a stack trace of a running program. π«Ά
β¨ NAME β¨
gstack β Print a stack trace of a running program. π₯
πΈ SYNOPSIS πΈ
gstack [-h | --help] [-v | --version] pid
π¦ DESCRIPTION π¦
So here's the tea: gstack prints a stack trace of a running program with process ID pid. If that process is multi-threaded, gstack outputs backtraces for every thread which exists in the process. π
The script invokes GDB, attaches to the given process ID, prints the stack trace, and detaches from the process. iconic. β¨
gstack exits with non-zero status if gdb was unable to attach to the given process ID for any reason, such as a non-existent process ID or insufficient privileges to attach to the process. no cap, if the attach doesn't work, it's a non-zero exit. π
π OPTIONS π
--help,-hβ lists all options, with brief explanations. π--version,-vβ prints version information and then exits. β¨
π ENVIRONMENT π
AWKβ full file name for an Awk interpreter to use. If not set,PATHwill be searched for anawkprogram. πGDBβ full file name for a GDB executable to use to generate stack backtraces. If not set,PATHwill be searched for agdbprogram. π§GDBARGSβ optional arguments to be passed to thegdbprogram. π
β SEE ALSO β
The full documentation for GDB is maintained as a Texinfo manual. If the info and gdb programs and GDB's Texinfo documentation are properly installed at your site, the command
info gdb
should give you access to the complete manual. π
Using GDB: A Guide to the GNU Source-Level Debugger, Richard M. Stallman and Roland H. Pesch, July 1991.
π COPYRIGHT π
Copyright (c) 1988-2024 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being "Free Software" and "Free Software Needs Free Documentation", with the Front-Cover Texts being "A GNU Manual," and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: "You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom."
π«Ά mwah! this page is from gdb-16.3.90.20250906-git, dated 2026-10-03, and it's GSTACK(1) forever. π
π¦ where this page comes from
- nixpkgs unstable: gcc-arm-embedded 15.3.rel2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms