GSTACK(1)

๐Ÿ“ฆ
version 7.2.4 ยท 2 versions
, in arch rolling

๐Ÿ’… GSTACK(1) โ€” like, the whole manual, bestie

okay so this is gstack(1), straight out of the GNU Development Tools corner of the universe, and I'm gonna walk you through the entire thing. no skips, no summaries, we're reading the whole menu. ๐Ÿซถ


โœจ NAME โœจ

gstack โ€” prints a stack trace of a running program. that's it. that's the whole vibe. ๐Ÿ”ฅ

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

gstack [-h | --help] [-v | --version] pid

literally just hand it a pid and it goes. icon behavior. โœจ

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so picture this: you've got a program running, you know its process ID โ€” that's your pid โ€” and you want to see its stack trace. gstack prints it for you. main character energy. ๐Ÿ’…

and here's the slay part: if the process is multi-threaded, gstack outputs backtraces for every thread which exists in the process. not just one, bestie. all of them. every single one. ๐ŸŽ€

how does it do it? the script invokes ROCGDB, attaches to the given process ID, prints the stack trace, and detaches from the process. attach โ†’ print โ†’ detach, in and out, no mess. ๐Ÿงš

โš ๏ธ heads up: gstack exits with a 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's being weird, check your pid and check your perms. ๐Ÿ˜ญ

๐Ÿ’– OPTIONS ๐Ÿ’–

  • --help, -h โ€” lists all options, with brief explanations. your little menu. ๐Ÿ“
  • --version, -v โ€” prints version information and then exits. bye bestie ๐Ÿ‘‹

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

these are the env vars it peeks at, iykyk:

  • AWK โ€” full file name for an Awk interpreter to use. if it's not set, PATH will be searched for an "awk" program. ๐Ÿฆ‹
  • GDB โ€” full file name for a ROCGDB executable to use to generate stack backtraces. if it's not set, PATH will be searched for a "gdb" program. ๐Ÿ”ฅ
  • GDBARGS โ€” optional arguments to be passed to the "gdb" program. little extra seasoning. โœจ

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

the full documentation for ROCGDB is maintained as a Texinfo manual. so if the "info" and "gdb" programs and ROCGDB's Texinfo documentation are all properly installed at your site, this command:

info gdb

should give you access to the complete manual. go read it, it's giving library. ๐Ÿ“š

also worth knowing about: Using GDB: A Guide to the GNU Source-Level Debugger, by Richard M. Stallman and Roland H. Pesch, July 1991. vintage. iconic. ๐Ÿ’œ

Copyright ยฉ 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."

AMD ROCm software is made available by Advanced Micro Devices, Inc. under the open source license identified in the top-level directory for the library in the repository on @url{https://github.com/ROCm/,Github.com} (Portions of AMD ROCm software are licensed under MITx11 and UIL/NCSA. For more information on the license, review the license.txt in the top-level directory for the library on @url{https://github.com/ROCm/,Github.com}). The additional terms and conditions below apply to your use of AMD ROCm technical documentation.

ยฉ2019-2024 Advanced Micro Devices, Inc. All rights reserved.

The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions, and typographical errors. The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. Any computer system has risks of security vulnerabilities that cannot be completely prevented or mitigated. AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of such revisions or changes.

THIS INFORMATION IS PROVIDED "AS IS." AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES, ERRORS, OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY PERSON FOR ANY RELIANCE, DIRECT, INDIRECT, SPECIAL, OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

AMD, the AMD Arrow logo, AMD Instinctโ„ข, Radeonโ„ข, AMD ROCmโ„ข, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Linuxยฎ is the registered trademark of Linus Torvalds in the U.S. and other countries. PCIeยฎ is a registered trademark of PCI-SIG Corporation. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies.


and that's the whole page, bestie!! ๐Ÿซถโœจ this little masterpiece is from gdb-16.3, dated 2026-05-31, and it's GSTACK(1) all the way down. go trace some stacks, you absolute legend. ๐Ÿ’œ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from