Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12618 Discussions

gdb "unable to bind" also "you can't do that when your target is `exec'" hassles

Honored Contributor II

I submitted service request 11001074 today concerning the following issue. 


To Altera: 


When coding the nios2-gdb-server please be mindful of pittfall number three described at the following URL. 


Since this isnt done in nios2-gdb-server then the software developer is constanty receiving the "unable to bind" error message from nios2-gdb-server unless he uses a new port every time that the nios2-gdb-server is started. Using a new port each time makes it very difficult to configure gdb to use the same port as nios2-gdb-server in the IDE.  


/media/hill/aux0/altera-install/13.0sp1/nios2eds/bin/nios2-gdb-server -C -r --tcpport 6001 

Unable to bind (98) 


We receive this error message because the ip port-address tuple stays in ip kernel wait state for NNN minutes after nios2-gdb-server exits unless the SO_REUSEADDR option is set. 


Not being able to reuse the same port number is a huge hastle for the software developer if he is using the debugger restart to restart the target. I restart the target frequently when I am debugging. 


Yes, there is also the "--tcppersist" option for nios2-gdb-server, but this requires starting nios2-gdb-server in a separate window. We prefer to start nios2-gdb-server from the IDE when launching gdb so that another step isnt required. The "--tcppersist" option isnt very appealing because we must restart the nios2-gdb-server every time that the target is powered back on which is often because the fan is very loud.
0 Kudos
0 Replies