From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23466 invoked by alias); 10 Sep 2010 14:11:46 -0000 Received: (qmail 23457 invoked by uid 22791); 10 Sep 2010 14:11:45 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Sep 2010 14:11:40 +0000 Received: from md1.u-strasbg.fr (md1.u-strasbg.fr [IPv6:2001:660:2402::186]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o8AEBbhT063330 for ; Fri, 10 Sep 2010 16:11:37 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms8.u-strasbg.fr [IPv6:2001:660:2402:d::17]) by md1.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o8AEBbR0049597 for ; Fri, 10 Sep 2010 16:11:37 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o8AEBbGP029327 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 10 Sep 2010 16:11:37 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA 5/5] New patches to support --enable-targets=all for mingw64 Date: Fri, 10 Sep 2010 15:43:00 -0000 Message-ID: <004201cb50f2$18d8f310$4a8ad930$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00223.txt.bz2 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 * 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 +#endif #include #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; }