arm 用に gdbserver 7.6 を次のようにコンパイルしました。
cd /gdb-7.6-src/gdb/gdbserver
./configure --target=arm-linux --host=arm-linux
make CC=/path/to/cross-compiler-gcc
次に、arm 用に gdb 7.6 を次のようにコンパイルしました。
cd /gdb-7.6-src/
./configure --target=arm-linux --prefix=/opt/gdb-arm/install/
make && make install
簡単なアプリケーションを次のようにコンパイルしました。
/path/to/cross-compiler-gcc hello.c -g -o hello
gdbserver とクロスコンパイルしたアプリケーションをボードにコピーしました。私のPC(x86-pc-linux)から次を実行します:
gdb hello
(gdb) set target-async on
(gdb) tvariable $c
(gdb) actions
>teval $c=$c+1
>end
(gdb) break main
(gdb) target remote <ipaddr>:<port>
[Thread 1585] #1 stopped.
0x40000800 in ?? ()
Cannot access memory at address 0x0
(gdb) continue &
(gdb) tstart
Target does not support this command.
(gdb) tstatus
Target does not support this command.
動作はtstartコマンドまでは「正常」です。アプリケーションを必要に応じてデバッグできますが、アプリのトレースを開始できません。
問題は、gdbserver は arm のトレースポイントをサポートするのか、それとも x86/amd_64 のみをサポートするのかということです。