[uCsimm] success story: GDB on uClinux

From: 권석근 (kwonsk@mutech.co.kr)
Date: Thu Jan 13 2000 - 22:18:06 EST

hi, all
I finally finish the job - remote debugging user application with GDB on
I've waited success story about debug from this mailing list but
could'nt see it. So i tried myself and finally got working gdb.
well, we also have graphical debugger if we could debug with gdb (my guess)

there could be three paths for getting gdb works on uClinux
1) make native gdb on uClinux (local debug)
2) make gdb-stub for uClinux (remote debug)
3) make gdbserver for uClinux (remote debug)

1) is almost impossible, 2) is tedious (it's best for controller without OS
or kernel debug, if
you try this for user app. on uClinux, you will be messed up with os stuff,
it uses too many
assembly which could disturb working kernel)
3) it was my choice.

one good point of using gdbserver is i could debug program that do
printf on serial line. because gdbserver make connection through TCP/IP

Problems i met were,
1) kernel has ptrace support, linker says that i don't have ptrace function.
2) how to support "TRAP #1", uClinux kernel transform this instruction to
illeagal inst.
   and generate SIGILL rather than SIGTRAP. GDB use trap1 as a breakpoint
3) No mm problem of course. GDB get symbol info from .coff but it's
addresses are
    different from actual program address.

All problems are solved and now i could debug my program using GDB (source
debugging of course).
I'm preparing docu about exactly what steps did i do.
Not many changes, please give me some time. i'll show you all.

target side:
#/mnt/gdbserver :3000 /mnt/test
host side:
>gdb-m68k test.coff
gdb) targe remote
gdb) everything you want

BTW, if somebody have done this, please give me a note.

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/

This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:33 EST