シングルステップエントリ、シングルステップステップオーバー、シングルステップシャットダウンを実行するためにGDBを使用する方法は?

シングルステップエントリ、シングルステップステップオーバー、シングルステップシャットダウンを実行するためにGDBを使用する方法は?

GDBを入力しましたが、help着信、発信、発信などに関する情報が見つかりませんでした。_startアセンブラの()にブレークポイントを設定しましたbreak _start。その後、入力してnextデバッグが完了しました。終わったからこんな感じですが、_startそうではありません。中に入る私が望むように。

ベストアンサー1

help runningいくつかのヒントがあります:

stepとディレクティブがありますnext(そしてまたありますnextistepi

(gdb) help next
Step program, proceeding through subroutine calls.
Usage: next [N]
Unlike "step", if the current source line calls a subroutine,
this command does not enter the subroutine, but instead steps over
the call, in effect treating it as a single source line.

stepだから我々はステップを見ることができます入力するサブルーチンですが、next単一ステップで実行されます。超過サブルーチン。

およびstepstepiおよびnextnextiは、「行」または「コマンド」の増分で区切られます。

step -- Step program until it reaches a different source line
stepi -- Step one instruction exactly

関連事項は次のとおりですfinish

(gdb) help finish
Execute until selected stack frame returns.
Usage: finish
Upon return, the value returned is printed and put in the value history.

より有用な情報は次の場所にあります。https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html

おすすめ記事