.de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .de IX .. .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" fudge factors for nroff and troff . .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} .\" simple accents for nroff and troff . .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} .\" troff and (daisy-wheel) nroff accents . .ds : \k:\h'-(\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \k:\h'-(\n(.wu+\w'\(de'u\-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\fI\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E .\" corrections for vroff . .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' .\" for low resolution devices (crt and lpr) . .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "GDB 1" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" translated for 11.2 ribbon .\" .TH GDB 1 2022\-01\-16 gdb\-11.2 "GNU Development Tools" .if n .ad l .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .nh .SH 名前 gdb \- GNU デバッガー .SH 書式 .IX Header 書式 gdb [\fB\-help\fP] [\fB\-nh\fP] [\fB\-nx\fP] [\fB\-q\fP] [\fB\-batch\fP] [\fB\-cd=\fP\fIdir\fP] [\fB\-f\fP] [\fB\-b\fP\ \fIbps\fP] [\fB\-tty=\fP\fIdev\fP] [\fB\-s\fP \fIsymfile\fP] [\fB\-e\fP\ \fIprog\fP] [\fB\-se\fP\ \fIprog\fP] [\fB\-c\fP\ \fIcore\fP] [\fB\-p\fP\ \fIprocID\fP] [\fB\-x\fP\ \fIcmds\fP] [\fB\-d\fP\ \fIdir\fP] [\fIprog\fP|\fIprog\fP \fIprocID\fP|\fIprog\fP \fIcore\fP] .SH 説明 .IX Header 説明 \s-1GDB\s0 をはじめとするデバッガーは、プログラムが実行中またはクラッシュした時に、 そのプログラムの「内部」で何が行なわれているか/行われていたかを調べるのに使用されます。 .PP \&\s-1GDB\s0 は、4 つの機能 (加えてこれらをサポートする機能) によって 実行中にバグを見つけることを手助けします。 .IP \(bu 4 プログラムの動作を詳細に指定してプログラムを実行させる。 .IP \(bu 4 指定した条件でプログラムを停止させる。 .IP \(bu 4 プログラムが止まった時に、何が起こったか調べる。 .IP \(bu 4 バグによる副作用を修正し、別のバグを調べるためプログラムの状態を変更する。 .PP \s-1GDB\s0 では C, C++, Fortran, Modula\-2 で書かれたプログラムのデバッグが行なえます。 .PP \&\s-1GDB\s0 はシェルコマンド \f(CW\*(C`gdb\*(C'\fP で起動されます。 いったん起動すると、\s-1GDB\s0 コマンド \f(CW\*(C`quit\*(C'\fP を実行して終了するまで、 端末からコマンドを読み続けます。 \s-1GDB\s0 のオンラインヘルプは、\s-1GDB\s0 の中から \f(CW\*(C`help\*(C'\fP コマンドを実行して見ることができます。 .PP \f(CW\*(C`gdb\*(C'\fP は引数やオプション無しで起動できますが、 たいていは 1 つか 2 つの引数をつけて起動します。 実行プログラムを引数にする場合は以下のようにします。 .PP .Vb 1 \& gdb program .Ve .PP また実行プログラムと core ファイルの両方を指定することもできます。 .PP .Vb 1 \& gdb program core .Ve .PP もし実行中のプロセスのデバッグを行ないたい場合には、 第 2 引数として core の代わりにプロセス \s-1ID\s0 を指定するか、あるいはオプション \&\f(CW\*(C`\-p\*(C'\fP を用います: .PP .Vb 2 \& gdb program 1234 \& gdb \-p 1234 .Ve .PP こうすれば \s-1GDB\s0 をプロセス \f(CW1234\fP にアタッチできます。 \fB\-p\fP を用いる場合は、 \fIprogram\fP のファイル名は省略することができます。 .PP よく利用される \s-1GDB\s0 コマンドには以下のようなものがあります。 .IP "\fBbreak [\fP\fIfile\fP\fB:]\fP\fIfunction\fP" 4 .IX Item "break [file:]function" プレークポイントを (\fIfile\fP 内の) \fIfunction\fP に設定します。 .IP "\fBrun [\fP\fIarglist\fP\fB]\fP" 4 .IX Item "run [arglist]" プログラムの実行を開始します (もしあれば \fIarglist\fP を引数として)。 .IP \fBbt\fP 4 .IX Item bt バックトレース: プログラムのスタックを表示します。 .IP "\fBprint\fP \fIexpr\fP" 4 .IX Item "print expr" 式の値を表示します。 .IP \fBc\fP 4 .IX Item c プログラムの実行を再開します (たとえばブレークポイントで実行を中断した後)。 .IP \fBnext\fP 4 .IX Item next 次のプログラム行を実行します (停止状態の後)。 その行内のすべての関数は 1 ステップで実行されます。 .IP "\fBedit [\fP\fIfile\fP\fB:]\fP\fIfunction\fP" 4 .IX Item "edit [file:]function" 現在中断している場所のプログラム行をエディターで開きます。 .IP "\fBlist [\fP\fIfile\fP\fB:]\fP\fIfunction\fP" 4 .IX Item "list [file:]function" 現在中断している場所の近辺のプログラムソースを表示します。 .IP \fBstep\fP 4 .IX Item step 次のプログラム行を実行します (停止状態の後)。 もしその行に関数が含まれていれば、その関数内をステップ実行していきます。 .IP "\fBhelp [\fP\fIname\fP\fB]\fP" 4 .IX Item "help [name]" \s-1GDB\s0 コマンド \fIname\fP についての情報や、 \s-1GDB\s0 を使う上での一般的な情報を表示します。 .IP \fBquit\fP 4 .IX Item quit \s-1GDB.\s0 を終了します。 .PP \s-1GDB\s0 の詳細については \fIUsing \s-1GDB: A\s0 Guide to the \s-1GNU\s0 Source\-Level Debugger\fP, by Richard M. Stallman and Roland H. Pesch を参照して下さい。 同じテキストは、 \f(CW\*(C`info\*(C'\fP プログラム内の \f(CW\*(C`gdb\*(C'\fP エントリからオンラインで参照できます。 .SH オプション .IX Header オプション オプション以外の引数は、 実行ファイルと core ファイル (またはプロセス \s-1ID\s0) を指定します。 つまりオプションフラグと関連づいていない最初の引数は、 \fB\-se\fP オプションで指定するファイルと同じになります。 また、もしも2番目があれば、 \fB\-c\fP オプションで指定するファイルと同じになります。 オプションの多くは、 長い表記法と短い表記法の両方で指定することができますが、 ここではその両方を示します。 長い表記法は、 どのオプションであるのかが明確であれば、 短く切り詰めても構いません。 (好みにより \fB\-\fP の代わりに \fB+\fP が使用できますが、ここではよく用いられる表記で記します。) .PP すべてのオプションとコマンドライン引数は、 指定した順番に処理されます。 \fB\-x\fP オプションが使用されると、 この順番は変わります。 .IP \fB\-help\fP 4 .IX Item \-help .PD 0 .IP \fB\-h\fP 4 .IX Item \-h .PD 短い説明つきで、 すべてのオプションを表示します。 .IP \fB\-symbols=\fP\fIfile\fP 4 .IX Item \-symbols=file .PD 0 .IP "\fB\-s\fP \fIfile\fP" 4 .IX Item "\-s file" .PD シンボルテーブルをファイル \fIfile\fP から読みます。 .IP \fB\-write\fP 4 .IX Item \-write 実行ファイルやコアファイルへの書き込みを有効にします。 .IP \fB\-exec=\fP\fIfile\fP 4 .IX Item \-exec=file .PD 0 .IP "\fB\-e\fP \fIfile\fP" 4 .IX Item "\-e file" .PD ファイル \fIfile\fP を実行可能ファイルとして利用します。 core dump と連係して pure data を調べるのにも用いられます。 .IP \fB\-se=\fP\fIfile\fP 4 .IX Item \-se=file \& ファイル \fIfile\fP からシンボルテーブルを読み、 同時にそれを実行可能ファイルとして利用します。 .IP \fB\-core=\fP\fIfile\fP 4 .IX Item \-core=file .PD 0 .IP "\fB\-c\fP \fIfile\fP" 4 .IX Item "\-c file" .PD ファイル \fIfile\fP を core dump として利用します。 .IP \fB\-command=\fP\fIfile\fP 4 .IX Item \-command=file .PD 0 .IP "\fB\-x\fP \fIfile\fP" 4 .IX Item "\-x file" .PD ファイル \fIfile\fP から \s-1GDB\s0 のコマンドを読み込み、実行します。 .IP "\fB\-ex\fP \fIcommand\fP" 4 .IX Item "\-ex command" 指定された \s-1GDB\s0 \fIcommand\fP を実行します。 .IP \fB\-directory=\fP\fIdirectory\fP 4 .IX Item \-directory=directory .PD 0 .IP "\fB\-d\fP \fIdirectory\fP" 4 .IX Item "\-d directory" .PD ソースファイルを探す検索パスに \fIdirectory\fP を追加します。 .IP \fB\-nh\fP 4 .IX Item \-nh \fI~/.config/gdb/gdbinit\fP、 \fI~/.gdbinit\fP、 \fI~/.config/gdb/gdbearlyinit\fP、 \fI~/.gdbearlyinit\fP の各ファイルから、 コマンドを実行しません。 .IP \fB\-nx\fP 4 .IX Item \-nx .PD 0 .IP \fB\-n\fP 4 .IX Item \-n .PD \fI~/.gdbinit\fP または \fI.gdbearlyinit\fP の初期化ファイルからコマンド実行しません。 .IP \fB\-quiet\fP 4 .IX Item \-quiet .PD 0 .IP \fB\-q\fP 4 .IX Item \-q .PD 起動時のメッセージおよび copyright を表示しません。 これらのメッセージはバッチモードでも抑制されます。 .IP \fB\-batch\fP 4 .IX Item \-batch バッチモードで動作します。 \fB\-x\fP で指定したファイル (および抑制されていなければ \fI.gdbinit\fP ファイル) 内の全てのコマンドを処理した後、戻り値として \f(CW0\fP を返して終了します。 コマンドファイル内の \s-1GDB\s0 コマンドの実行中にエラーが生じた場合は、 0 以外の値で終了します。 .Sp バッチモードは \s-1GDB\s0 をフィルタとして実行する場合、 たとえばプログラムをダウンロードして別のコンピュータ上で実行したりする場合 に便利です。 以下のメッセージ .Sp .Vb 1 \& Program exited normally. (プログラムは正常に終了しました。) .Ve .Sp は通常、\s-1GDB\s0 の制御端末上で実行されるプログラムが終了するたびに 出力されるものですが、 バッチモードではこのようなメッセージは出力されません。 .IP \fB\-cd=\fP\fIdirectory\fP 4 .IX Item \-cd=directory カレントディレクトリの代わりに \fIdirectory\fP を \s-1GDB\s0 の作業用ディレクトリとして実行します。 .IP \fB\-fullname\fP 4 .IX Item \-fullname .PD 0 .IP \fB\-f\fP 4 .IX Item \-f .PD Emacs が \s-1GDB\s0 をサブプロセスとして実行する際に、 このオプションを付加します。 このとき \s-1GDB\s0 は、スタックフレームが表示されるたびに (プログラムが中断するたびに)、 完全なファイル名と行番号を標準的な認識しやすい形式で表示します。 この表示書式は 2 つの \fB\032\fP 文字、ファイル名、行番号とコロンで区切られた文字位置、改行の順になっています。 これは Emacs\-GDB インタフェースプログラムにおいて、 フレームに対応するソースコードを表示するために 2 つの \fB\032\fP 文字を使うことになっているからです。 .IP "\fB\-b\fP \fIbps\fP" 4 .IX Item "\-b bps" リモートデバッグ用に \s-1GDB\s0 が利用するシリアルインタフェースの回線速度を (ボーレートまたはビット/秒で) 設定します。 .IP \fB\-tty=\fP\fIdevice\fP 4 .IX Item \-tty=device プログラムの標準入出力に \fIdevice\fP を利用します。 .SH 関連項目 .IX Header 関連項目 \s-1GDB\s0 の完全なドキュメントは Texinfo マニュアルとしてメンテナンスされています。\f(CW\*(C`info\*(C'\fP と \f(CW\*(C`gdb\*(C'\fP の両プログラム、および \s-1GDB\s0 の Texinfo ドキュメントが適切にインストールされていれば、以下のコマンド .PP .Vb 1 \& info gdb .Ve .PP を実行して完全なマニュアルを参照できます。 .PP \&\fIUsing \s-1GDB: A\s0 Guide to the \s-1GNU\s0 Source\-Level Debugger\fP, Richard M. Stallman and Roland H. Pesch, July 1991. .SH 著作権 .IX Header 著作権 Copyright (c) 1988\-2022 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being \*(L"Free Software\*(R" and \*(L"Free Software Needs Free Documentation\*(R", with the Front\-Cover Texts being \*(L"A \s-1GNU\s0 Manual,\*(R" and with the Back\-Cover Texts as in (a) below. .PP (a) \s-1FSF\s0 の裏表紙には、 以下の文章が記述されています: \*(L"You are free to copy and modify this \s-1GNU\s0 Manual. Buying copies from \s-1GNU\s0 Press supports the \s-1FSF\s0 in developing \s-1GNU\s0 and promoting software freedom.\*(R"