* Gdb/Insight enhancement
@ 1999-11-16 14:48 Staggs, Kevin P (AZ75)
0 siblings, 0 replies; only message in thread
From: Staggs, Kevin P (AZ75) @ 1999-11-16 14:48 UTC (permalink / raw)
To: 'insight@sourceware.cygnus.com'
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-11-16 14:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-16 14:48 Gdb/Insight enhancement Staggs, Kevin P (AZ75)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).