This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] remote debugging patches
Andreas Schwab wrote:
> Maybe it's just me, but I hate arbitrary limits. There is no need for
> sprintf at this point anyway. I'd suggest to define another variable that
> either points to name or to the result of inet_ntoa and use that in the
> fprintf call. No need for namebuf either.
OK, the 100-chars limit is removed and the patch is getting smaller and
smaller :-)) Do you like it more this way, Andreas?
Index: gdbserver/remote-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/remote-utils.c,v
retrieving revision 1.8
diff -c -3 -p -B -b -r1.8 remote-utils.c
*** remote-utils.c 2002/02/14 06:21:22 1.8
--- remote-utils.c 2002/03/13 19:05:33
*************** remote_open (char *name)
*** 99,105 ****
}
#endif
!
}
else
{
--- 99,105 ----
}
#endif
! fprintf (stderr, "Remote debugging using %s\n", name);
}
else
{
*************** remote_open (char *name)
*** 154,159 ****
--- 154,163 ----
signal (SIGPIPE, SIG_IGN); /* If we don't do this, then
gdbserver simply
exits when the remote side
dies. */
+
+ /* Convert IP address to string. */
+ fprintf (stderr, "Remote debugging from host %s\n",
+ inet_ntoa (sockaddr.sin_addr));
}
#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
--- 168,173 ----