2011-08-17

[DM368][IPNC] Using GDB on IPNC

[Prolog]

To dig into Appro's application, I decided to enable gdb on IPNC platform. There are two useful page provided by TI's wiki and they let me enable gdb on IPNC in one hour.
==============================
==============================

[Main]
1. get the latest gdb from gdb download page

2. configure and make gdb and gdbserver

for gdb
==============================
host# ./configure --host=i686-pc-linux-gnu --target=armv5tl-montavista-linux-gnueabi --prefix=/opt/mv_pro_5.0.0/montavista/pro/devkit/arm/v5t_le
host# make
host# make install
==============================

for gdbserver
==============================
host# cd gdb/gdbserver
host# CC=/opt/mv_pro_5.0.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-gcc ./configure  --host=armv5tl-montavista-linux-gnueabi --prefix=/home/user/workdir/filesys
host# make && make install
==============================

there was an error during "make install". the screen showed
==============================
cannot stat 'libinproctrace.so': No such file or directory
==============================

after quick google search, it can be fixed by modifying "gdb/gdbserver/Makefile.in"
==============================
original:
if [ x$IPA_DEPFILES != x ]; then \
fixed:
if [ x${IPA_DEPFILES} != x ]; then \
==============================


3. Running gdbserver at target
==============================
target# gdbserver 192.168.100.1:1000 ./sample
==============================



4. Running gdb at host
==============================
host# /opt/mv_pro_5.0.0/montavista/pro/devkit/arm/v5t_le/bin/armv5tl-montavista-linux-gnueabi-gdb ./sample
==============================

at gdb prompt
==============================
(gdb) set solib-search-path /home/user/workdir/filesys/lib (gdb) target remote 192.168.100.2:1000
==============================


5. (optional) using ddd
==============================
host# ddd --debugger arm_v5t_le-gdb
==============================

6. (optional) error "Malformed packet(b) (missing colon)" 
    in Appro reference design, there is an existing gdbserver under /usr/bin. However, the installation of gdbserver is toward /bin, and the PATH setting will select the old gdbserver (GNU gdbserver 6.6.50.20070301 in my case). Easy to fix though.




[Epilog]
Easy works as far! multitread debugging could be challenge though
[Extend readings]

Debugging on DaVinci using kgdb



No comments:

Post a Comment