Fortran-debugging-program

提供:Dev Guides
移動先:案内検索

Fortran-デバッグプログラム

デバッガーツールを使用して、プログラムのエラーを検索します。

デバッガープログラムはコードをステップ実行し、プログラムの実行中に変数やその他のデータオブジェクトの値を調べることができます。

ソースコードが読み込まれ、デバッガ内でプログラムを実行することになります。 デバッガは次の方法でプログラムをデバッグします-

  • ブレークポイントの設定、
  • ソースコードをステップスルーし、
  • 監視ポイントを設定します。

ブレークポイントは、特に重要なコード行の後、プログラムが停止する場所を指定します。 変数がブレークポイントでチェックされた後のプログラム実行。

デバッガープログラムは、ソースコードも1行ずつチェックします。

監視ポイントは、特に読み取りまたは書き込み操作の後、いくつかの変数の値を確認する必要があるポイントです。

gdbデバッガー

gdbデバッガー、GNUデバッガーはLinuxオペレーティングシステムに付属しています。 X Windowsシステムの場合、gdbにはグラフィカルインターフェイスが付属しており、プログラムの名前はxxgdbです。

次の表に、gdbのいくつかのコマンドを示します-

Command Purpose
break Setting a breakpoint
run Starts execution
cont Continues execution
next Executes only the next line of source code, without stepping into any function call
step Execute the next line of source code by stepping into a function in case of a function call.

dbxデバッガー

Linux用の別のデバッガー、dbxデバッガーがあります。

次の表は、dbxのいくつかのコマンドを示しています-

Command Purpose
stop[var] Sets a breakpoint when the value of variable var changes.
stop in [proc] It stops execution when a procedure proc is entered
stop at [line] It sets a breakpoint at a specified line.
run Starts execution.
cont Continues execution.
next Executes only the next line of source code, without stepping into any function call.
step Execute the next line of source code by stepping into a function in case of a function call.