1 .\" Copyright (C) 1993, 2011-2012 Free Software Foundation, Inc.
2 .\" See section COPYING for conditions for redistribution
3 .\"*******************************************************************
5 .\" This file was generated with po4a. Translate the source file.
7 .\"*******************************************************************
8 .TH gdbserver 1 "2 November 1993" "Cygnus Support" "GNU Development Tools"
10 gdbserver \- GNU デバッガ用リモートサーバ
15 tty prog [\|\fBargs...\fP\|]
17 \fBgdbserver\fP tty \fB\-\-attach\fP PID
20 GDBSERVER は、デバッグ対象のプログラムを実行しているマシンとは異なる マシン上で GDB を実行することを可能にするプログラムです。
24 まず、デバッグ対象のプログラムのコピーをターゲットシステムに用意します。 GDBserver は、シンボルを関知しないので、使用スペースを節約するために
25 プログラムをストリップしても構いません。全てのシンボルは、ホストシステムで 実行される GDB によって考慮されます。
27 サーバを使用するためには、ターゲットシステムにログインし、`gdbserver' プログラムを実行します。(a) GDB との通信方法、(b)
28 プログラム名、 (c) プログラムへの引数 を指定する必要があります。一般的な書式は以下のように なります:
30 target> gdbserver COMM PROGRAM [ARGS ...]
32 例えば、シリアルポートを使用する場合は、以下のようになります。
34 target> gdbserver /dev/com1 emacs foo.txt
36 この例では、emacs を引数 foo.txt を用いてデバッグすることを指定し、 GDB との通信に /dev/com1
37 を使用します。gdbserver は、ホストの GDB が 通信して来ることを辛抱強く待ちます。
39 TCP 接続を使用する場合は、以下のようになります。
41 target> gdbserver host:2345 emacs foo.txt
43 この例では、ホストの GDB との通信に TCP を用いる以外は、前の例と同じです。 引数 `host:2345' は、`host' からの TCP
44 接続が ローカルの TCP ポート 2345 に接続されるのを待つ、という意味です。(現状では `host' 部は無視されます。)
45 ターゲットシステムで存在する TCP ポートとの衝突が無ければ、ポート番号は 自由に選ぶことができます。ホストの GDB の `target
46 remote' コマンドで、 同じポート番号を指定する必要があります。他のサービスと衝突するポート番号を 選んだ場合、gdbserver
49 いくつかのターゲットでは、 gdbserver を実行中のプログラムに接続することができます。これを行うには \-\-attach
52 target> gdbserver COMM \-\-attach PID
54 PID は現在実行中のプロセスのプロセス ID です。
55 gdbserver に実行中のプロセスのバイナリを指定する必要はありません。
59 GDB がシンボルテーブルを検査したりするため、ホストシステムには、ターゲット プログラムのストリップされていないコピーが必要です。通常の場合同様、
60 最初の引数にターゲットプログラムを指定して GDB を起動します。(シリアルラインが 9600 baud 以外で動作している場合は、\-\-baud
61 オプションが必要です。) つまり、`gdb TARGET\-PROG' あるいは、`gdb \-\-baud BAUD TARGET\-PROG' のように
62 起動します。その後、新たに覚える必要のあるコマンドは、`target remote' だけです。
63 コマンドの引数は、デバイス名(通常、`/dev/ttyb' のようなシリアルデバイス)か、 HOST:PORT 記述子です。例えば、
65 (gdb) target remote /dev/ttyb
67 は、シリアルライン /dev/ttyb を使用してサーバと通信します。また、
69 (gdb) target remote the\-target:2345
71 は、TCP 接続で、ホスト `the\-target' の gdbserver を起動した時に指定した ポートと同じポート 2345
72 を使用してサーバと通信します。TCP 接続の場合、 `target remote' コマンドを実行する前に gdbserver
73 を実行しておく必要があります。 そうしないと、`Connection refused' というようなエラーになるでしょう。
75 デバッグの対象となるプログラムの名前と、通信に使用する tty を指定する 必要があります。他の全てのことはリモートの GDB が行います。
76 その他の引数は、そのままプログラムに渡されます。
78 \fBinfo\fP 内の `\|\fBgdb\fP\|' エントリー\&; \fIUsing GDB: A Guide to the GNU
79 Source\-Level Debugger\fP, Richard M. Stallman and Roland H. Pesch, July 1991.
81 Copyright (c) 1993 Free Software Foundation, Inc.
83 Permission is granted to make and distribute verbatim copies of this manual
84 provided the copyright notice and this permission notice are preserved on
87 Permission is granted to copy and distribute modified versions of this
88 manual under the conditions for verbatim copying, provided that the entire
89 resulting derived work is distributed under the terms of a permission notice
90 identical to this one.
92 Permission is granted to copy and distribute translations of this manual
93 into another language, under the above conditions for modified versions,
94 except that this permission notice may be included in translations approved
95 by the Free Software Foundation instead of in the original English.