From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5457 invoked by alias); 28 Nov 2005 22:26:49 -0000 Received: (qmail 5400 invoked by uid 22791); 28 Nov 2005 22:26:48 -0000 X-Spam-Check-By: sourceware.org Received: from dumbledore.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.11) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 28 Nov 2005 22:26:47 +0000 Received: (qmail 14715 invoked from network); 28 Nov 2005 22:26:40 -0000 Received: from unknown (HELO ?10.253.176.40?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Nov 2005 22:26:40 -0000 Message-ID: <438B8417.2000005@codesourcery.com> Date: Tue, 29 Nov 2005 02:34:00 -0000 From: Mark Mitchell User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Daniel Jacobowitz CC: Mark Kettenis , gdb-patches@sources.redhat.com Subject: Re: PATCH: Make PowerPC simulator compile on MinGW References: <200511170034.jAH0YK2Z017839@sethra.codesourcery.com> <200511170106.jAH16GAh012415@elgar.sibelius.xs4all.nl> <437BDAA3.9040002@codesourcery.com> <20051128193445.GA4829@nevyn.them.org> In-Reply-To: <20051128193445.GA4829@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------050608010809000903060902" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00492.txt.bz2 This is a multi-part message in MIME format. --------------050608010809000903060902 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 851 Daniel Jacobowitz wrote: >>I'm happy to try that on a GNU/Linux box, but how do I prove it in >>general? I'm happy to just take out that #include, if that will help >>move the patch forward. > > Please do try that. I've tested the attached version (identical, except for the bits) by building both i686-pc-linux-gnu x powerpc-eabi and i686-mingw32 x powerpc-eabi debuggers. (The latter was built on an x86-64 GNU/Linux box using an i686-pc-linux-gnu x i686-mingw32 cross compiler.) 2005-11-28 Mark Mitchell * configure.ac (USE_WIN32API): Define it. * configure.in: Regenerate. * config.in: Likewise. * emul_netbsd.c (write_timezone): Guard with HAVE_GETTIMEOFDAY. * emul_unix.c (do_unix_mkdir): Handle Win32 1-argument mkdir. -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com (916) 791-8304 --------------050608010809000903060902 Content-Type: text/plain; name="gdb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb.patch" Content-length: 3270 Index: configure.ac =================================================================== RCS file: /cvs/src/src/sim/ppc/configure.ac,v retrieving revision 1.3 diff -c -5 -p -r1.3 configure.ac *** configure.ac 20 Apr 2005 14:43:55 -0000 1.3 --- configure.ac 28 Nov 2005 22:06:24 -0000 *************** fi],[sim_xor_endian=""])dnl *** 565,574 **** --- 565,584 ---- AC_CANONICAL_SYSTEM AC_ARG_PROGRAM . ${srcdir}/../../bfd/configure.host + case ${host} in + *mingw32*) + AC_DEFINE(USE_WIN32API, 1, + [Define if we should use the Windows API, instead of the + POSIX API. On Windows, we use the Windows API when + building for MinGW, but the POSIX API when building + for Cygwin.]) + ;; + esac + AC_CONFIG_HEADER(config.h:config.in) AC_STRUCT_ST_BLKSIZE AC_STRUCT_ST_BLOCKS AC_STRUCT_ST_RDEV Index: emul_netbsd.c =================================================================== RCS file: /cvs/src/src/sim/ppc/emul_netbsd.c,v retrieving revision 1.5 diff -c -5 -p -r1.5 emul_netbsd.c *** emul_netbsd.c 24 Sep 2004 18:39:41 -0000 1.5 --- emul_netbsd.c 28 Nov 2005 22:06:24 -0000 *************** *** 41,51 **** #include #include #include #include #include - #include #include #include #ifdef HAVE_GETRUSAGE #ifndef HAVE_SYS_RESOURCE_H --- 41,50 ---- *************** write_timeval(unsigned_word addr, *** 222,243 **** H2T(t.tv_sec); H2T(t.tv_usec); emul_write_buffer(&t, addr, sizeof(t), processor, cia); } ! STATIC_INLINE_EMUL_NETBSD void write_timezone(unsigned_word addr, struct timezone tz, cpu *processor, unsigned_word cia) { H2T(tz.tz_minuteswest); H2T(tz.tz_dsttime); emul_write_buffer(&tz, addr, sizeof(tz), processor, cia); } ! #ifdef HAVE_GETDIRENTRIES STATIC_INLINE_EMUL_NETBSD void write_direntries(unsigned_word addr, char *buf, --- 221,242 ---- H2T(t.tv_sec); H2T(t.tv_usec); emul_write_buffer(&t, addr, sizeof(t), processor, cia); } ! #ifdef HAVE_GETTIMEOFDAY STATIC_INLINE_EMUL_NETBSD void write_timezone(unsigned_word addr, struct timezone tz, cpu *processor, unsigned_word cia) { H2T(tz.tz_minuteswest); H2T(tz.tz_dsttime); emul_write_buffer(&tz, addr, sizeof(tz), processor, cia); } ! #endif #ifdef HAVE_GETDIRENTRIES STATIC_INLINE_EMUL_NETBSD void write_direntries(unsigned_word addr, char *buf, Index: emul_unix.c =================================================================== RCS file: /cvs/src/src/sim/ppc/emul_unix.c,v retrieving revision 1.1.1.1 diff -c -5 -p -r1.1.1.1 emul_unix.c *** emul_unix.c 16 Apr 1999 01:35:09 -0000 1.1.1.1 --- emul_unix.c 28 Nov 2005 22:06:24 -0000 *************** do_unix_mkdir(os_emul_data *emul, *** 728,738 **** --- 728,742 ---- int status; if (WITH_TRACE && ppc_trace[trace_os_emul]) printf_filtered ("0x%lx [%s], 0%3o", (long)path_addr, path, mode); + #ifdef USE_WIN32API + status = mkdir(path); + #else status = mkdir(path, mode); + #endif emul_write_status(processor, status, errno); } #endif #ifndef HAVE_RMDIR --------------050608010809000903060902--