2017年3月11日土曜日

python debugger

パイソンデバッカー
Python Debugger


Installation

Enter the following URL and click Download.
Since it is saved in zip format, install according to the procedure.

Http://net.programming.jp/wpd/


インストール

以下のURLを入力して、ダウンロードをクリックします。
zip型式で保存されているので、手順に従いインストールします。

http://net.programming.jp/wpd/








Introduction

Select and display the target python source file
Click the Debug icon to start debugging.
(When you click the icon, the icon will have a hollow shadow)

If you want to finish debugging in the middle of debugging, click the icon again.
An arrow (=>) is displayed to the left of the line number, and that line becomes the line before the current execution.

Execute the current line with the return key.
If there is focus on the panel of the source screen, execute the debug command with one letter of the keyboard.

The main debug commands are as follows.

Step "in" step in
Next "n" in the next line
Return from "r" "r"
Breakpoint setting and release of breakpoint specified line "b"
(It is a toggle, the second press on the same line is canceled, the third time is set)

Continue processing "c"



入門編

対象のパイソンのソースをファイル選択して表示します
Debugアイコンをクリックしてデバックを開始します。
(アイコンをクリックすると、アイコンがくぼみ影がつきます)

デバック途中でデバック終了をしたい場合は、再度そのアイコンをクリックします。
行番号の左側に矢印(=>)が表示され、その行が現在の実行前の行になります。

リターンキーにより、現在行を実行します。
ソース画面のパネルにフォーカスがある場合は、キーボードの一文字でデバックコマンドを実行します。

主なデバックコマンドは以下になります。

step    ステップインの ”s"
next    次の行の    "n"
return   関数から戻るの ”r” 
breakpoint 指定行のブレークポイント設定と解除 ”b”
(トグルです、同じ行での2回目の押下は解除、3回目は設定)

continue   処理継続の ”c”


If there is focus on the pdb command input panel,
It performs the same operation as pdb debugger.
The focus switching of each panel (source file display panel, pdb command input panel)
If you move the mouse to that panel area, the focus changes.

On the pdb command input panel, you must press the return key after entering the command.
Also, the entered command is displayed in the status bar, but in that area, the debugger
Only the output result is displayed.

If the command you entered is an error, the result will be displayed in red.
In other words, if the input command is accepted, the result will be displayed in normal color.

If there is a fatal error in the source file
Immediately after starting debugging, the error contents are displayed in the pdb command panel with red characters.
In the source screen display panel, the arrow moves to the line where the error occurred.
Debug processing will be aborted.


pdbコマンド入力のパネルにフォーカスがある場合は、
pdbデバッカーと同じ動作をおこないます。
各パネル(ソースファイル表示パネル、pdbコマンド入力パネル)のフォーカスの切替は、
マウスをそのパネル領域に移動させれば、フォーカスが変わります。

pdbコマンド入力パネルでは、コマンド入力後にリターンキーを押下しなければいけません。
また、入力されたコマンドは、ステータスバーに表示されますが、その領域には、デバッカーからの
出力結果のみが表示されます。

入力したコマンドがエラーの場合は、赤色で結果が表示されます。
つまり入力されたコマンドが受け入れされた場合は、通常の色で結果が表示されます。

ソースファイルに、致命的なエラーがある場合
デバック開始した直後に、赤い文字でエラー内容がpdbコマンドパネルに表示されます。
ソース画面表示パネルには、エラーが発生した行に矢印が移動しています。
デバック処理は、中止されます。

Traceback (most recent call last):
  File "/usr/lib/python2.7/pdb.py", line 1314, in main
    pdb._runscript(mainpyfile)
  File "/usr/lib/python2.7/pdb.py", line 1233, in _runscript
    self.run(statement)
  File "/usr/lib/python2.7/bdb.py", line 387, in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "/home/koba/fx/wpd/1st.py", line 10
    b=["one","two"]
   ^
IndentationError: unexpected indent