This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] remote debugging patches
Daniel Jacobowitz wrote:
> Michal, are you OK with just the IP address?
Sure I am :-) Patch follows... Is it OK?
Index: ChangeLog
* remote-utils.c (remote_open): Print remote-side's
IP address when remote debugging over the network.
Index: remote-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/remote-utils.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 remote-utils.c
*** remote-utils.c 2002/02/14 06:21:22 1.8
--- remote-utils.c 2002/03/13 14:11:16
*************** static int remote_desc;
*** 47,53 ****
void
remote_open (char *name)
{
! int save_fcntl_flags;
if (!strchr (name, ':'))
{
--- 47,56 ----
void
remote_open (char *name)
{
! int save_fcntl_flags, via_network=0;;
! char namebuf[100];
!
! snprintf(namebuf, 100, "%s", name);
if (!strchr (name, ':'))
{
*************** remote_open (char *name)
*** 154,159 ****
--- 157,166 ----
signal (SIGPIPE, SIG_IGN); /* If we don't do this, then
gdbserver simply
exits when the remote side
dies. */
+
+ /* Convert IP address to string. */
+ snprintf (namebuf, 100, "%s", inet_ntoa (sockaddr.sin_addr.s_addr));
+ via_network = 1;
}
#if defined(F_SETFL) && defined (FASYNC)
*************** remote_open (char *name)
*** 164,170 ****
#endif
#endif
disable_async_io ();
! fprintf (stderr, "Remote debugging using %s\n", name);
}
void
--- 171,179 ----
#endif
#endif
disable_async_io ();
!
! fprintf (stderr, "Remote debugging %s %s\n",
! via_network ? "from host" : "using", namebuf);
}
void
Michal Ludvig
--
* SuSE CR, s.r.o * mludvig@suse.cz
* +420 2 9654 5373 * http://www.suse.cz