SKY2440 GDB Debugging
Base on ARM-Linux debug(using ARM-Linux GDB debug ARM-Linux embeded system) of sky2440 development board. This article is one of sky2440 serial programmed course, which including all
hardware initialization, reading and writing specific operation, and also including WINCE Application program, Linux program and Non-OS test program.
Source code download:
As to using the GDB, first have to download the source code, website: http://www.gnu.org/software/gdb/download/, now we use the GDB 6.3 version and cross compiler from Embedsky company providing
the only one can support ARM-Linux 3.4.1 of Softload cross compiler in market. After testing, GDB 6.3 version completely support cross compiler 3.4.1 version.
GDB 6.3 version cross compiler download site:ftp://ftp.gnu.org/pub/gnu/gdb/gdb-6.3.tar.bz2; Supporting ARM-Linux 3.4.1 version of Softload cross compiler download site:http://www.embedsky.net/
When compile GDB, need to compile GDB of target main machine(PC) and target board(sky2440) service.
Configure compile and setup download:
After download source code, go to /opt/ folder, steps as below:
#tar jxvf gdb-6.5-tar-bz2
#cd gdb-6.5
#./configure --target=arm-linux --prefix=/usr/local/arm-gdb –v
(--target configure GDB target platform, --prefix configure setup tracking, others of course fine must in concert with followings configuration, have to in state variables, need to start arm-linux-gdb, can
modify /etc/profile or ~/.bash_profile or ~/.bashrc, ), add export PATH=$PATH:/usr/local/arm-gdb/bin, then can find the tracking.)
#make
At this time,
configure: error: no termcap library found
make[1]: *** [configure-gdb] error 1
Solution: sudo apt-get install libncurses5-dev
Finished setup, click make is ok.
#make install
go to gdb/gdbserver catalogue
[root@dding gdbserver]# pwd
/opt/gdb-6.5/gdb/gdbserver
[root@dding gdbserver]#
must operate configuration command under gdbserver catalogue, then can use the relative tracking.
#./configure --target=arm-linux --host=arm-linux
GDB debugging process:
First to start gdbserver on target board, type the command to catalogue of gdbserver,
#cd /tmp
#./gdbserver 192.168.2.100:2345 hello
Showing:
Process /tmp/hello created: pid=80
Listening on port 2345
(under another terminal)
#cd /
#export PATH=$PATH:/usr/local/arm-gdb/bin
#arm-linux-gdb hello
Showing:
Remote debugging using 192.168.2.223:2345
[New thread 80]
[Switching to thread 80]
0x40002a90 in ??()
At the same time showing on the minicom:
Remote debugging from host 192.168.2.100
(gdb)
