How to debug networking codes?

Rahman, Md S. sazzad at
Wed Aug 22 17:52:42 CDT 2007

Thanks for your suggestion, I would go for GDB over serial connection and I have already ordered one serial cable. In the meantime, I was trying to catch the SIGILL signal in the application using ASR signal manager, but didn't work.

I have added the following in init.c, but RTEMS never calls Process_asr function to handle the signal.

        rtems_status_code Ret = rtems_signal_catch( Process_asr, RTEMS_DEFAULT_MODES )

Is there anything else to handle SIGILL signal in the application?
I really appreciate any help in this regards.


-----Original Message-----
From: Till Straumann [mailto:strauman at]
Sent: Wednesday, August 22, 2007 12:20 PM
To: Rahman, Md S.
Cc: rtems-users at
Subject: Re: How to debug networking codes?


You cannot debug networking code. If you set a breakpoint in
networking and e.g., the network task is suspended at the breakpoint
-- how do you expect the stub to continue talking to the host gdb
using the same network stack???

If you want to debug networking then you should use GDB on a serial
connection (preferrably a separate serial port where no printf/printk
is directed).

-- Till

Rahman, Md S. wrote:
> Hello,
> I have been porting SCTP(Stream Control Transmission Protocol) in
> RTEMS from FreeBSD. This is a transport layer protocol and resides
> with TCP/UDP networking codes in kernel. I am mostly done with this
> port and a number of SCTP socket API's like socket, listen, bind,
> accept, connect etc. works fine.
> However, I am now encountering some exception problems while
> establishing SCTP connection between RTEMS SCTP endpoint with FreeBSD
> SCTP endpoint via internet. The console shows:
> Exception 6 caught at PC 191864 by Thread 167831697
> Processor execution context at time of the fault was:
> EAX 340012E7 EBX=384 ECX=FFFFFFFF EX=0
> ESI=0 EDI=0 EBP=195838 ESP=195804
> Error code pushed by processor itself (if not 0) = 0
> Faulty Thread will be deleted
> I tried to debug this problem by adding printf in codes but was not
> able to detect the exact statement which causes this exception. Then I
> have built RTEMS_GDB_Stub_1.4
> (
> <>) for
> remote debugging and built my RTEMS SCTP application with
> librtems-gdb-stub.a library. At this point, running the RTEMS
> application crashes with:
> GDB Agent: Exception (SIGILL) caught; Task 0xA010001 Killed
> (Suspended) -use GDB
> Exception Vector #0x6; Registers:
> .....................
> To investigate further with breakpoints, I have configured gdb6.6
> patched with RTEMS_GDB_Stub_1.4 in the host machine FC5. This works
> fine and any break point in RTEMS application in init.c could be
> reachable by the host gdb. However, when I try to reach a breakpoint
> in SCTP code which resides in cpukit/libnetworking/netinet, host gdb
> loses connection with the target machine and target application dies.
> In this point, I am not sure how should I proceed to solve this problem.
> I would appreciate any suggestion in this regard.
> Best Regards,
> Md Sazzadur Rahman
> Graduate Student,
> School of Computer Science,
> University of Oklahoma,
> Norman, Oklahoma, USA
> ------------------------------------------------------------------------
> _______________________________________________
> rtems-users mailing list
> rtems-users at

More information about the rtems-users mailing list