| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.47) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" |
| 56 |
.\" Required to disable full justification in groff 1.23.0. |
| 57 |
.if n .ds AD l |
| 58 |
.\" ======================================================================== |
| 59 |
.\" |
| 60 |
.IX Title "GSTACK 1" |
| 61 |
.TH GSTACK 1 2026-02-25 gdb-17.1-4.fc44 "GNU Development Tools" |
| 62 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 63 |
.\" way too many mistakes in technical documents. |
| 64 |
.if n .ad l |
| 65 |
.nh |
| 66 |
.SH NAME |
| 67 |
gstack \- Print a stack trace of a running program |
| 68 |
.SH SYNOPSIS |
| 69 |
.IX Header "SYNOPSIS" |
| 70 |
gstack [\-h | \-\-help] [\-v | \-\-version] \fIpid\fR |
| 71 |
.SH DESCRIPTION |
| 72 |
.IX Header "DESCRIPTION" |
| 73 |
Print a stack trace of a running program with process ID \fIpid\fR. If the process |
| 74 |
is multi\-threaded, \fBgstack\fR outputs backtraces for every thread which exists |
| 75 |
in the process. |
| 76 |
.PP |
| 77 |
The script invokes GDB, attaches to the given process ID, prints the stack trace, |
| 78 |
and detaches from the process. |
| 79 |
.PP |
| 80 |
\&\fBgstack\fR exits with non\-zero status if \f(CW\*(C`gdb\*(C'\fR was unable to attach to |
| 81 |
the given process ID for any reason, such as a non\-existent process ID or |
| 82 |
insufficient privileges to attach to the process. |
| 83 |
.SH OPTIONS |
| 84 |
.IX Header "OPTIONS" |
| 85 |
.IP \fB\-\-help\fR 4 |
| 86 |
.IX Item "--help" |
| 87 |
.PD 0 |
| 88 |
.IP \fB\-h\fR 4 |
| 89 |
.IX Item "-h" |
| 90 |
.PD |
| 91 |
List all options, with brief explanations. |
| 92 |
.IP \fB\-\-version\fR 4 |
| 93 |
.IX Item "--version" |
| 94 |
.PD 0 |
| 95 |
.IP \fB\-v\fR 4 |
| 96 |
.IX Item "-v" |
| 97 |
.PD |
| 98 |
Print version information and then exit. |
| 99 |
.SH ENVIRONMENT |
| 100 |
.IX Header "ENVIRONMENT" |
| 101 |
.IP \fBAWK\fR 4 |
| 102 |
.IX Item "AWK" |
| 103 |
Full file name for an Awk interpreter to use. If not set, \fBPATH\fR will be |
| 104 |
searched for an \f(CW\*(C`awk\*(C'\fR program. |
| 105 |
.IP \fBGDB\fR 4 |
| 106 |
.IX Item "GDB" |
| 107 |
Full file name for a GDB executable to use to generate stack backtraces. |
| 108 |
If not set, \fBPATH\fR will be searched for a \f(CW\*(C`gdb\*(C'\fR program. |
| 109 |
.IP \fBGDBARGS\fR 4 |
| 110 |
.IX Item "GDBARGS" |
| 111 |
Optional arguments to be passed to the \f(CW\*(C`gdb\*(C'\fR program. |
| 112 |
.SH "SEE ALSO" |
| 113 |
.IX Header "SEE ALSO" |
| 114 |
The full documentation for GDB is maintained as a Texinfo manual. |
| 115 |
If the \f(CW\*(C`info\*(C'\fR and \f(CW\*(C`gdb\*(C'\fR programs and GDB\*(Aqs Texinfo |
| 116 |
documentation are properly installed at your site, the command |
| 117 |
.PP |
| 118 |
.Vb 1 |
| 119 |
\& info gdb |
| 120 |
.Ve |
| 121 |
.PP |
| 122 |
should give you access to the complete manual. |
| 123 |
.PP |
| 124 |
\&\fIUsing GDB: A Guide to the GNU Source\-Level Debugger\fR, |
| 125 |
Richard M. Stallman and Roland H. Pesch, July 1991. |
| 126 |
.SH COPYRIGHT |
| 127 |
.IX Header "COPYRIGHT" |
| 128 |
Copyright (c) 1988\-2025 Free Software Foundation, Inc. |
| 129 |
.PP |
| 130 |
Permission is granted to copy, distribute and/or modify this document |
| 131 |
under the terms of the GNU Free Documentation License, Version 1.3 or |
| 132 |
any later version published by the Free Software Foundation; with the |
| 133 |
Invariant Sections being "Free Software" and "Free Software Needs |
| 134 |
Free Documentation", with the Front\-Cover Texts being "A GNU Manual," |
| 135 |
and with the Back\-Cover Texts as in (a) below. |
| 136 |
.PP |
| 137 |
(a) The FSF\*(Aqs Back\-Cover Text is: "You are free to copy and modify |
| 138 |
this GNU Manual. Buying copies from GNU Press supports the FSF in |
| 139 |
developing GNU and promoting software freedom." |