<?xml version='1.0' encoding='utf-8'?>
<pod xmlns="http://axkit.org/ns/2000/pod2xml">
<head>
	<title>NAME
<index>debug</index> <index>debugger</index></title>
</head>
<sect1>
<title>NAME
<index>debug</index> <index>debugger</index></title>
<para>
perldebug - Perl debugging
</para>
<para>
perldebug - Perl のデバッグ
</para>
</sect1>
<sect1>
<title>DESCRIPTION</title>
<para>
First of all, have you tried using the <strong>-w</strong> switch?
</para>
<para>
まず最初に一言「もう <strong>-w</strong> スイッチはお使いになりましたか。」
</para>
<para>
If you're new to the Perl debugger, you may prefer to read
<link xref='perldebtut'>perldebtut</link>, which is a tutorial introduction to the debugger .
</para>
<para>
もし Perl デバッガに慣れていないなら、デバッガに関するチュートリアルである
<link xref='perldebtut'>perldebtut</link> を読んだ方がいいかもしれません。
</para>
</sect1>
<sect1>
<title>The Perl Debugger</title>
<para>
If you invoke Perl with the <strong>-d</strong> switch, your script runs under the
Perl source debugger.  This works like an interactive Perl
environment, prompting for debugger commands that let you examine
source code, set breakpoints, get stack backtraces, change the values of
variables, etc.  This is so convenient that you often fire up
the debugger all by itself just to test out Perl constructs
interactively to see what they do.  For example:
<index>-d</index>
</para>
<para>
Perl を <strong>-d</strong> スイッチを付けて起動すれば、スクリプトは Perl ソースデバッガ
上で実行されることになります。
これは対話的な Perl 環境のように動作し、
ソースコードの表示、ブレークポイントの設定、スタックのバックトレース、
変数の値の変更、などを実行するデバッガコマンドを入力できます。
これはとても便利なので、単にやりたいことを対話的に試すために
デバッガを起動するようになるでしょう。
例えば:
<index>-d</index>
</para>
<verbatim><![CDATA[
$ perl -d -e 42
]]></verbatim>
<para>
In Perl, the debugger is not a separate program the way it usually is in the
typical compiled environment.  Instead, the <strong>-d</strong> flag tells the compiler
to insert source information into the parse trees it's about to hand off
to the interpreter.  That means your code must first compile correctly
for the debugger to work on it.  Then when the interpreter starts up, it
preloads a special Perl library file containing the debugger.
</para>
<para>
しかし、Perl デバッガは典型的なコンパイルされた環境の様に独立した
プログラムではありません。　その代わりに、
-d フラグによって、コンパイラがインタプリタに渡すパース木にソース情報を
埋め込むようにしています。これは、ソースがデバッガ上で動作できるためには、
一度正常にコンパイルできないといけないということです。
それからインタプリタが起動され、デバッガを含む
特別な Perl ライブラリをロードします。
</para>
<para>
The program will halt <emphasis>right before</emphasis> the first run-time executable
statement (but see below regarding compile-time statements) and ask you
to enter a debugger command.  Contrary to popular expectations, whenever
the debugger halts and shows you a line of code, it always displays the
line it's <emphasis>about</emphasis> to execute, rather than the one it has just executed.
</para>
<para>
プログラムは、最初の実行時実行文の<emphasis>直前</emphasis>で停止し
(ただし、以下コンパイル時実行文については後述します)、以下に示すいずれかの
コマンドが入力されるのを待ちます。
よくある期待とは逆に、
デバッガが停止してある行のコードを表示しているときは、
直前に実行した行ではなく、常に<emphasis>今から実行する</emphasis>行を表示します。
</para>
<para>
Any command not recognized by the debugger is directly executed
(<code>eval</code>'d) as Perl code in the current package.  (The debugger
uses the DB package for keeping its own state information.)
</para>
<para>
デバッガが認識できないコマンドは現在のパッケージ内で Perl のコードとして
実行(<code>eval</code>)されます。
(デバッガは自分自身の状態を保存するために DB パッケージを使います。)
</para>
<para>
Note that the said <code>eval</code> is bound by an implicit scope. As a
result any newly introduced lexical variable or any modified
capture buffer content is lost after the eval. The debugger is a
nice environment to learn Perl, but if you interactively experiment using
material which should be in the same scope, stuff it in one line.
</para>
<para>
<code>eval</code> は暗黙のスコープで区切られていることに注意してください。
結果として、新しく導入されたレキシカル変数や変更された捕捉バッファの内容は
eval の後失われます。
デバッガは Perl を学ぶよい環境ですが、もし同じスコープ内であるべき
ものを使って対話的に実験したい場合は、それを 1 行に書いてください。
</para>
<para>
For any text entered at the debugger prompt, leading and trailing whitespace
is first stripped before further processing.  If a debugger command
coincides with some function in your own program, merely precede the
function with something that doesn't look like a debugger command, such
as a leading <code>;</code> or perhaps a <code>+</code>, or by wrapping it with parentheses
or braces.
</para>
<para>
デバッガコマンドとして入力された文字列は、まず先頭と末尾の
空白が切り詰められます。
デバッガコマンドがプログラムの関数名と一致する場合、
関数名の前に <code>;</code> や <code>+</code> のような、デバッガコマンドに見えない文字を
付け加えるか、括弧でくくってください。
</para>
<sect2>
<title>Debugger Commands</title>
<para>
(デバッガコマンド)
</para>
<para>
The debugger understands the following commands:
</para>
<para>
デバッガは以下のコマンドを理解します:
</para>
<list>
<item><itemtext>h
<index>debugger command, h</index></itemtext>
<para>
Prints out a summary help message
</para>
<para>
サマリヘルプメッセージを表示します。
</para>
</item>
<item><itemtext>h [command]</itemtext>
<para>
Prints out a help message for the given debugger command.
</para>
<para>
指定されたコマンドの説明を表示します。
</para>
</item>
<item><itemtext>h h</itemtext>
<para>
The special argument of <code>h h</code> produces the entire help page, which is quite long.
</para>
<para>
<code>h h</code> という特別なコマンドは、かなり長い、ヘルプ全体を表示します。
</para>
<para>
If the output of the <code>h h</code> command (or any command, for that matter) scrolls
past your screen, precede the command with a leading pipe symbol so
that it's run through your pager, as in
</para>
<para>
<code>h h</code> コマンド(や他のコマンドでも)の出力で画面がスクロールしてしまう場合、
以下のようにコマンドの前にパイプ記号をつけるとページャーを呼び出します:
</para>
<verbatim><![CDATA[
DB> |h h
]]></verbatim>
<para>
You may change the pager which is used via <code>o pager=...</code> command.
</para>
<para>
使用されるページャーは <code>O pager=...</code> コマンドで変更できます。
</para>
</item>
<item><itemtext>p expr
<index>debugger command, p</index></itemtext>
<para>
Same as <code>print {$DB::OUT} expr</code> in the current package.  In particular,
because this is just Perl's own <code>print</code> function, this means that nested
data structures and objects are not dumped, unlike with the <code>x</code> command.
</para>
<para>
現在のパッケージでの <code>print {$DB::OUT} expr</code> と同じです。
特に、これは Perl 自身の <code>print</code> 関数なので、
<code>x</code> コマンドと違って、ネストしたデータ構造やオブジェクトはダンプしません。
</para>
<para>
The <code>DB::OUT</code> filehandle is opened to <filename>/dev/tty</filename>, regardless of
where STDOUT may be redirected to.
</para>
<para>
STDOUT がどこにリダイレクトされていても、
ファイルハンドル <code>DB::OUT</code> は <filename>/dev/tty</filename> に対して
オープンされています。
</para>
</item>
<item><itemtext>x [maxdepth] expr
<index>debugger command, x</index></itemtext>
<para>
Evaluates its expression in list context and dumps out the result in a
pretty-printed fashion.  Nested data structures are printed out
recursively, unlike the real <code>print</code> function in Perl.  When dumping
hashes, you'll probably prefer 'x \%h' rather than 'x %h'.
See <link xref='Dumpvalue'>Dumpvalue</link> if you'd like to do this yourself.
</para>
<para>
式をリストコンテキストで評価し、結果を多少読みやすい形で表示します。
ネストしたデータは再帰的に表示します。
これは Perl の実際の <code>print</code> 関数とは異なります。
When dumping
hashes, you'll probably prefer 'x \%h' rather than 'x %h'.
これを自分自身で行いたい場合は <link xref='Dumpvalue'>Dumpvalue</link> を参照して下さい。
</para>
<para>
The output format is governed by multiple options described under
<link xref='#Configurable_Options'>&quot;Configurable Options&quot;</link>.
</para>
<para>
出力フォーマットは <link xref='#Configurable_Options'>&quot;Configurable Options&quot;</link> に記された
様々なオプションの影響を受けます。
</para>
<para>
If the <code>maxdepth</code> is included, it must be a numeral <emphasis>N</emphasis>; the value is
dumped only <emphasis>N</emphasis> levels deep, as if the <code>dumpDepth</code> option had been
temporarily set to <emphasis>N</emphasis>.
</para>
<para>
<code>maxdepth</code> が指定されている場合、それは数値 <emphasis>N</emphasis> でなければなりません;
<code>dumpDepth</code> オプションが一時的に <emphasis>N</emphasis> に設定されたかのように、
値は <emphasis>N</emphasis> レベルの深さでだけダンプされます。
</para>
</item>
<item><itemtext>V [pkg [vars]]
<index>debugger command, V</index></itemtext>
<para>
Display all (or some) variables in package (defaulting to <code>main</code>)
using a data pretty-printer (hashes show their keys and values so
you see what's what, control characters are made printable, etc.).
Make sure you don't put the type specifier (like <code>$</code>) there, just
the symbol names, like this:
</para>
<para>
package (デフォルトは <code>main</code>) 内のすべて (または、一部) の
変数 (variable) をデータプリティプリンタを使って表示します
(ハッシュは何が何か解るように、key と value を表示し、
コントロール文字は表示できる形にします)。
以下に示すように、symbol は名前だけを示し、(<code>$</code> などの) 型識別子を
付けないようにしてください:
</para>
<verbatim><![CDATA[
V DB filename line
]]></verbatim>
<para>
Use <code>~pattern</code> and <code>!pattern</code> for positive and negative regexes.
</para>
<para>
正と逆の正規表現のためには <code>~pattern</code> と <code>!pattern</code> を使ってください。
</para>
<para>
This is similar to calling the <code>x</code> command on each applicable var.
</para>
<para>
これは有効な変数のそれぞれについて <code>x</code> を呼び出すのと似ています。
</para>
</item>
<item><itemtext>X [vars]
<index>debugger command, X</index></itemtext>
<para>
Same as <code>V currentpackage [vars]</code>.
</para>
<para>
<code>V 現在のパッケージ [vars]</code> と同じです。
</para>
</item>
<item><itemtext>y [level [vars]]
<index>debugger command, y</index></itemtext>
<para>
Display all (or some) lexical variables (mnemonic: <code>mY</code> variables)
in the current scope or <emphasis>level</emphasis> scopes higher.  You can limit the
variables that you see with <emphasis>vars</emphasis> which works exactly as it does
for the <code>V</code> and <code>X</code> commands.  Requires the <code>PadWalker</code> module
version 0.08 or higher; will warn if this isn't installed.  Output
is pretty-printed in the same style as for <code>V</code> and the format is
controlled by the same options.
</para>
<para>
現在のスコープや、<emphasis>level</emphasis> だけ高いスコープの全て(またはいくつか)の
レキシカル変数を表示します(記憶法: <code>mY</code> 変数)。
<code>V</code> や <code>X</code> コマンドと全く同じように、<emphasis>vars</emphasis> を制定することで
表示される変数を制限できます。
バージョン 0.08 以降の <code>PadWalker</code> モジュールが必要です;
もしインストールされていなければ警告されます。
出力は <code>V</code> コマンドと同じスタイルにフォーマットされ、
このフォーマットは同じオプションで制御されます。
</para>
</item>
<item><itemtext>T
<index>debugger command, T</index> <index>backtrace</index> <index>stack, backtrace</index></itemtext>
<para>
Produce a stack backtrace.  See below for details on its output.
</para>
<para>
スタックのバックトレースを行います。出力についての詳細は後述します。
</para>
</item>
<item><itemtext>s [expr]
<index>debugger command, s</index> <index>step</index></itemtext>
<para>
Single step.  Executes until the beginning of another
statement, descending into subroutine calls.  If an expression is
supplied that includes function calls, it too will be single-stepped.
</para>
<para>
シングルステップ実行します。
サブルーチンをたどりながら、別の実行文の先頭に到達するまで実行します。
関数呼び出しを含む式が与えられた場合、これもシングルステップ実行します。
</para>
</item>
<item><itemtext>n [expr]
<index>debugger command, n</index></itemtext>
<para>
Next.  Executes over subroutine calls, until the beginning
of the next statement.  If an expression is supplied that includes
function calls, those functions will be executed with stops before
each statement.
</para>
<para>
ネクスト。次の実行文の先頭に到達するまで、サブルーチンにまたがって実行します。
関数呼び出しを含む式が与えられた場合、
各行毎に停止しながら関数を実行します。
</para>
</item>
<item><itemtext>r
<index>debugger command, r</index></itemtext>
<para>
Continue until the return from the current subroutine.
Dump the return value if the <code>PrintRet</code> option is set (default).
</para>
<para>
現在のサブルーチンから戻るまで実行します。
<code>PrintRet</code> がセットされていれば(デフォルトではセットされています)
返り値をダンプします。
</para>
</item>
<item><itemtext>&lt;CR&gt;</itemtext>
<para>
Repeat last <code>n</code> or <code>s</code> command.
</para>
<para>
最後の <code>n</code> または <code>s</code> を繰り返します。
</para>
</item>
<item><itemtext>c [line|sub]
<index>debugger command, c</index></itemtext>
<para>
Continue, optionally inserting a one-time-only breakpoint
at the specified line or subroutine.
</para>
<para>
続きを実行します。
オプションとして、1 回限りのブレークポイントを
指定された行またはサブルーチンに設定します。
</para>
</item>
<item><itemtext>l
<index>debugger command, l</index></itemtext>
<para>
List next window of lines.
</para>
<para>
次の 1 画面分をリスト表示します。
</para>
</item>
<item><itemtext>l min+incr</itemtext>
<para>
List <code>incr+1</code> lines starting at <code>min</code>.
</para>
<para>
<code>min</code> から <code>incr+1</code> 行をリスト表示します。
</para>
</item>
<item><itemtext>l min-max</itemtext>
<para>
List lines <code>min</code> through <code>max</code>.  <code>l -</code> is synonymous to <code>-</code>.
</para>
<para>
<code>min</code> 行から <code>max</code> 行をリスト表示します。
<code>l -</code> は <code>-</code> と同じです。
</para>
</item>
<item><itemtext>l line</itemtext>
<para>
List a single line.
</para>
<para>
指定行をリスト表示します。
</para>
</item>
<item><itemtext>l subname</itemtext>
<para>
List first window of lines from subroutine.  <emphasis>subname</emphasis> may
be a variable that contains a code reference.
</para>
<para>
サブルーチンの最初の一画面分をリスト表示します。
<emphasis>subname</emphasis> は コードリファレンスが入った変数でも構いません。
</para>
</item>
<item><itemtext>-
<index>debugger command, -</index></itemtext>
<para>
List previous window of lines.
</para>
<para>
前の 1 画面分をリスト表示します。
</para>
</item>
<item><itemtext>v [line]
<index>debugger command, v</index></itemtext>
<para>
View a few lines of code around the current line.
</para>
<para>
指定行付近の(数行のコードをリスト表示します。
</para>
</item>
<item><itemtext>.
<index>debugger command, .</index></itemtext>
<para>
Return the internal debugger pointer to the line last
executed, and print out that line.
</para>
<para>
最後に実行した行への内部デバッガポインタを返し、
その行を表示します。
</para>
</item>
<item><itemtext>f filename
<index>debugger command, f</index></itemtext>
<para>
Switch to viewing a different file or <code>eval</code> statement.  If <emphasis>filename</emphasis>
is not a full pathname found in the values of %INC, it is considered
a regex.
</para>
<para>
異なるファイルまたは <code>eval</code> 行に表示を切り替えます。
もし <emphasis>filename</emphasis> が %INC にあるフルパス名でなければ、
正規表現として扱われます。
</para>
<para>
<code>eval</code>ed strings (when accessible) are considered to be filenames:
<code>f (eval 7)</code> and <code>f eval 7\b</code> access the body of the 7th <code>eval</code>ed string
(in the order of execution).  The bodies of the currently executed <code>eval</code>
and of <code>eval</code>ed strings that define subroutines are saved and thus
accessible.
</para>
<para>
<code>eval</code> した文字列は(アクセス可能なら)ファイル名として扱われます:
<code>f (eval 7)</code> と <code>f eval 7\b</code> は (実行した順で) 7 番目に <code>eval</code> した
文字列の中身にアクセスします。
現在実行した <code>eval</code> の中身と、サブルーチンを定義する <code>eval</code> した
中身は保存されるので、アクセス可能です。
</para>
</item>
<item><itemtext>/pattern/</itemtext>
<para>
Search forwards for pattern (a Perl regex); final / is optional.
The search is case-insensitive by default.
</para>
<para>
pattern を用いて Perl 正規表現による前方検索を行います。
最後の / はなくてもかまいません。
デフォルトでは検索は大文字小文字を区別しません。
</para>
</item>
<item><itemtext>?pattern?</itemtext>
<para>
Search backwards for pattern; final ? is optional.
The search is case-insensitive by default.
</para>
<para>
pattern を用いて後方検索を行います。
最後の ? はなくてもかまいません。
デフォルトでは検索は大文字小文字を区別しません。
</para>
</item>
<item><itemtext>L [abw]
<index>debugger command, L</index></itemtext>
<para>
List (default all) actions, breakpoints and watch expressions
</para>
<para>
ブレークポイント、アクション、ウォッチ式を
(デフォルトは全て)リストアップします。
</para>
</item>
<item><itemtext>S [[!]regex]
<index>debugger command, S</index></itemtext>
<para>
List subroutine names [not] matching the regex.
</para>
<para>
regex に一致する(または一致しない)サブルーチン名をリストアップします。
</para>
</item>
<item><itemtext>t
<index>debugger command, t</index></itemtext>
<para>
Toggle trace mode (see also the <code>AutoTrace</code> option).
</para>
<para>
トレースモードの on/off を切り替えます。(<code>AutoTrace</code>
オプションも参照して下さい)
</para>
</item>
<item><itemtext>t expr
<index>debugger command, t</index></itemtext>
<para>
Trace through execution of <code>expr</code>.
See <link xref='perldebguts#Frame_Listing_Output_Examples'>perldebguts/&quot;Frame Listing Output Examples&quot;</link> for examples.
</para>
<para>
<code>expr</code> の実行をトレースします。
例については <link xref='perldebguts#Frame_Listing_Output_Examples'>perldebguts/&quot;Frame Listing Output Examples&quot;</link> を
参照して下さい。
</para>
</item>
<item><itemtext>b
<index>breakpoint</index>
<index>debugger command, b</index></itemtext>
<para>
Sets breakpoint on current line
</para>
<para>
現在の位置にブレークポイントを設定します。
</para>
</item>
<item><itemtext>b [line] [condition]
<index>breakpoint</index>
<index>debugger command, b</index></itemtext>
<para>
Set a breakpoint before the given line.  If a condition
is specified, it's evaluated each time the statement is reached: a
breakpoint is taken only if the condition is true.  Breakpoints may
only be set on lines that begin an executable statement.  Conditions
don't use <code>if</code>:
</para>
<para>
与えられた行の直前にブレークポイントを設定します。
condition が指定されると、その文にさしかかる度に評価されます。
condition が真となったときにだけブレークポイントが働きます。
ブレークポイントは、実行可能な文で始まる行にだけ、
設定できます。　condition には <code>if</code> を使いません:
</para>
<verbatim><![CDATA[
b 237 $x > 30
b 237 ++$count237 < 11
b 33 /pattern/i
]]></verbatim>
</item>
<item><itemtext>b subname [condition]
<index>breakpoint</index>
<index>debugger command, b</index></itemtext>
<para>
Set a breakpoint before the first line of the named subroutine.  <emphasis>subname</emphasis> may
be a variable containing a code reference (in this case <emphasis>condition</emphasis>
is not supported).
</para>
<para>
サブルーチンの最初の実行可能文にブレークポイントを設定します。
<emphasis>subname</emphasis> は コードリファレンスが入った変数でも構いません
(この場合は <emphasis>condition</emphasis> は非対応です)。
</para>
</item>
<item><itemtext>b postpone subname [condition]
<index>breakpoint</index>
<index>debugger command, b</index></itemtext>
<para>
Set a breakpoint at first line of subroutine after it is compiled.
</para>
<para>
コンパイル後、サブルーチンの最初の行にブレークポイントをセットします。
</para>
</item>
<item><itemtext>b load filename
<index>breakpoint</index>
<index>debugger command, b</index></itemtext>
<para>
Set a breakpoint before the first executed line of the <emphasis>filename</emphasis>,
which should be a full pathname found amongst the %INC values.
</para>
<para>
<emphasis>filename</emphasis> の最初に実行される行の手前にブレークポイントをセットします。
これは %INC の値に含まれるフルパス名であるべきです。
</para>
</item>
<item><itemtext>b compile subname
<index>breakpoint</index>
<index>debugger command, b</index></itemtext>
<para>
Sets a breakpoint before the first statement executed after the specified
subroutine is compiled.
</para>
<para>
指定されたサブルーチンがコンパイルされた後、最初に実行される文の手前に
ブレークポイントをセットします。
</para>
</item>
<item><itemtext>B line
<index>breakpoint</index>
<index>debugger command, B</index></itemtext>
<para>
Delete a breakpoint from the specified <emphasis>line</emphasis>.
</para>
<para>
<emphasis>line</emphasis> で指定されたブレークポイントを削除します。
</para>
</item>
<item><itemtext>B *
<index>breakpoint</index>
<index>debugger command, B</index></itemtext>
<para>
Delete all installed breakpoints.
</para>
<para>
すべてのブレークポイントを削除します。
</para>
</item>
<item><itemtext>a [line] command
<index>debugger command, a</index></itemtext>
<para>
Set an action to be done before the line is executed.  If <emphasis>line</emphasis> is
omitted, set an action on the line about to be executed.
The sequence of steps taken by the debugger is
</para>
<para>
その行を実行する前に行うアクションを設定します。
<emphasis>line</emphasis> が省略されると、いままさに実行しようとしていた行に
アクションを設定します。
デバッガが実行する処理の順番は以下の通りです。
</para>
<verbatim><![CDATA[
1. check for a breakpoint at this line
2. print the line if necessary (tracing)
3. do any actions associated with that line
4. prompt user if at a breakpoint or in single-step
5. evaluate line
]]></verbatim>
<verbatim><![CDATA[
1. この行のブレークポイントをチェックします
2. 必要なら行を表示します(トレース)
3. この行に結び付けられたアクションを実行します
4. ブレークポイントやシングルステップの場合はユーザーに確認します
5. 行を評価します
]]></verbatim>
<para>
For example, this will print out $foo every time line
53 is passed:
</para>
<para>
例えば、以下のコードは 53 行を通過する毎に $foo を表示します。
</para>
<verbatim><![CDATA[
a 53 print "DB FOUND $foo\n"
]]></verbatim>
</item>
<item><itemtext>A line
<index>debugger command, A</index></itemtext>
<para>
Delete an action from the specified line.
</para>
<para>
指定された行に設定されたアクションを削除します。
<emphasis>line</emphasis> が省略されると、いままさに実行しようとしている行に設定されている
アクションが削除されます。
</para>
</item>
<item><itemtext>A *
<index>debugger command, A</index></itemtext>
<para>
Delete all installed actions.
</para>
<para>
設定されたすべてのアクションを削除します。
</para>
</item>
<item><itemtext>w expr
<index>debugger command, w</index></itemtext>
<para>
Add a global watch-expression.  We hope you know what one of these
is, because they're supposed to be obvious.
</para>
<para>
グローバルなウォッチ式を追加します。この機能はよくあるものなので、
どういうものかはわかってもらえると思います。
</para>
</item>
<item><itemtext>W expr
<index>debugger command, W</index></itemtext>
<para>
Delete watch-expression
</para>
<para>
ウォッチ式を削除します。
</para>
</item>
<item><itemtext>W *
<index>debugger command, W</index></itemtext>
<para>
Delete all watch-expressions.
</para>
<para>
全てのウォッチ式を削除します。
</para>
</item>
<item><itemtext>o
<index>debugger command, o</index></itemtext>
<para>
Display all options
</para>
<para>
全てのオプションを表示します。
</para>
</item>
<item><itemtext>o booloption ...
<index>debugger command, o</index></itemtext>
<para>
Set each listed Boolean option to the value <code>1</code>.
</para>
<para>
リストされた各真偽値オプションの値を <code>1</code> に設定します。
</para>
</item>
<item><itemtext>o anyoption? ...
<index>debugger command, o</index></itemtext>
<para>
Print out the value of one or more options.
</para>
<para>
1 つ、あるいは複数のオプションの値を表示します。
</para>
</item>
<item><itemtext>o option=value ...
<index>debugger command, o</index></itemtext>
<para>
Set the value of one or more options.  If the value has internal
whitespace, it should be quoted.  For example, you could set <code>o
pager=&quot;less -MQeicsNfr&quot;</code> to call <strong>less</strong> with those specific options.
You may use either single or double quotes, but if you do, you must
escape any embedded instances of same sort of quote you began with,
as well as any escaping any escapes that immediately precede that
quote but which are not meant to escape the quote itself.  In other
words, you follow single-quoting rules irrespective of the quote;
eg: <code>o option='this isn\'t bad'</code> or <code>o option=&quot;She said, \&quot;Isn't
it?\&quot;&quot;</code>.
</para>
<para>
一つまたは複数のオプションをセットします。
値自身に空白を含む場合、クォートする必要があります。
例えば、<strong>less</strong> をオプション付きで呼び出す場合は
<code>o pager=&quot;less -MQeicsNfr&quot;</code> のようにします。
シングルクォートとダブルクォートのどちらでも使えますが、クォートする場合は、
クォート文字と同じ文字はエスケープする必要があります;
そしてエスケープ文字自身もエスケープして、クォート文字を
エスケープしているのではないことを示す必要があります。
言い換えると、クォートに関わりなく、シングルクォートルールに従います;
例えば: <code>o option='this isn\'t bad'</code> や
<code>o option=&quot;She said, \&quot;Isn't it?\&quot;&quot;</code>
</para>
<para>
For historical reasons, the <code>=value</code> is optional, but defaults to
1 only where it is safe to do so--that is, mostly for Boolean
options.  It is always better to assign a specific value using <code>=</code>.
The <code>option</code> can be abbreviated, but for clarity probably should
not be.  Several options can be set together.  See <link xref='#Configurable_Options'>&quot;Configurable Options&quot;</link>
for a list of these.
</para>
<para>
歴史的な理由により、<code>=value</code> は省略可能ですが、そうするのが安全な場合にのみ
デフォルトは 1 です -- これは、ほとんどの場合ブール値オプションです。
<code>=</code> を使って指定した値を代入する方が常によいです。
<code>option</code> は短縮できますが、明確化のためにはそうしない方がいいでしょう。
いくつかのオプションは互いにセットできます。
それらの一覧については <link xref='#Configurable_Options'>&quot;Configurable Options&quot;</link> を参照してください。
</para>
</item>
<item><itemtext>&lt; ?
<index>debugger command, &lt;</index></itemtext>
<para>
List out all pre-prompt Perl command actions.
</para>
<para>
プロンプト表示前に実行するアクションを全て表示します。
</para>
</item>
<item><itemtext>&lt; [ command ]
<index>debugger command, &lt;</index></itemtext>
<para>
Set an action (Perl command) to happen before every debugger prompt.
A multi-line command may be entered by backslashing the newlines.
</para>
<para>
デバッガがプロンプトを出す直前に、毎回実行するアクション
(Perl のコマンド)を設定します。
複数行の command は、バックスラッシュと改行で書くことができます。
</para>
</item>
<item><itemtext>&lt; *
<index>debugger command, &lt;</index></itemtext>
<para>
Delete all pre-prompt Perl command actions.
</para>
<para>
プロンプト表示前に実行するアクションを全て削除します。
</para>
</item>
<item><itemtext>&lt;&lt; command
<index>debugger command, &lt;&lt;</index></itemtext>
<para>
Add an action (Perl command) to happen before every debugger prompt.
A multi-line command may be entered by backwhacking the newlines.
</para>
<para>
デバッガがプロンプトを出す直前に、毎回実行するアクション
(Perl のコマンド)を追加します。
複数行の command は、バックスラッシュと改行で書くことができます。
</para>
</item>
<item><itemtext>&gt; ?
<index>debugger command, &gt;</index></itemtext>
<para>
List out post-prompt Perl command actions.
</para>
<para>
プロンプト表示後に実行するアクションを全て表示します。
</para>
</item>
<item><itemtext>&gt; command
<index>debugger command, &gt;</index></itemtext>
<para>
Set an action (Perl command) to happen after the prompt when you've
just given a command to return to executing the script.  A multi-line
command may be entered by backslashing the newlines (we bet you
couldn't've guessed this by now).
</para>
<para>
スクリプトの実行に戻るコマンドを入力した時に、デバッガが
プロンプトを出した後で、毎回実行するアクション(Perl のコマンド)を設定します。
複数行の command は、バックスラッシュと改行で書くことができます
(きっとあなたは今までこのことを知らなかったはずです)。
</para>
</item>
<item><itemtext>&gt; *
<index>debugger command, &gt;</index></itemtext>
<para>
Delete all post-prompt Perl command actions.
</para>
<para>
プロンプト表示後に実行するアクションを全て削除します。
</para>
</item>
<item><itemtext>&gt;&gt; command
<index>debugger command, &gt;&gt;</index></itemtext>
<para>
Adds an action (Perl command) to happen after the prompt when you've
just given a command to return to executing the script.  A multi-line
command may be entered by backslashing the newlines.
</para>
<para>
スクリプトの実行に戻るコマンドを入力した時に、デバッガが
プロンプトを出した後で、毎回実行するアクション(Perl のコマンド)を追加します。
複数行の command は、バックスラッシュと改行で書くことができます。
</para>
</item>
<item><itemtext>{ ?
<index>debugger command, {</index></itemtext>
<para>
List out pre-prompt debugger commands.
</para>
<para>
プロンプト表示前に実行するデバッガコマンドを表示します。
</para>
</item>
<item><itemtext>{ [ command ]</itemtext>
<para>
Set an action (debugger command) to happen before every debugger prompt.
A multi-line command may be entered in the customary fashion.
</para>
<para>
デバッガがプロンプトを出す前に、毎回実行するアクション(デバッガの
コマンド)を設定します。
複数行の command は、いつもの方法で書くことができます
<strong>警告</strong> もし <code>command</code> がないと、全てのアクションが消えてしまいます!
</para>
<para>
Because this command is in some senses new, a warning is issued if
you appear to have accidentally entered a block instead.  If that's
what you mean to do, write it as with <code>;{ ... }</code> or even
<code>do { ... }</code>.
</para>
<para>
このコマンドはある意味新しいので、もし代わりに間違ってブロックを
入力したように見えるときには、警告が出ます。
本当に奏したい場合は、<code>;{ ... }</code> か、いっそ <code>do { ... }</code> と
書いてください。
</para>
</item>
<item><itemtext>{ *
<index>debugger command, {</index></itemtext>
<para>
Delete all pre-prompt debugger commands.
</para>
<para>
プロンプト前に実行するデバッガコマンドを全て削除します。
</para>
</item>
<item><itemtext>{{ command
<index>debugger command, {{</index></itemtext>
<para>
Add an action (debugger command) to happen before every debugger prompt.
A multi-line command may be entered, if you can guess how: see above.
</para>
<para>
毎回デバッガプロンプトを表示する前に実行するアクション(デバッガコマンド)を
追加します。予測可能な方法な方法で複数行コマンドも登録できます:
上記を参照してください。
</para>
</item>
<item><itemtext>! number
<index>debugger command, !</index></itemtext>
<para>
Redo a previous command (defaults to the previous command).
</para>
<para>
以前のコマンドを再実行します。(number が省略されると、直前のコマンドを実行します)
</para>
</item>
<item><itemtext>! -number
<index>debugger command, !</index></itemtext>
<para>
Redo number'th previous command.
</para>
<para>
指定数値分前のコマンドを実行します。
</para>
</item>
<item><itemtext>! pattern
<index>debugger command, !</index></itemtext>
<para>
Redo last command that started with pattern.
See <code>o recallCommand</code>, too.
</para>
<para>
pattern で始まるうち、最も最近に実行されたコマンドを
再実行します。
<code>O recallCommand</code> も参照して下さい。
</para>
</item>
<item><itemtext>!! cmd
<index>debugger command, !!</index></itemtext>
<para>
Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT) See
<code>o shellBang</code>, also.  Note that the user's current shell (well,
their <code>$ENV{SHELL}</code> variable) will be used, which can interfere
with proper interpretation of exit status or signal and coredump
information.
</para>
<para>
cmd をサブプロセスとして実行します(DB::IN から読み込み、DB::OUT に書き出します)。
<code>O shellBang</code> も参照してください。
ユーザーの現在のシェル(つまり、 <code>$ENV{SHELL}</code> 変数)が使われるので、
終了コードの適切な解釈やシグナルとコアダンプの情報が妨害されるかもしれない
ことに注意してください。
</para>
</item>
<item><itemtext>source file
<index>debugger command, source</index></itemtext>
<para>
Read and execute debugger commands from <emphasis>file</emphasis>.
<emphasis>file</emphasis> may itself contain <code>source</code> commands.
</para>
<para>
デバッガコマンドを <emphasis>file</emphasis> から読み込んで実行します。
<emphasis>file</emphasis> 自身に <code>source</code> コマンドを含んでいても構いません。
</para>
</item>
<item><itemtext>H -number
<index>debugger command, H</index></itemtext>
<para>
Display last n commands.  Only commands longer than one character are
listed.  If <emphasis>number</emphasis> is omitted, list them all.
</para>
<para>
最近の指定数値分のコマンドを表示します。
2 文字以上のコマンドのみが表示されます。
<emphasis>number</emphasis> が省略されると、全てを表示します。
</para>
</item>
<item><itemtext>q or ^D
<index>debugger command, q</index>
<index>debugger command, ^D</index></itemtext>
<para>
Quit.  (&quot;quit&quot; doesn't work for this, unless you've made an alias)
This is the only supported way to exit the debugger, though typing
<code>exit</code> twice might work.
</para>
<para>
デバッガを終了します。
(エイリアスを設定しない限り、&quot;quit&quot; はこの目的には使えません。)
これはデバッガを終了する唯一の方法ですが、<code>exit</code> を2回
入力しても動作します。
</para>
<para>
Set the <code>inhibit_exit</code> option to 0 if you want to be able to step
off the end the script.  You may also need to set $finished to 0
if you want to step through global destruction.
</para>
<para>
スクリプトの最後にステップ実行できるようにしたい場合は、
<code>inhibit_exit</code> オプションに 0 を設定してください。
グローバルなデストラクタを実行してステップ実行したい場合は、
$finished に 0 を設定する必要があります。
</para>
</item>
<item><itemtext>R
<index>debugger command, R</index></itemtext>
<para>
Restart the debugger by <code>exec()</code>ing a new session.  We try to maintain
your history across this, but internal settings and command-line options
may be lost.
</para>
<para>
新しいセッションを <code>exec()</code> することでデバッガを再起動します。
履歴は残そうと努力しますが、内部設定やコマンドラインオプションは
失われるかもしれません。
</para>
<para>
The following setting are currently preserved: history, breakpoints,
actions, debugger options, and the Perl command-line
options <strong>-w</strong>, <strong>-I</strong>, and <strong>-e</strong>.
</para>
<para>
今のところ、以下の設定は保存されます: 履歴、ブレークポイント、アクション、
デバッガオプション、Perl コマンドラインオプション <strong>-w</strong>, <strong>-I</strong>, <strong>-e</strong>。
</para>
</item>
<item><itemtext>|dbcmd
<index>debugger command, |</index></itemtext>
<para>
Run the debugger command, piping DB::OUT into your current pager.
</para>
<para>
デバッガコマンドを実行し、DB::OUT をパイプであなたの現在のページャと繋ぎます。
</para>
</item>
<item><itemtext>||dbcmd
<index>debugger command, ||</index></itemtext>
<para>
Same as <code>|dbcmd</code> but DB::OUT is temporarily <code>select</code>ed as well.
</para>
<para>
<code>|dbcmd</code> と同様ですが、 DB::OUT は一時的に <code>select</code> で
選択されているものになります。
</para>
</item>
<item><itemtext>= [alias value]
<index>debugger command, =</index></itemtext>
<para>
Define a command alias, like
</para>
<para>
以下のようにコマンドエイリアスを定義する:
</para>
<verbatim><![CDATA[
= quit q
]]></verbatim>
<para>
or list current aliases.
</para>
<para>
または現在のエイリアスの一覧を表示します。
</para>
</item>
<item><itemtext>command</itemtext>
<para>
Execute command as a Perl statement.  A trailing semicolon will be
supplied.  If the Perl statement would otherwise be confused for a
Perl debugger, use a leading semicolon, too.
</para>
<para>
command を Perl の文として実行します。文末のセミコロンはなくてもかまいません。
Perl の文が Perl デバッガにとって紛らわしい場合は
先頭にセミコロンをつけてください。
</para>
</item>
<item><itemtext>m expr
<index>debugger command, m</index></itemtext>
<para>
List which methods may be called on the result of the evaluated
expression.  The expression may evaluated to a reference to a
blessed object, or to a package name.
</para>
<para>
評価した表現の結果が呼び出されたメソッドを一覧表示します。
表現は bless されたオブジェクトへのリファレンスか、パッケージ名として
評価されます。
</para>
</item>
<item><itemtext>M
<index>debugger command, M</index></itemtext>
<para>
Displays all loaded modules and their versions
</para>
<para>
読み込まれたモジュールとバージョンを全て表示します。
</para>
</item>
<item><itemtext>man [manpage]
<index>debugger command, man</index></itemtext>
<para>
Despite its name, this calls your system's default documentation
viewer on the given page, or on the viewer itself if <emphasis>manpage</emphasis> is
omitted.  If that viewer is <strong>man</strong>, the current <code>Config</code> information
is used to invoke <strong>man</strong> using the proper MANPATH or <strong>-M</strong>
<emphasis>manpath</emphasis> option.  Failed lookups of the form <code>XXX</code> that match
known manpages of the form <emphasis>perlXXX</emphasis> will be retried.  This lets
you type <code>man debug</code> or <code>man op</code> from the debugger.
</para>
<para>
その名前にも関わらず、これは与えられたページ(<emphasis>manpage</emphasis> が省略された
場合はビューワ自身)に対してシステムのデフォルトのドキュメントビューワを
呼び出します。
ビューワが <strong>man</strong> の場合、適切な MANPATH や <strong>-M</strong>{char:160}<emphasis>manpath</emphasis>
オプションを使って <strong>man</strong> を起動するために、現在の <code>Config</code> 情報が
使われます。
<code>XXX</code> の形で一致する man ページの検索に失敗した場合、
<emphasis>perlXXX</emphasis> の形のものを再検索します。
これにより、デバッガから <code>man debug</code> や <code>man op</code> と
タイプできるようになります。
</para>
<para>
On systems traditionally bereft of a usable <strong>man</strong> command, the
debugger invokes <strong>perldoc</strong>.  Occasionally this determination is
incorrect due to recalcitrant vendors or rather more felicitously,
to enterprising users.  If you fall into either category, just
manually set the $DB::doccmd variable to whatever viewer to view
the Perl documentation on your system.  This may be set in an rc
file, or through direct assignment.  We're still waiting for a
working example of something along the lines of:
</para>
<para>
伝統的に利用可能な <strong>man</strong> コマンドを奪われたシステムでは、デバッガは&lt;
<strong>perldoc</strong> を起動します。
反抗的なベンダーや、より適切には、積極的なユーザーによって、この判断は
正しくありません。
もしあなたがどちらかの分類に当てはまってしまうなら、Perl のドキュメントを
表示するためにどのビューワを使うかを、手動で $DB::doccmd 変数に
セットしてください。
これは rc ファイルででも、直接の代入ででもセットできます。
私たちは以下のような感じで、実際に動作する例を待っています:
</para>
<verbatim><![CDATA[
$DB::doccmd = 'netscape -remote http://something.here/';
]]></verbatim>
</item>
</list>
</sect2>
<sect2>
<title>Configurable Options</title>
<para>
(設定可能なオプション)
</para>
<para>
The debugger has numerous options settable using the <code>o</code> command,
either interactively or from the environment or an rc file.
(./.perldb or ~/.perldb under Unix.)
</para>
<para>
デバッガには <code>O</code> コマンドで設定できるさまざまなオプションがあります。
これは対話的、環境変数、rc ファイル (Unix では ./.perldb または
~/.perldb) で設定できます。
</para>
<list>
<item><itemtext><code>recallCommand</code>, <code>ShellBang</code>
<index>debugger option, recallCommand</index>
<index>debugger option, ShellBang</index></itemtext>
<para>
The characters used to recall command or spawn shell.  By
default, both are set to <code>!</code>, which is unfortunate.
</para>
<para>
再呼び出しコマンドとシェル起動に使われる文字です。
デフォルトでは、残念ながら、両方とも <code>!</code> にセットされています。
</para>
</item>
<item><itemtext><code>pager</code>
<index>debugger option, pager</index></itemtext>
<para>
Program to use for output of pager-piped commands (those beginning
with a <code>|</code> character.)  By default, <code>$ENV{PAGER}</code> will be used.
Because the debugger uses your current terminal characteristics
for bold and underlining, if the chosen pager does not pass escape
sequences through unchanged, the output of some debugger commands
will not be readable when sent through the pager.
</para>
<para>
ページャにパイプされるコマンド(文字 <code>|</code> で始まるもの)の出力に
使われるプログラム。
デフォルトでは、<code>$ENV{PAGER}</code> が使われます。
デバッガは強調と下線に関して現在の端末設定を使うので、もし選択した
ページャがエスケープシーケンスを変更せずに通過させられない場合、
一部のデバッガコマンドの出力は、ページャに送られると読めなくなるでしょう。
</para>
</item>
<item><itemtext><code>tkRunning</code>
<index>debugger option, tkRunning</index></itemtext>
<para>
Run Tk while prompting (with ReadLine).
</para>
<para>
プロンプトで (ReadLine と共に) Tk を実行します。
</para>
</item>
<item><itemtext><code>signalLevel</code>, <code>warnLevel</code>, <code>dieLevel</code>
<index>debugger option, signalLevel</index> <index>debugger option, warnLevel</index>
<index>debugger option, dieLevel</index></itemtext>
<para>
Level of verbosity.  By default, the debugger leaves your exceptions
and warnings alone, because altering them can break correctly running
programs.  It will attempt to print a message when uncaught INT, BUS, or
SEGV signals arrive.  (But see the mention of signals in <link xref='BUGS'>BUGS</link> below.)
</para>
<para>
詳細さのレベル。
デフォルトでは、デバッガは例外と警告を放っておきます;
これを変更すると、プログラムが正しく動かなくなることがあるからです。
捕捉されていない INT, BUS, SEGV シグナルがあると、メッセージを
表示しようとします。
(しかし、以下の <link xref='BUGS'>BUGS</link> のシグナルに関する注意を参照してください。)
</para>
<para>
To disable this default safe mode, set these values to something higher
than 0.  At a level of 1, you get backtraces upon receiving any kind
of warning (this is often annoying) or exception (this is
often valuable).  Unfortunately, the debugger cannot discern fatal
exceptions from non-fatal ones.  If <code>dieLevel</code> is even 1, then your
non-fatal exceptions are also traced and unceremoniously altered if they
came from <code>eval'd</code> strings or from any kind of <code>eval</code> within modules
you're attempting to load.  If <code>dieLevel</code> is 2, the debugger doesn't
care where they came from:  It usurps your exception handler and prints
out a trace, then modifies all exceptions with its own embellishments.
This may perhaps be useful for some tracing purposes, but tends to hopelessly
destroy any program that takes its exception handling seriously.
</para>
<para>
このデフォルトのセーフモードを無効にするには、これらの値を 0 以上に
セットしてください。
レベル 1 では、あらゆる種類の警告(これはしばしばうんざりさせるものです)や
例外(これはしばしば価値があります)を受信した時にバックトレースを得ます。
残念ながら、デバッガは致命的な例外と致命的でない例外を識別できません。
<code>dieLevel</code> は 1 であっても、致命的でない例外もトレースされ、
それが <code>eval された</code> 文字列からか、読み込もうとしたモジュール内の
あらゆる種類の <code>eval</code> からのものであるなら、突然置き換えられます。
<code>dieLevel</code> が 2 なら、デバッガは例外の出所を気にしません:
例外ハンドラを横取りしてトレースを表示し、それから全ての例外を自身の装飾で
修正します。
これはある種のトレースの目的にはおそらく有用ですが、
例外をまじめに扱っているプログラムをどうしようもなく破壊してしまう傾向が
あります。
</para>
</item>
<item><itemtext><code>AutoTrace</code>
<index>debugger option, AutoTrace</index></itemtext>
<para>
Trace mode (similar to <code>t</code> command, but can be put into
<code>PERLDB_OPTS</code>).
</para>
<para>
トレースモード(<code>t</code> コマンドと同様ですが、<code>PERLDB_OPTS</code> に書けます)。
</para>
</item>
<item><itemtext><code>LineInfo</code>
<index>debugger option, LineInfo</index></itemtext>
<para>
File or pipe to print line number info to.  If it is a pipe (say,
<code>|visual_perl_db</code>), then a short message is used.  This is the
mechanism used to interact with a slave editor or visual debugger,
such as the special <code>vi</code> or <code>emacs</code> hooks, or the <code>ddd</code> graphical
debugger.
</para>
<para>
行番号情報を記録するファイルまたはパイプ。
これが (<code>|visual_perl_db</code> のように) パイプの場合、短い文章が使われます。
これは、特別な <code>vi</code> や <code>emacs</code> のフックや、<code>ddd</code> グラフィカル
デバッガのようなスレーブエディタやビジュアルデバッガと相互作用するために
使われる機構です。
</para>
</item>
<item><itemtext><code>inhibit_exit</code>
<index>debugger option, inhibit_exit</index></itemtext>
<para>
If 0, allows <emphasis>stepping off</emphasis> the end of the script.
</para>
<para>
0 だと、スクリプトの最後で <emphasis>プログラムを終了する</emphasis> ことを認めます。
</para>
</item>
<item><itemtext><code>PrintRet</code>
<index>debugger option, PrintRet</index></itemtext>
<para>
Print return value after <code>r</code> command if set (default).
</para>
<para>
設定されると(デフォルト)、<code>r</code> コマンドの後に返り値を表示します。
</para>
</item>
<item><itemtext><code>ornaments</code>
<index>debugger option, ornaments</index></itemtext>
<para>
Affects screen appearance of the command line (see <link xref='Term::ReadLine'>Term::ReadLine</link>).
There is currently no way to disable these, which can render
some output illegible on some displays, or with some pagers.
This is considered a bug.
</para>
<para>
コマンドラインの画面への表示に影響を与えます(<link xref='Term::ReadLine'>Term::ReadLine</link> を
参照してください)。
今のところ、これを無効にする方法はありません;
これにより、ディスプレイやページャーによっては判読できない出力を
行うことがあります。
これはバグと考えられています。
</para>
</item>
<item><itemtext><code>frame</code>
<index>debugger option, frame</index></itemtext>
<para>
Affects the printing of messages upon entry and exit from subroutines.  If
<code>frame &amp; 2</code> is false, messages are printed on entry only. (Printing
on exit might be useful if interspersed with other messages.)
</para>
<para>
サブルーチンへの出入り時のメッセージ表示に影響を与えます。
<code>frame &amp; 2</code> が偽なら、サブルーチンに入る時にのみメッセージを出力します。
(出るときのメッセージは、他のメッセージがまき散らされているときには
有用でしょう。)
</para>
<para>
If <code>frame &amp; 4</code>, arguments to functions are printed, plus context
and caller info.  If <code>frame &amp; 8</code>, overloaded <code>stringify</code> and
<code>tie</code>d <code>FETCH</code> is enabled on the printed arguments.  If <code>frame
&amp; 16</code>, the return value from the subroutine is printed.
</para>
<para>
<code>frame &amp; 4</code> の場合、関数の引数に加えて、コンテキストと呼び出し元の
情報を表示します。
<code>frame &amp; 8</code> の場合、引数の表示にオーバーロードされた <code>文字列化</code> と
<code>tie</code> した <code>FETCH</code> が有効になります。
<code>frame &amp; 16</code> の場合、サブルーチンからの返り値が表示されます。
</para>
<para>
The length at which the argument list is truncated is governed by the
next option:
</para>
<para>
引数リストが切り詰められた時の長さは次のオプションの管轄となります:
</para>
</item>
<item><itemtext><code>maxTraceLen</code>
<index>debugger option, maxTraceLen</index></itemtext>
<para>
Length to truncate the argument list when the <code>frame</code> option's
bit 4 is set.
</para>
<para>
<code>frame</code> オプションの bit 4 がセットされている時の引数リストを切り詰める
長さ。
</para>
</item>
<item><itemtext><code>windowSize</code>
<index>debugger option, windowSize</index></itemtext>
<para>
Change the size of code list window (default is 10 lines).
</para>
<para>
コードリストウィンドウの大きさを変更します(デフォルトは 10 行です)。
</para>
</item>
</list>
<para>
The following options affect what happens with <code>V</code>, <code>X</code>, and <code>x</code>
commands:
</para>
<para>
以下のオプションは <code>V</code>, <code>X</code>, <code>x</code> コマンドに影響を与えます。
</para>
<list>
<item><itemtext><code>arrayDepth</code>, <code>hashDepth</code>
<index>debugger option, arrayDepth</index> <index>debugger option, hashDepth</index></itemtext>
<para>
Print only first N elements ('' for all).
</para>
<para>
最初の N 要素だけを表示します('' を指定すると全て表示します)。
</para>
</item>
<item><itemtext><code>dumpDepth</code>
<index>debugger option, dumpDepth</index></itemtext>
<para>
Limit recursion depth to N levels when dumping structures.
Negative values are interpreted as infinity.  Default: infinity.
</para>
<para>
構造をダンプするときに再帰の深さを N レベルに制限します。
負数を指定すると無限として解釈されます。
デフォルト: 無限。
</para>
</item>
<item><itemtext><code>compactDump</code>, <code>veryCompact</code>
<index>debugger option, compactDump</index> <index>debugger option, veryCompact</index></itemtext>
<para>
Change the style of array and hash output.  If <code>compactDump</code>, short array
may be printed on one line.
</para>
<para>
配列とハッシュの出力スタイルを変更します。
<code>compactDump</code> の場合は、短い配列は 1 行で表示します。
</para>
</item>
<item><itemtext><code>globPrint</code>
<index>debugger option, globPrint</index></itemtext>
<para>
Whether to print contents of globs.
</para>
<para>
グロブの内容を表示するかどうかです。
</para>
</item>
<item><itemtext><code>DumpDBFiles</code>
<index>debugger option, DumpDBFiles</index></itemtext>
<para>
Dump arrays holding debugged files.
</para>
<para>
デバッグしていているファイルが保持している配列をダンプします。
</para>
</item>
<item><itemtext><code>DumpPackages</code>
<index>debugger option, DumpPackages</index></itemtext>
<para>
Dump symbol tables of packages.
</para>
<para>
パッケージのシンボルテーブルをダンプします。
</para>
</item>
<item><itemtext><code>DumpReused</code>
<index>debugger option, DumpReused</index></itemtext>
<para>
Dump contents of &quot;reused&quot; addresses.
</para>
<para>
「再利用された」アドレスの内容をダンプします。
</para>
</item>
<item><itemtext><code>quote</code>, <code>HighBit</code>, <code>undefPrint</code>
<index>debugger option, quote</index> <index>debugger option, HighBit</index>
<index>debugger option, undefPrint</index></itemtext>
<para>
Change the style of string dump.  The default value for <code>quote</code>
is <code>auto</code>; one can enable double-quotish or single-quotish format
by setting it to <code>&quot;</code> or <code>'</code>, respectively.  By default, characters
with their high bit set are printed verbatim.
</para>
<para>
文字列ダンプのスタイルを変更します。
<code>quote</code> のデフォルトは <code>auto</code> です;
<code>&quot;</code> や <code>'</code> にセットすることでダブルクォート風やシングルクォート風に
できます。
デフォルトでは、最上位ビットがセットされている文字はそのまま表示されます。
</para>
</item>
<item><itemtext><code>UsageOnly</code>
<index>debugger option, UsageOnly</index></itemtext>
<para>
Rudimentary per-package memory usage dump.  Calculates total
size of strings found in variables in the package.  This does not
include lexicals in a module's file scope, or lost in closures.
</para>
<para>
基本的なパッケージ単位のメモリ使用量ダンプ。
パッケージ内の変数で見つかった文字列のサイズの合計を計算します。
モジュールのファイルスコープ内のレキシカルや、クロージャ内で
失われたものは含まれません。
</para>
</item>
</list>
<para>
After the rc file is read, the debugger reads the <code>$ENV{PERLDB_OPTS}</code>
environment variable and parses this as the remainder of a &quot;O ...&quot;
line as one might enter at the debugger prompt.  You may place the
initialization options <code>TTY</code>, <code>noTTY</code>, <code>ReadLine</code>, and <code>NonStop</code>
there.
</para>
<para>
rc ファイルが読み込まれた後、デバッガは <code>$ENV{PERLDB_OPTS}</code> 環境変数を
読み込み、デバッガのプロンプトから &quot;O ...&quot; として入力されたかのように
パースします。
初期化オプション <code>TTY</code>, <code>noTTY</code>, <code>ReadLine</code>, <code>NonStop</code> も
ここで設定できます。
</para>
<para>
If your rc file contains:
</para>
<para>
rc ファイルに以下のように書くと:
</para>
<verbatim><![CDATA[
parse_options("NonStop=1 LineInfo=db.out AutoTrace");
]]></verbatim>
<para>
then your script will run without human intervention, putting trace
information into the file <emphasis>db.out</emphasis>.  (If you interrupt it, you'd
better reset <code>LineInfo</code> to <filename>/dev/tty</filename> if you expect to see anything.)
</para>
<para>
スクリプトは人間の介入なしに実行され、トレース情報を
<emphasis>db.out</emphasis> ファイルに出力します。
(中断して、何も表示されない場合は、<code>LineInfo</code> を <filename>/dev/tty</filename> に
リセットしたほうがよいでしょう。)
</para>
<list>
<item><itemtext><code>TTY</code>
<index>debugger option, TTY</index></itemtext>
<para>
The TTY to use for debugging I/O.
</para>
<para>
デバッグ I/O として TTY を使います。
</para>
</item>
<item><itemtext><code>noTTY</code>
<index>debugger option, noTTY</index></itemtext>
<para>
If set, the debugger goes into <code>NonStop</code> mode and will not connect to a TTY.  If
interrupted (or if control goes to the debugger via explicit setting of
$DB::signal or $DB::single from the Perl script), it connects to a TTY
specified in the <code>TTY</code> option at startup, or to a tty found at
runtime using the <code>Term::Rendezvous</code> module of your choice.
</para>
<para>
セットすると、デバッガは <code>NonStop</code> モードとなり、TTY と接続されません。
もし中断された(または Perl スクリプトから明示的に $DB::signal や
$DB::single をセットすることによってデバッガに制御が移った)場合、
起動時に <code>TTY</code> オプションで指定された TTY か、実行時に <code>Term::Rendezvous</code>
モジュールで選択された TTY に接続されます。
</para>
<para>
This module should implement a method named <code>new</code> that returns an object
with two methods: <code>IN</code> and <code>OUT</code>.  These should return filehandles to use
for debugging input and output correspondingly.  The <code>new</code> method should
inspect an argument containing the value of <code>$ENV{PERLDB_NOTTY}</code> at
startup, or <code>&quot;$ENV{HOME}/.perldbtty$$&quot;</code> otherwise.  This file is not
inspected for proper ownership, so security hazards are theoretically
possible.
</para>
<para>
このモジュールは、2 つのメソッド <code>IN</code> と <code>OUT</code> をもつオブジェクトを
返すメソッド <code>new</code> を実装する必要があります。
これらはそれぞれ、デバッグ入力と出力のためのファイルハンドルを
返すようにします。
<code>new</code> メソッドは起動時に <code>$ENV{PERLDB_NOTTY}</code> の値を含んでいる
引数を検査し、さもなければ <code>&quot;$ENV{HOME}/.perldbtty$$&quot;</code> となります。
このファイルは適切な所有権について検査されないので、
理論的にはセキュリティの問題が起こり得ます。
</para>
</item>
<item><itemtext><code>ReadLine</code>
<index>debugger option, ReadLine</index></itemtext>
<para>
If false, readline support in the debugger is disabled in order
to debug applications that themselves use ReadLine.
</para>
<para>
偽だと、デバッグするアプリケーション自身が ReadLine を使うために、
readline 対応を無効にします。
</para>
</item>
<item><itemtext><code>NonStop</code>
<index>debugger option, NonStop</index></itemtext>
<para>
If set, the debugger goes into non-interactive mode until interrupted, or
programmatically by setting $DB::signal or $DB::single.
</para>
<para>
設定されると、デバッガは中断されるか、プログラム的に $DB::signal か
$DB::single に設定されるまで、非対話的モードとなります。
</para>
</item>
</list>
<para>
Here's an example of using the <code>$ENV{PERLDB_OPTS}</code> variable:
</para>
<para>
以下に <code>$ENV{PERLDB_OPTS}</code> 変数を使った例を示します:
</para>
<verbatim><![CDATA[
$ PERLDB_OPTS="NonStop frame=2" perl -d myprogram
]]></verbatim>
<para>
That will run the script <strong>myprogram</strong> without human intervention,
printing out the call tree with entry and exit points.  Note that
<code>NonStop=1 frame=2</code> is equivalent to <code>N f=2</code>, and that originally,
options could be uniquely abbreviated by the first letter (modulo
the <code>Dump*</code> options).  It is nevertheless recommended that you
always spell them out in full for legibility and future compatibility.
</para>
<para>
これは、人間の関与なしでスクリプト <strong>myprogram</strong> を実行し、進入と終了の
ポイントの呼び出し木を表示します。
<code>NonStop=1 frame=2</code> は <code>N f=2</code> と等価で、もともとオプションは最初の文字
(<code>Dump*</code> オプションを法として) に省略できます。
それでもやはり、読みやすさと将来の互換性のために、常にフルスペルを書くことが
推奨されます。
</para>
<para>
Other examples include
</para>
<para>
もう一つの例としては:
</para>
<verbatim><![CDATA[
$ PERLDB_OPTS="NonStop LineInfo=listing frame=2" perl -d myprogram
]]></verbatim>
<para>
which runs script non-interactively, printing info on each entry
into a subroutine and each executed line into the file named <filename>listing</filename>.
(If you interrupt it, you would better reset <code>LineInfo</code> to something
&quot;interactive&quot;!)
</para>
<para>
とするとスクリプトは非対話的に実行され、サブルーチンへの進入と実行行を
<filename>listing</filename> という名前のファイルに記録します。
(中断すると、何か「対話的」にするために <code>LineInfo</code> をリセットする方が
良いでしょう!)
</para>
<para>
Other examples include (using standard shell syntax to show environment
variable settings):
</para>
<para>
(環境変数設定を表示する標準シェル構文を使った)もう一つの例としては:
</para>
<verbatim><![CDATA[
$ ( PERLDB_OPTS="NonStop frame=1 AutoTrace LineInfo=tperl.out"
    perl -d myprogram )
]]></verbatim>
<para>
which may be useful for debugging a program that uses <code>Term::ReadLine</code>
itself.  Do not forget to detach your shell from the TTY in the window that
corresponds to <filename>/dev/ttyXX</filename>, say, by issuing a command like
</para>
<para>
これは <code>Term::ReadLine</code> 地震を使っているプログラムをデバッグするのに
便利です。
以下のようなコマンドを使って、使用中のシェルを、<filename>/dev/ttyXX</filename> に対応する
ウィンドウの TTY からデタッチすることを忘れないで下さい:
</para>
<verbatim><![CDATA[
$ sleep 1000000
]]></verbatim>
<para>
See <link xref='perldebguts#Debugger_Internals'>perldebguts/&quot;Debugger Internals&quot;</link> for details.
</para>
<para>
詳細については <link xref='perldebguts#Debugger_Internals'>perldebguts/&quot;Debugger Internals&quot;</link> を参照してください。
</para>
</sect2>
<sect2>
<title>Debugger input/output</title>
<para>
(デバッガの入出力)
</para>
<list>
<item><itemtext>Prompt</itemtext>
<para>
The debugger prompt is something like
</para>
<para>
デバッガのプロンプトは以下のようだったり:
</para>
<verbatim><![CDATA[
DB<8>
]]></verbatim>
<para>
or even
</para>
<para>
あるいは以下のようだったりします:
</para>
<verbatim><![CDATA[
DB<<17>>
]]></verbatim>
<para>
where that number is the command number, and which you'd use to
access with the built-in <strong>csh</strong>-like history mechanism.  For example,
<code>!17</code> would repeat command number 17.  The depth of the angle
brackets indicates the nesting depth of the debugger.  You could
get more than one set of brackets, for example, if you'd already
at a breakpoint and then printed the result of a function call that
itself has a breakpoint, or you step into an expression via <code>s/n/t
expression</code> command.
</para>
<para>
ここで数値はコマンド番号で、組み込みの <strong>csh</strong> 風履歴機構を使って
アクセスするのに使います。
例えば、<code>!17</code> はコマンド番号 17 を再実行します。
不等号の深さはデバッガのネストの深さを示します。
例えば、既にブレークポイントにいて、それ自身にもブレークポイントを
含む関数呼び出しの結果を表示させたり、<code>s/n/t expression</code> コマンドを
使って式をステップ実行したりした時に複数の不等号の組を見ることがあります。
</para>
</item>
<item><itemtext>Multiline commands</itemtext>
<para>
If you want to enter a multi-line command, such as a subroutine
definition with several statements or a format, escape the newline
that would normally end the debugger command with a backslash.
Here's an example:
</para>
<para>
複数の文からなるサブルーチン定義やフォーマットといった、複数行の
コマンドを入力したい場合は、通常はデバッガコマンドを終了させる改行を
バックスラッシュでエスケープしてください。
以下は例です:
</para>
<verbatim><![CDATA[
DB<1> for (1..4) {         \
cont:     print "ok\n";   \
cont: }
ok
ok
ok
ok
]]></verbatim>
<para>
Note that this business of escaping a newline is specific to interactive
commands typed into the debugger.
</para>
<para>
この、改行をエスケープする問題は、対話的にデバッガに入力されたコマンドに
特有であることに注意してください。
</para>
</item>
<item><itemtext>Stack backtrace
<index>backtrace</index> <index>stack, backtrace</index></itemtext>
<para>
Here's an example of what a stack backtrace via <code>T</code> command might
look like:
</para>
<para>
これは、<code>T</code> コマンドによって表示されるスタックバックトレースの
例です:
</para>
<verbatim><![CDATA[
$ = main::infested called from file `Ambulation.pm' line 10
@ = Ambulation::legs(1, 2, 3, 4) called from file `camel_flea' line 7
$ = main::pests('bactrian', 4) called from file `camel_flea' line 4
]]></verbatim>
<para>
The left-hand character up there indicates the context in which the
function was called, with <code>$</code> and <code>@</code> meaning scalar or list
contexts respectively, and <code>.</code> meaning void context (which is
actually a sort of scalar context).  The display above says
that you were in the function <code>main::infested</code> when you ran the
stack dump, and that it was called in scalar context from line
10 of the file <emphasis>Ambulation.pm</emphasis>, but without any arguments at all,
meaning it was called as <code>&amp;infested</code>.  The next stack frame shows
that the function <code>Ambulation::legs</code> was called in list context
from the <emphasis>camel_flea</emphasis> file with four arguments.  The last stack
frame shows that <code>main::pests</code> was called in scalar context,
also from <emphasis>camel_flea</emphasis>, but from line 4.
</para>
<para>
上記の左側の文字は関数が呼び出されたコンテキストを示しています;
<code>$</code> と <code>@</code> はそれぞれスカラコンテキストとリストコンテキストを意味し、
<code>.</code> は無効コンテキスト(実際のところはスカラコンテキストのようなもの)を
意味します。
上記の表示は、スタックダンプを実行したときに <code>main::infested</code> にいて、
これはファイル <emphasis>Ambulation.pm</emphasis> の 10 行目から、スカラコンテキストで
引数なしで呼び出されています; つまり <code>&amp;infested</code> のようにして
呼び出されています。
次のスタックフレームは、関数 <code>Ambulation::legs</code> が <emphasis>camel_flea</emphasis> から
リストコンテキストで 4 つの引数と共に呼び出されています。
最後のスタックフレームは、<code>main::pests</code> が、同じファイル <emphasis>camel_flea</emphasis> の
4 行目からスカラコンテキストで呼び出されています。
</para>
<para>
If you execute the <code>T</code> command from inside an active <code>use</code>
statement, the backtrace will contain both a <code>require</code> frame and
an <code>eval</code>) frame.
</para>
<para>
有効な <code>use</code> 文の中から <code>T</code> コマンドを実行すると、バックとレースには
<code>require</code> フレームと <code>eval</code> フレームの両方が含まれます。
</para>
</item>
<item><itemtext>Line Listing Format</itemtext>
<para>
This shows the sorts of output the <code>l</code> command can produce:
</para>
<para>
これは <code>l</code> コマンドの出力を示しています:
</para>
<verbatim><![CDATA[
DB<<13>> l
  101:                @i{@i} = ();
  102:b               @isa{@i,$pack} = ()
  103                     if(exists $i{$prevpack} || exists $isa{$pack});
  104             }
  105
  106             next
  107==>              if(exists $isa{$pack});
  108
  109:a           if ($extra-- > 0) {
  110:                %isa = ($pack,1);
]]></verbatim>
<para>
Breakable lines are marked with <code>:</code>.  Lines with breakpoints are
marked by <code>b</code> and those with actions by <code>a</code>.  The line that's
about to be executed is marked by <code>==&gt;</code>.
</para>
<para>
ブレーク可能な行には <code>:</code> が付いています。
ブレークポイントのある行には <code>b</code> が、アクションがある行には
<code>a</code> があります。
今から実行しようとしている行には <code>==&gt;</code> が付いています。
</para>
<para>
Please be aware that code in debugger listings may not look the same
as your original source code.  Line directives and external source
filters can alter the code before Perl sees it, causing code to move
from its original positions or take on entirely different forms.
</para>
<para>
デバッガで表示されるコードは、元のソースコードと同じように見えるとは
限らないことに注意してください。
行指示子と外部ソースフィルタが、Perl がコードを見る前にコードを
変更することがあり、それによってコードが元の位置から移動したり、
完全に異なる形になったりします。
</para>
</item>
<item><itemtext>Frame listing</itemtext>
<para>
When the <code>frame</code> option is set, the debugger would print entered (and
optionally exited) subroutines in different styles.  See <link xref='perldebguts'>perldebguts</link>
for incredibly long examples of these.
</para>
<para>
<code>frame</code> オプションが設定されると、デバッガはサブルーチンに入ったとき
(および出たときもオプションで)違ったスタイルで表示します。
これらの非常に長い例については <link xref='perldebguts'>perldebguts</link> を参照してください。
</para>
</item>
</list>
</sect2>
<sect2>
<title>Debugging compile-time statements</title>
<para>
(コンパイル時に実行される文のデバッグ)
</para>
<para>
If you have compile-time executable statements (such as code within
BEGIN and CHECK blocks or <code>use</code> statements), these will <emphasis>not</emphasis> be
stopped by debugger, although <code>require</code>s and INIT blocks will, and
compile-time statements can be traced with <code>AutoTrace</code> option set
in <code>PERLDB_OPTS</code>).  From your own Perl code, however, you can
transfer control back to the debugger using the following statement,
which is harmless if the debugger is not running:
</para>
<para>
コンパイル時に実行される文 (BEGIN と CHECK のブロック内のコードや
<code>use</code> 文) があれば、それらはデバッガによって<emphasis>止めることができま
せん</emphasis>。<code>require</code> と INIT ブロックは可能です。
また、コンパイル時実行文は <code>PERLDB_OPTS</code> で <code>AutoTrace</code> オプションを
設定することでトレースできます。
しかし、以下のような文を自分で Perl コードに含めれば、
デバッガに制御を渡すことができます。
この文は、デバッガを起動していないときには、何もしません:
</para>
<verbatim><![CDATA[
$DB::single = 1;
]]></verbatim>
<para>
If you set <code>$DB::single</code> to 2, it's equivalent to having
just typed the <code>n</code> command, whereas a value of 1 means the <code>s</code>
command.  The <code>$DB::trace</code>  variable should be set to 1 to simulate
having typed the <code>t</code> command.
</para>
<para>
<code>$DB::single</code> に 2 をセットすると、<code>n</code>コマンドをタイプしたのと
等価になります。
1 を設定すると <code>s</code> コマンドとなります。
<code>$DB::trace</code> 変数は <code>t</code> コマンドをタイプした状態をシミュレートするために
1 にセットするべきです。
</para>
<para>
Another way to debug compile-time code is to start the debugger, set a
breakpoint on the <emphasis>load</emphasis> of some module:
</para>
<para>
コンパイル時に実行されるコードをデバッグするもう一つの方法は、
モジュールの <emphasis>load</emphasis> にブレークポイントを設定して:
</para>
<verbatim><![CDATA[
DB<7> b load f:/perllib/lib/Carp.pm
  Will stop on load of `f:/perllib/lib/Carp.pm'.
]]></verbatim>
<para>
and then restart the debugger using the <code>R</code> command (if possible).  One can use <code>b
compile subname</code> for the same purpose.
</para>
<para>
(可能なら) <code>R</code> コマンドを使ってデバッガを再起動することです。
<code>b compile subname</code> も同じ目的に使えます。
</para>
</sect2>
<sect2>
<title>Debugger Customization</title>
<para>
(デバッガのカスタマイズ)
</para>
<para>
The debugger probably contains enough configuration hooks that you
won't ever have to modify it yourself.  You may change the behaviour
of debugger from within the debugger using its <code>o</code> command, from
the command line via the <code>PERLDB_OPTS</code> environment variable, and
from customization files.
</para>
<para>
デバッガにはおそらくあなたが自分で修正する必要があるとは思わないような
ところまで含んだ設定フックがあります。
デバッガの振る舞いは、デバッガ内で <code>o</code> コマンドを使って変更できます;
これは <code>PERLDB_OPT</code> 環境変数経由でコマンドラインからか、設定ファイルから
変更できます。
</para>
<para>
You can do some customization by setting up a <filename>.perldb</filename> file, which
contains initialization code.  For instance, you could make aliases
like these (the last one is one people expect to be there):
</para>
<para>
初期化コードを入れたファイル .perldb を設定することでも、
いくらかのカスタマイズができます。
たとえば、以下のようなエイリアスが行えます (最後のものは、
人々があると思っているものです):
</para>
<verbatim><![CDATA[
$DB::alias{'len'}  = 's/^len(.*)/p length($1)/';
$DB::alias{'stop'} = 's/^stop (at|in)/b/';
$DB::alias{'ps'}   = 's/^ps\b/p scalar /';
$DB::alias{'quit'} = 's/^quit(\s*)/exit/';
]]></verbatim>
<para>
You can change options from <filename>.perldb</filename> by using calls like this one;
</para>
<para>
<filename>.perldb</filename> のオプションを、以下のような呼び出しによって変更できます:
</para>
<verbatim><![CDATA[
parse_options("NonStop=1 LineInfo=db.out AutoTrace=1 frame=2");
]]></verbatim>
<para>
The code is executed in the package <code>DB</code>.  Note that <filename>.perldb</filename> is
processed before processing <code>PERLDB_OPTS</code>.  If <filename>.perldb</filename> defines the
subroutine <code>afterinit</code>, that function is called after debugger
initialization ends.  <filename>.perldb</filename> may be contained in the current
directory, or in the home directory.  Because this file is sourced
in by Perl and may contain arbitrary commands, for security reasons,
it must be owned by the superuser or the current user, and writable
by no one but its owner.
</para>
<para>
コードは <code>DB</code> パッケージで実行されます。
<filename>.perldb</filename> は <code>PERLDB_OPTS</code> の前に処理されることに注意してください。
<filename>.perldb</filename> で <code>afterinit</code> サブルーチンが定義されていると、この関数は
デバッガの初期化終了後に呼び出されます。
<filename>.perldb</filename> はカレントディレクトリかホームディレクトリに置くことができます。
このファイルは Perl によって実行され、任意のコマンドを含めることが
できるので、セキュリティ上の理由から、スーパーユーザーが現在のユーザーに
よって所有され、所有者以外には書込み禁止になっていなければなりません。
</para>
<para>
You can mock TTY input to debugger by adding arbitrary commands to
@DB::typeahead. For example, your <filename>.perldb</filename> file might contain:
</para>
<para>
@DB::typeahead に任意のコマンドを追加することで、デバッガへの TTY 入力を
模倣できます。
例えば、あなたの <filename>.perldb</filename> ファイルに以下のように書くと:
</para>
<verbatim><![CDATA[
sub afterinit { push @DB::typeahead, "b 4", "b 6"; }
]]></verbatim>
<para>
Which would attempt to set breakpoints on lines 4 and 6 immediately
after debugger initialization. Note that @DB::typeahead is not a supported
interface and is subject to change in future releases.
</para>
<para>
デバッガ初期化の直後に 4 行目と 6 行目にブレークポイントを
設定しようとします。
@DB::typeahead はサポートしているインターフェースではなく、将来の
リリースでは変更されることがあることに注意してください。
</para>
<para>
If you want to modify the debugger, copy <filename>perl5db.pl</filename> from the
Perl library to another name and hack it to your heart's content.
You'll then want to set your <code>PERL5DB</code> environment variable to say
something like this:
</para>
<para>
デバッガを変更したい場合には、perl5db.pl を Perl ライブラリから
別の名前にコピーし、修正してください。それから
環境変数 <code>PERL5DB</code> には、以下のように設定する必要があるでしょう:
</para>
<verbatim><![CDATA[
BEGIN { require "myperl5db.pl" }
]]></verbatim>
<para>
As a last resort, you could also use <code>PERL5DB</code> to customize the debugger
by directly setting internal variables or calling debugger functions.
</para>
<para>
最後の手段として、 <code>PERL5DB</code> を、直接内部変数を設定したり
デバッガ関数を呼び出すことでデバッガをカスタマイズすることもできます。
</para>
<para>
Note that any variables and functions that are not documented in
this document (or in <link xref='perldebguts'>perldebguts</link>) are considered for internal
use only, and as such are subject to change without notice.
</para>
<para>
このドキュメント(や <link xref='perldebguts'>perldebguts</link>)に記述されていない変数や
関数は内部使用専用として扱われ、予告なく変更されることがあります。
</para>
</sect2>
<sect2>
<title>Readline Support</title>
<para>
(readline 対応)
</para>
<para>
As shipped, the only command-line history supplied is a simplistic one
that checks for leading exclamation points.  However, if you install
the Term::ReadKey and Term::ReadLine modules from CPAN, you will
have full editing capabilities much like GNU <emphasis>readline</emphasis>(3) provides.
Look for these in the <filename>modules/by-module/Term</filename> directory on CPAN.
These do not support normal <strong>vi</strong> command-line editing, however.
</para>
<para>
出荷時の状態では、コマンドライン履歴参照機能として提供されるのは、
エクスクラメーションマークを付けることによる単純なものだけです。
しかし、CPAN から Term::ReadKey と Term::ReadLine のモジュールを
インストールすることで、GNU <emphasis>readline</emphasis>(3) が提供するような
完全な編集機能が使えるようになります。
これらは CPAN の <filename>modules/by-module/Term</filename> ディレクトリにあります。
しかし、これらは通常の <strong>vi</strong> コマンドライン編集は対応していません。
</para>
<para>
A rudimentary command-line completion is also available.
Unfortunately, the names of lexical variables are not available for
completion.
</para>
<para>
基本的なコマンドライン補完も利用可能です。
残念ながら、レキシカル変数名は補完できません。
</para>
</sect2>
<sect2>
<title>Editor Support for Debugging</title>
<para>
(デバッグのためのエディタ対応)
</para>
<para>
If you have the FSF's version of <strong>emacs</strong> installed on your system,
it can interact with the Perl debugger to provide an integrated
software development environment reminiscent of its interactions
with C debuggers.
</para>
<para>
FSF 版の <strong>emacs</strong> がシステムにインストールされている場合は、
C デバッガとの連携を連想させるような、Perl デバッガとの統合
ソフトウェア開発環境を提供します。
</para>
<para>
Perl comes with a start file for making <strong>emacs</strong> act like a
syntax-directed editor that understands (some of) Perl's syntax.
Look in the <emphasis>emacs</emphasis> directory of the Perl source distribution.
</para>
<para>
Perl には <strong>emacs</strong> を Perl の文法(の一部)を解釈する文法指向の
エディタとして振舞わせるためのスタートファイルを同梱しています。
Perl ソース配布の <emphasis>emacs</emphasis> ディレクトリを参照してください。
</para>
<para>
A similar setup by Tom Christiansen for interacting with any
vendor-shipped <strong>vi</strong> and the X11 window system is also available.
This works similarly to the integrated multiwindow support that
<strong>emacs</strong> provides, where the debugger drives the editor.  At the
time of this writing, however, that tool's eventual location in the
Perl distribution was uncertain.
</para>
<para>
ベンダー同梱の <strong>vi</strong> および X11 ウィンドウシステムと相互作用させるための
Tom Christiansen による似たようなセットアップも利用可能です。
これは <strong>emacs</strong> が提供する統合マルチウィンドウサポートと同様に動作し、
デバッガがエディタを制御します。
しかし、これを記述している時点では、このツールの Perl 配布の中での
最終的な位置は不確定です。
</para>
<para>
Users of <strong>vi</strong> should also look into <strong>vim</strong> and <strong>gvim</strong>, the mousey
and windy version, for coloring of Perl keywords.
</para>
<para>
<strong>vi</strong> ユーザーは、Perl のキーワードを色付けする、マウスとウィンドウ対応の
<strong>vim</strong> と <strong>gvim</strong> を調べてみてください。
</para>
<para>
Note that only perl can truly parse Perl, so all such CASE tools
fall somewhat short of the mark, especially if you don't program
your Perl as a C programmer might.
</para>
<para>
perl のみが完全に Perl をパースできるので、これら全ての CASE ツールには
足りないところがあることに注意してください; 特に C プログラマーが書くような
Perl プログラムを書いていない場合はそうです。
</para>
</sect2>
<sect2>
<title>The Perl Profiler
<index>profile</index> <index>profiling</index> <index>profiler</index></title>
<para>
(Perl プロファイラ)
</para>
<para>
If you wish to supply an alternative debugger for Perl to run, just
invoke your script with a colon and a package argument given to the
<strong>-d</strong> flag.  The most popular alternative debuggers for Perl is the
Perl profiler.  Devel::DProf is now included with the standard Perl
distribution.  To profile your Perl program in the file <filename>mycode.pl</filename>,
just type:
</para>
<para>
Perl の実行に代替デバッガを使いたい場合は、単に <strong>-d</strong> オプションに
コロンとパッケージからなる引数を付けてスクリプトを起動してください。
もっとも有名な Perl 用代替デバッガは Perl プロファイラです。
Devel::DProf は Perl 標準配布に含まれています。
ファイル <filename>mycode.pl</filename> にある Perl プログラムをプロファイリングしたい
場合、以下のようにします:
</para>
<verbatim><![CDATA[
$ perl -d:DProf mycode.pl
]]></verbatim>
<para>
When the script terminates the profiler will dump the profile
information to a file called <filename>tmon.out</filename>.  A tool like <strong>dprofpp</strong>,
also supplied with the standard Perl distribution, can be used to
interpret the information in that profile.
</para>
<para>
スクリプトが終了すると、プロファイラはプロファイル情報を
<filename>tmon.out</filename> というファイルにダンプします。
Perl 標準配布に含まれている <strong>dprofpp</strong> のようなツールが、この
プロファイルの情報を解釈するのに使えます。
</para>
</sect2>
</sect1>
<sect1>
<title>Debugging regular expressions
<index>regular expression, debugging</index>
<index>regex, debugging</index> <index>regexp, debugging</index></title>
<para>
(正規表現のデバッグ)
</para>
<para>
<code>use re 'debug'</code> enables you to see the gory details of how the Perl
regular expression engine works. In order to understand this typically
voluminous output, one must not only have some idea about how regular
expression matching works in general, but also know how Perl's regular
expressions are internally compiled into an automaton. These matters
are explored in some detail in
<link xref='perldebguts#Debugging_regular_expressions'>perldebguts/&quot;Debugging regular expressions&quot;</link>.
</para>
<para>
<code>use re 'debug'</code> を指定すると、Perl 正規表現エンジンがどのように
動作するかの詳細を見ることができます。
この、典型的には大量の出力を理解するためには、
一般的に正規表現マッチがどのように行われるかだけでなく、
Perl の正規表現が内部的にどのようにオートマトンにコンパイルされるかを
知らなければなりません。
これらの事柄は詳細は
<link xref='perldebguts#Debugging_regular_expressions'>perldebguts/&quot;Debugging regular expressions&quot;</link> にあります。
</para>
</sect1>
<sect1>
<title>Debugging memory usage
<index>memory usage</index></title>
<para>
(メモリ使用のデバッグ)
</para>
<para>
Perl contains internal support for reporting its own memory usage,
but this is a fairly advanced concept that requires some understanding
of how memory allocation works.
See <link xref='perldebguts#Debugging_Perl_memory_usage'>perldebguts/&quot;Debugging Perl memory usage&quot;</link> for the details.
</para>
<para>
Perl には自身のメモリ使用状況を報告するための内部機能があります。
しかしこれはかなり上級の概念で、メモリ割り当てがどのように行われるかに
ついての理解が必要となります。
詳細については
<link xref='perldebguts#Debugging_Perl_memory_usage'>perldebguts/&quot;Debugging Perl memory usage&quot;</link> を参照して下さい。
</para>
</sect1>
<sect1>
<title>SEE ALSO</title>
<para>
You did try the <strong>-w</strong> switch, didn't you?
</para>
<para>
<strong>-w</strong> スイッチはもう使いましたよね?
</para>
<para>
<link xref='perldebtut'>perldebtut</link>,
<link xref='perldebguts'>perldebguts</link>,
<link xref='re'>re</link>,
<link xref='DB'>DB</link>,
<link xref='Devel::DProf'>Devel::DProf</link>,
<link xref='dprofpp'>dprofpp</link>,
<link xref='Dumpvalue'>Dumpvalue</link>,
and
<link xref='perlrun'>perlrun</link>.
</para>
<para>
<link xref='perldebtut'>perldebtut</link>,
<link xref='perldebguts'>perldebguts</link>,
<link xref='re'>re</link>,
<link xref='DB'>DB</link>,
<link xref='Devel::DProf'>Devel::DProf</link>,
<link xref='dprofpp'>dprofpp</link>,
<link xref='Dumpvalue'>Dumpvalue</link>,
<link xref='perlrun'>perlrun</link>.
</para>
<para>
When debugging a script that uses #! and is thus normally found in
$PATH, the -S option causes perl to search $PATH for it, so you don't
have to type the path or <code>which $scriptname</code>.
</para>
<para>
#! を使っているので普通は $PATH に見つかるスクリプトをデバッグするとき、
-S オプションを付けると perl は $PATH からスクリプトを探すので、
パスや <code>which $scriptname</code> をタイプする必要がなくなります。
</para>
<verbatim><![CDATA[
$ perl -Sd foo.pl
]]></verbatim>
</sect1>
<sect1>
<title>BUGS</title>
<para>
You cannot get stack frame information or in any fashion debug functions
that were not compiled by Perl, such as those from C or C++ extensions.
</para>
<para>
C や C++ 拡張のような、Perl でコンパイルされていないものに対して
スタックフレーム情報やあらゆるデバッグ関数を使うことはできません。
</para>
<para>
If you alter your @_ arguments in a subroutine (such as with <code>shift</code>
or <code>pop</code>), the stack backtrace will not show the original values.
</para>
<para>
サブルーチン内で(<code>shift</code> や <code>pop</code> を使って) @_ 引数を変更した場合、
スタックバックトレースで元の値を表示することはできません。
</para>
<para>
The debugger does not currently work in conjunction with the <strong>-W</strong>
command-line switch, because it itself is not free of warnings.
</para>
<para>
デバッガは現在のところ <strong>-W</strong> コマンドラインスイッチと同時に
使うことはできません。これ自身が警告から逃れられないからです。
</para>
<para>
If you're in a slow syscall (like <code>wait</code>ing, <code>accept</code>ing, or <code>read</code>ing
from your keyboard or a socket) and haven't set up your own <code>$SIG{INT}</code>
handler, then you won't be able to CTRL-C your way back to the debugger,
because the debugger's own <code>$SIG{INT}</code> handler doesn't understand that
it needs to raise an exception to longjmp(3) out of slow syscalls.
</para>
<para>
(キーボードやソケットからの <code>wait</code>, <code>accept</code>, <code>read</code>などの)
遅いシステムコールを実行中で、独自の <code>$SIG{INT}</code> ハンドラを設定していない場合、
デバッガに戻ってくるために CTRL-C を使うことはできません。
これは、デバッガ自身の <code>$SIG{INT}</code> ハンドラが
遅いシステムコールから longjmp(3) で出るための例外を発生させる必要性を
理解しないからです。
</para>
</sect1>
</pod>
