The toolchain provides the ever-popular GDB for debugging low-level programs. When the program is targeted for a single-board computer with a JTAG or ICE unit attached, you can use the Sourcery G++ Lite debugger (gdb) to debug the ARM code remotely.
If you wish to test the code as I did—on the Android Linux system running on a mobile phone—you need to attach the phone to the workstation using the USB cable that came with it, then use the Android software development kit's (SDK's)
adb pushcommand to transfer the program to the phone. Once on the phone, in a directory that can contain executable code (/data/local/bin), make the program executable by issuing the
chmod 555 hwcommand. (The
chmodcommand on Android doesn't use
555is necessary, instead.)
Finally, use the
adb shellcommand to connect to the phone, use
cdto change to the correct directory, and run it with
./hw. If all goes according to plan, the program should respond as it did on my phone, by greeting you with "Hello Android!"
Read more here:-
GNU ARM toolchain guide from IBM