public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA 1/5] New patches to support --enable-targets=all for mingw64
@ 2010-09-10 14:06 Pierre Muller
  2010-09-13 18:11 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Muller @ 2010-09-10 14:06 UTC (permalink / raw)
  To: gdb-patches

  I tried to compile GDB with
--enable-targets=all for x86_64-w64-mingw32
target.
  As 'long' type is 4-byte while pointer type is 8-byte,
this target is quite sensitive to so 'dirty' code
lying around like casting 'long' or 'unsigned long' to pointers...

  I had to fix several sources to be able to 
successfully compile GDB with those configuration options.

1) Replace remaining #include <winsock.h> by #inlcude <winsock2.h>
in remote-m32r-sdi.c and m32r-rom.c

  I apologize to the person that already submitted a similar 
change, but I was unable to find it again. 
  I vaguely remember that we already discussed this once, but there
are still two <winsock.h> inlcudes in gdb HEAD.

  The patch below fixes this.
  
Pierre Muller
Pascal language support maintainer for GDB


2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>

	* m32r-rom.c: Replace winsock.h with winsock2.h header.
	* remote-m32r-sdi.c: Replace winsock.h by winsock2.h.

Index: src/gdb/m32r-rom.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-rom.c,v
retrieving revision 1.40
diff -u -p -r1.40 m32r-rom.c
--- src/gdb/m32r-rom.c	1 Jan 2010 07:31:37 -0000	1.40
+++ src/gdb/m32r-rom.c	9 Sep 2010 16:39:58 -0000
@@ -45,7 +45,7 @@
  * All this stuff just to get my host computer's IP address!
  */
 #ifdef __MINGW32__
-#include <winsock.h>
+#include <winsock2.h>
 #else
 #include <sys/types.h>
 #include <netdb.h>		/* for hostent */
Index: src/gdb/remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.52
diff -u -p -r1.52 remote-m32r-sdi.c
--- src/gdb/remote-m32r-sdi.c	6 Sep 2010 13:59:02 -0000	1.52
+++ src/gdb/remote-m32r-sdi.c	9 Sep 2010 16:39:59 -0000
@@ -32,7 +32,7 @@
 #include <ctype.h>
 #include <signal.h>
 #ifdef __MINGW32__
-#include <winsock.h>
+#include <winsock2.h>
 #else
 #include <netinet/in.h>
 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA 1/5] New patches to support --enable-targets=all for mingw64
  2010-09-10 14:06 [RFA 1/5] New patches to support --enable-targets=all for mingw64 Pierre Muller
@ 2010-09-13 18:11 ` Joel Brobecker
  2010-09-14 15:04   ` Pierre Muller
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-09-13 18:11 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

(the issues you have encountered are very familiar to me, since I had
the same problem when I ported the native debugger to 64bit windows).

> 1) Replace remaining #include <winsock.h> by #inlcude <winsock2.h>
> in remote-m32r-sdi.c and m32r-rom.c
> 
>   I apologize to the person that already submitted a similar 
> change, but I was unable to find it again. 
>   I vaguely remember that we already discussed this once, but there
> are still two <winsock.h> inlcudes in gdb HEAD.
[...]
> 2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* m32r-rom.c: Replace winsock.h with winsock2.h header.
> 	* remote-m32r-sdi.c: Replace winsock.h by winsock2.h.

I don't know much about Windows systems, but since no one reviewed
the patch, I did some research.  I believe the patch is correct, since
we are linking gdb and gdbserver against ws2_32.lib, so the correct
include is winsock2.h (winsock.h is for wsock32.lib).

http://cboard.cprogramming.com/networking-device-communication/71596-winsock-vs-winsock2.html

So this is OK.

Thank you,
-- 
Joel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [RFA 1/5] New patches to support --enable-targets=all for mingw64
  2010-09-13 18:11 ` Joel Brobecker
@ 2010-09-14 15:04   ` Pierre Muller
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2010-09-14 15:04 UTC (permalink / raw)
  To: 'Joel Brobecker'; +Cc: gdb-patches

> Objet : Re: [RFA 1/5] New patches to support --enable-targets=all for
> mingw64
> 
> (the issues you have encountered are very familiar to me, since I had
> the same problem when I ported the native debugger to 64bit windows).
> 
> > 1) Replace remaining #include <winsock.h> by #inlcude <winsock2.h>
> > in remote-m32r-sdi.c and m32r-rom.c
> >
> >   I apologize to the person that already submitted a similar
> > change, but I was unable to find it again.
> >   I vaguely remember that we already discussed this once, but there
> > are still two <winsock.h> inlcudes in gdb HEAD.
> [...]
> > 2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>
> >
> > 	* m32r-rom.c: Replace winsock.h with winsock2.h header.
> > 	* remote-m32r-sdi.c: Replace winsock.h by winsock2.h.
> 
> I don't know much about Windows systems, but since no one reviewed
> the patch, I did some research.  I believe the patch is correct, since
> we are linking gdb and gdbserver against ws2_32.lib, so the correct
> include is winsock2.h (winsock.h is for wsock32.lib).
> 
> http://cboard.cprogramming.com/networking-device-communication/71596-
> winsock-vs-winsock2.html
> 
> So this is OK.

  Thanks for the approval,
patch committed.


Pierre Muller
Pascal language support maintainer for GDB




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-14  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 14:06 [RFA 1/5] New patches to support --enable-targets=all for mingw64 Pierre Muller
2010-09-13 18:11 ` Joel Brobecker
2010-09-14 15:04   ` Pierre Muller

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).