GSTACK(1)
π GSTACK(1) β GNU Development Tools, bestie edition
okay so picture this: it's GSTACK(1), it lives in the GNU Development Tools suite, and it's literally the "what is my program even DOING right now" button. π«Ά
β¨ NAME β¨
gstack β print a stack trace of a running program. that's it. that's the whole gig. π
π SYNOPSIS π
gstack [-h | --help] [-v | --version] pid
π¦ DESCRIPTION π¦
okay so you've got a running program with process ID pid, and you want to know where it's at β like, spiritually, in the code. gstack prints a stack trace of that running program for you. no cap. π
and if the process is multi-threaded? bestie, it does not pick favorites β gstack outputs backtraces for every thread which exists in the process. all of them. every single one. the whole group chat gets a stack trace. π
under the hood the script invokes GDB, attaches to the given process ID, prints the stack trace, and detaches from the process. in, out, no drama, no lingering. β¨
gstack exits with non-zero status if "gdb" was unable to attach to the given process ID for any reason β like a non-existent process ID, or insufficient privileges to attach to the process. so if it flops, it flops loudly. π
π OPTIONS π
--help,-hβ List all options, with brief explanations. the "wait what does this do again" button. πΈ--version,-vβ Print version information and then exit. cute little flex, then it dips. π
π ENVIRONMENT π
AWKβ Full file name for an Awk interpreter to use. If not set,PATHwill be searched for an"awk"program. iykyk. π§GDBβ Full file name for a GDB executable to use to generate stack backtraces. If not set,PATHwill be searched for a"gdb"program. π₯GDBARGSβ Optional arguments to be passed to the"gdb"program. little extra seasoning, your call. π
β 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. go read it, it's giving encyclopedia but make it slay. π
also: Using GDB: A Guide to the GNU Source-Level Debugger, Richard M. Stallman and Roland H. Pesch, July 1991. vintage. iconic. π
π COPYRIGHT π
Copyright (c) 1988-2026 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."
fr fr, that license text is not a vibe you can skip β it's the whole legal main character energy of this page. π
k bye bestie, go trace some stacks β this page came to you from gdb-18.1, dated 2026-09-25, and that's the GSTACK(1) sign-off. π¦β¨
π¦ where this page comes from
- arch rolling: loongarch64-linux-gnu-gdb 18.1-1 Β· GPL-3.0-or-later AND LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms