ザイリンクス システム デバッガー コマンド ライン インターフェイス (XSDB) は、ターゲットで既に実行中のプログラム (フラッシュ メモリからのブートなど) をデバッグするために使用できます。これには、ターゲットに接続して、ターゲットで実行中のプログラムのシンボル ファイルを設定する必要があります。この方法は、フラッシュ メモリから Linux カーネル ブートをデバッグする際にも使用できます。最良の結果を得るには、ターゲットで実行中のコードをデバッグ情報を使用してコンパイルする必要があります。
次に、ターゲットで既に実行中のプログラムをデバッグする例を示します。デモのため、プログラムはこの例のセッションの前に main()
で停止されます。
# Connect to the hw_server
xsdb% conn -url TCP:xhdbfarmc7:3121
tcfchan#0
xsdb% Info: Arm Cortex-A9 MPCore #0 (target 2) Stopped at 0x1005a4 (Hardware Breakpoint)
xsdb% Info: Arm Cortex-A9 MPCore #1 (target 3) Stopped at 0xfffffe18 (Suspended)
# Select the target on which the program is running and specify the symbol file using the
# memmap command
xsdb% targets 2
xsdb% memmap -file dhrystone/Debug/dhrystone.elf
# When the symbol file is specified, the debugger maps the code on the target to the symbol
# file. bt command can be used to see the back trace. Further debug is possible, as shown in
# the first example
xsdb% bt
0 0x1005a4 main(): ../src/dhry_1.c, line 79
1 0x1022d8 _start()+88
2 unknown-pc