Next: GUDのコマンド, Previous: GUDの開始, Up: Emacs下でのデバッガーの実行 [Contents][Index]
GUD interactionバッファーは、デバッガーサブプロセスにテキストコマンドを送ったり、それの出力を記録するのに使用されるEmacsバッファーです。これはM-x gud-gdbや、 GUDの開始にリストされた他のコマンドで使用される、デバッガーとやりとりするための基本的なインターフェースです。 M-x gdbコマンドは、ブレークポイント、スタックフレーム、その他のデバッガーの状態の様相を制御する、追加の特別なバッファーにより、この機能を拡張します(GDBのグラフィカルインターフェースを参照してください)。
GUD interactionはShellモードの変種を使用するので、Shellモードで定義されたEmacsコマンドが利用可能です(Shellモードを参照してください)。ほとんどのデバッガーコマンドにたいして補完(補完を参照してください)が利用可能で、それらを繰り返すのに、通常のShellモードのヒストリーコマンドを使うことができます。 GUD interactionバッファーで使用できる特別なコマンドについては、GUDのコマンド を参照してください。
プログラムをデバッグすると、Emacsは関連するソースファイルをEmacsバッファーにvisitして、カレント実行行には左フリンジに矢印が表示されます(テキスト端末では最初の2列に‘=>’の矢印が表示されます)。そのようなバッファーでのポイントの移動は、矢印を移動しません。これらのソースファイルの編集はできますが、行の挿入や削除により矢印の位置は失われることに注意してください。なぜならEmacsには編集されたソース行が、デバッガーサブプロセスから報告されるどの行に対応するか、知る手立てがないからです。この情報を更新するには通常、プログラムのリコンパイルと再実行が必要です。
Moreover, GUD is capable of visually demarcating the current execution line
within the window text itself in one of two fashions: the first takes effect
when the user option gud-highlight-current-line
is enabled, and
displays that line in an overlay whose appearance is provided by the face
gud-highlight-current-line-face
. The other takes effect when HL Line
Mode (see カーソルの表示) is enabled, and moves the overlay introduced
by HL Line Mode briefly to the execution line, until a subsequent editing
command repositions it back beneath the cursor.
GUD Tooltip mode is a global minor mode that adds tooltip support to GUD.
To toggle this mode, type M-x gud-tooltip-mode. It is disabled by
default. If enabled, you can move the mouse pointer over a variable, a
function, or a macro (collectively called identifiers) to show their
values in tooltips (see ツールチップ). If just placing the mouse pointer
over an expression doesn’t show the value of the expression you had in mind,
you can tell Emacs more explicitly what expression to evaluate by dragging
the mouse over the expression, then leaving the mouse inside the marked
area. The GUD Tooltip mode takes effect in the GUD interaction buffer, and
in all source buffers with major modes listed in the variable
gud-tooltip-modes
. If you turned off the tooltip mode, values are
shown in the echo area instead of a tooltip.
M-x gud-gdbでGUD
Tooltipモードを使用する場合、GDBにより表示される式の値は、マクロを展開する場合があり、これはデバッグされているプログラムに副作用をもたらすかもしれません。この理由により、gud-gdb
ではツールチップの使用は無効になっています。M-x
gdbインターフェースを使用する場合、この問題は発生しません。なぜなら副作用を避ける特別なコードがあるからです。さらにプログラムが実行されていないときに、識別子に関連付けられたマクロの定義を表示することもできます。
Next: GUDのコマンド, Previous: GUDの開始, Up: Emacs下でのデバッガーの実行 [Contents][Index]