From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Staggs, Kevin P (AZ75)" To: "'insight@sourceware.cygnus.com'" Subject: Gdb/Insight enhancement Date: Tue, 16 Nov 1999 14:48:00 -0000 Message-id: <7D2706D329C7D1118EC200805F15C5E44DAFA9@htc-az75.htc.honeywell.com> X-SW-Source: 1999-q4/msg00056.html Hello, I am using gdb/insight to debug an embedded system across a network connection and currently don't have the IP address for the node in any name server or in my local hosts file. When this is the case I found that you are not able to connect to a remote target through TCP/IP using the IP address. An example of using an IP address might be the command "target remote 192.168.1.1:1058". GDB returns an error when trying to do this. I made a change in the ser-tcp.c file which allows the connection to be made either by the DNS name or by the IP address. To facilitate the explanation of the change, I will include the original lines from ser-tcp.c first and then the new/changes lines to facilitate using an IP address> Lines 69-74 of original source for ser-tcp.c if (!hostent) { fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname); errno = ENOENT; return -1; } Lines 69-88 of a modified ser-tcp.c file if (!hostent) { //Can't get information by name try to get by IP address unsigned long IPAddress = inet_addr ( hostname ); if (INADDR_NONE == IPAddress) { fprintf_unfiltered (gdb_stderr, "%s: bad hostname\n", hostname); errno = ENOENT; return -1; } hostent = gethostbyaddr((char*)&IPAddress, sizeof(IPAddress), 2); if (!hostent) { fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname); errno = ENOENT; return -1; } } I hope this change is acceptable and will be incorporated into future releases of gdb/insight. Thank you, Kevin Staggs