b2g(FirefoxOS) eclipseでデバッグする方法(その1) gdbserverの起動
android gdb debug - のねの日記
コマンドラインのgdbclientの方法を応用し、eclipseでデバッグ - のねの日記
linuxでのgdbclientの使い方 - のねの日記
$ cd B2G $ ln -s run-gdb.sh ./run-eclipse.sh
gdbserverだけ起動するようにスクリプトを修正する。
vi run-gdb.sh
修正前
80 if [ "$SCRIPT_NAME" == "run-ddd.sh" ]; then 81 echo "ddd --debugger \"$GDB -x $GDBINIT\" $PROG" 82 ddd --debugger "$GDB -x $GDBINIT" $PROG 83 else 84 echo $GDB -x $GDBINIT $PROG 85 $GDB -x $GDBINIT $PROG 86 fi
修正後
80 case "$SCRIPT_NAME" in 81 "run-ddd.sh") 82 echo "ddd --debugger \"$GDB -x $GDBINIT\" $PROG" 83 ddd --debugger "$GDB -x $GDBINIT" $PROG 84 ;; 85 "run-eclipse.sh") 86 echo "eclipse.sh gdbserver ready. gdb:$GDB gdbinit:$GDBINIT prog:$PROG" 87 ;; 88 *) 89 echo $GDB -x $GDBINIT $PROG 90 $GDB -x $GDBINIT $PROG 91 esac
$adb shell ps | grep b2g root 43 1 101224 34820 ffffffff 419a642e R /system/b2g/b2g $ ./run-eclipse.sh attach 43 $ adb shell ps | grep gdbserver root 325 323 348 172 c01de5dc 0001a78c S gdbserver
gdbserverの準備は完了。