[RFA 5/5] New patches to support --enable-targets=all for mingw64

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Fri Sep 10 15:43:00 GMT 2010


  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.

5) solib-som.c is a tdep file (it is listed in ALL_TARGET_OBS)
but it tries to get the hpux system version trough
a direct system call, which probably leads to wrong results
on other systems too.

  If you compile using --enable-targets=all on linux,
the compilation will complete because sys/utsname.h
is available on linux, but if you remote debug a HPUX
program, the current version of get_hpux_major_release
will return a number related to the current Linux system
you are running GDB on... which is totally useless.
  A proper fix would be to get this information via a remote
packet if not native... but I have no access nor time to spend
on that.


Pierre Muller
Pascal language support maintainer for GDB


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

	* solib-som.c (sys/utsname.h include): Only include on HPUX system.
	(get_hpux_major_release): Return 0 if not on HPUX system.

Index: src/gdb/solib-som.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-som.c,v
retrieving revision 1.29
diff -u -p -r1.29 solib-som.c
--- src/gdb/solib-som.c	16 May 2010 23:49:58 -0000	1.29
+++ src/gdb/solib-som.c	9 Sep 2010 16:39:59 -0000
@@ -32,7 +32,9 @@
 #include "solib.h"
 #include "solib-som.h"
 
+#ifdef __hpux
 #include <sys/utsname.h>
+#endif
 #include <string.h>
 
 #undef SOLIB_SOM_DBG 
@@ -137,7 +139,7 @@ static int
 get_hpux_major_release (void)
 {
   static int hpux_major_release = -1;
-
+#ifdef __hpux
   if (hpux_major_release == -1)
     {
       struct utsname x;
@@ -147,7 +149,9 @@ get_hpux_major_release (void)
       p = strchr (x.release, '.');
       hpux_major_release = p ? atoi (p + 1) : 0;
     }
-
+#else
+  hpux_major_release = 0;
+#endif
   return hpux_major_release;
 }
 




More information about the Gdb-patches mailing list