public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: "Staggs, Kevin P (AZ75)" <Staggs_Kevin@htc.honeywell.com>
To: "'insight@sourceware.cygnus.com'" <insight@sourceware.cygnus.com>
Subject: Gdb/Insight enhancement
Date: Tue, 16 Nov 1999 14:48:00 -0000	[thread overview]
Message-ID: <7D2706D329C7D1118EC200805F15C5E44DAFA9@htc-az75.htc.honeywell.com> (raw)

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

                 reply	other threads:[~1999-11-16 14:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7D2706D329C7D1118EC200805F15C5E44DAFA9@htc-az75.htc.honeywell.com \
    --to=staggs_kevin@htc.honeywell.com \
    --cc=insight@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).