インテルのみ表示可能 — GUID: suc1436373969768
Ixiasoft
1.1. Arria 10 SoCバーチャル・プラットフォームの機能
1.2. Arria 10 SoCバーチャル・プラットフォームのブロック図
1.3. 推奨するPCの使用環境
1.4. Arria 10 SoCバーチャル・プラットフォームのインストール
1.5. プリビルドのLinuxカーネルを使用したインストールとブート
1.6. GNUデバッグ(gdb)を使用したLinuxアプリケーションのデバッグ
1.7. ネットワーク接続
1.8. Angstromを使用したカスタムLinuxカーネルのビルド
1.9. 付録 A:parameters_Arria10.txtファイルの編集
1.10. 付録 B:メモリ・マップおよび割り込みマップ
1.11. Arria 10 SoCバーチャル・プラットフォーム ユーザーガイドの改訂履歴
インテルのみ表示可能 — GUID: suc1436373969768
Ixiasoft
1.6.6. ホスト上でのgdbクライアントを使用したデバッグ
- ホスト上でgdbクライアントを実行します。
gdb-multiarch ./factorial.out Process ./factorial.out created; pid = 229 Listening on port 8080
- ターゲットへgdbを接続します。
注: 「ネットワーク接続」の項に記載されたVLANポート・マッピングにあるよう、この例では192.168.0.9:8080ではなくlocalhost:3624が使用されています。
(gdb) target remote localhost:3624 Remote debugging using localhost:3624 warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. 0x76fcfb00 in ?? ()
- コードをデバッグするには、次のgdbサンプル・コマンドを使用します。
- b main:mainファンクションでブレークポイントを設定します
- c:ブレークポイントに至るまで継続します
- s:ステップ・ワン・インストラクション
- b 14:行14にブレークポイントを挿入します
- c typed multiple times:ループの繰り返しを実行します
- l:List code
ホスト・コンソールは以下に類似します。
<name>@ubuntu-12:~$ gdb-multiarch ./factorial.out GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1)7.4-2012.04 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://bugs.launchpad.net/gdb-linaro/>... Reading symbols from /home/<name>/factorial.out...done. (gdb) target remote localhost:3624 Remote debugging using localhost:3624 warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. 0x76fcfb00 in ?? () (gdb) b main Cannot access memory at address 0x0 Breakpoint 1 at 0x83ce: file factorial.c, line 12. (gdb) c Continuing. warning: Could not load shared library symbols for 2 libraries, e.g. /lib/libc.so.6. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"? Breakpoint 1, main () at factorial.c:12 12 for (i = 0; i < 10; ++i) { (gdb) l 7 } 8 9 int main () { 10 int i; 11 int n; 12 for (i = 0; i < 10; ++i) { 13 n = factorial (i); 14 printf ("factorial(%d) = %d\n", i, n); 15 } 16 return 0; (gdb) b 14 Breakpoint 2 at 0x83de: file factorial.c, line 14. (gdb) c Continuing. Breakpoint 2, main () at factorial.c:14 14 printf ("factorial(%d) = %d\n", i, n); (gdb) s Cannot access memory at address 0x0 Breakpoint 2, main () at factorial.c:14 14 printf ("factorial(%d) = %d\n", i, n); (gdb) c Continuing. Breakpoint 2, main () at factorial.c:14 14 printf ("factorial(%d) = %d\n", i, n); (gdb) c Continuing. Breakpoint 2, main () at factorial.c:14 14 printf ("factorial(%d) = %d\n", i, n); (gdb) c Continuing. Breakpoint 2, main () at factorial.c:14 14 printf ("factorial(%d) = %d\n", i, n); (gdb) c Continuing. Breakpoint 2, main () at factorial.c:14 14 printf ("factorial(%d) = %d\n", i, n); (gdb) c
ターゲット・コンソールは以下に類似します。
root@host:~# gdbserver :8080 ./factorial.out Process ./factorial.out created; pid = 229 Listening on port 8080 Remote debugging from host 192.168.0.1 factorial(0) = 1 factorial(1) = 1 factorial(2) = 2 factorial(3) = 6 factorial(4) = 24 factorial(5) = 120 factorial(6) = 720 factorial(7) = 5040 factorial(8) = 40320 factorial(9) = 362880 Child exited with status 0
関連情報