| | 1 | = GDB remote debugging = |
| | 2 | |
| | 3 | == gdbserver binary == |
| | 4 | I compiled the attached gdbserver binary using the arm-linux-gnueabi toolchain using the -static link flag. |
| | 5 | |
| | 6 | It can be used without any extra software on the arm device. |
| | 7 | |
| | 8 | Copy it to the phone using: |
| | 9 | |
| | 10 | {{{ |
| | 11 | adb push gdbserver /data/local |
| | 12 | }}} |
| | 13 | |
| | 14 | === Starting gdbserver === |
| | 15 | Start debugging your remote executable using: |
| | 16 | {{{ |
| | 17 | /data/local/gdbserver :3050 ./gdbtst |
| | 18 | }}} |
| | 19 | Assuming the the file gdbtest is the executable that you want to debug and the executable is in your current directory |
| | 20 | === Redirect a port === |
| | 21 | On your local PC use: |
| | 22 | {{{ |
| | 23 | adb forward tcp:1234 tcp:3050 |
| | 24 | }}} |
| | 25 | to forward the local port 1234 to the remote port 3050 |
| | 26 | === Debug === |
| | 27 | Start the debugger using: |
| | 28 | {{{ |
| | 29 | arm-linux-gnueabi-gdb ./gdbtst |
| | 30 | }}} |
| | 31 | And the in gdb use |
| | 32 | {{{ |
| | 33 | target remote :1234 |
| | 34 | }}} |
| | 35 | to start the remote debug session. |