From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25125 invoked by alias); 7 Jan 2009 11:30:48 -0000 Received: (qmail 25113 invoked by uid 22791); 7 Jan 2009 11:30:47 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jan 2009 11:30:43 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id n07BUdLQ008322; Wed, 7 Jan 2009 12:30:39 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id n07BUctK004303; Wed, 7 Jan 2009 12:30:38 +0100 (CET) Date: Wed, 07 Jan 2009 11:30:00 -0000 Message-Id: <200901071130.n07BUctK004303@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: brobecker@adacore.com CC: gdb-patches@sourceware.org In-reply-to: <20090107105848.GM3664@adacore.com> (message from Joel Brobecker on Wed, 7 Jan 2009 14:58:48 +0400) Subject: Re: some news about the x86_64-windows port... References: <20090107105848.GM3664@adacore.com> 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: 2009-01/txt/msg00081.txt.bz2 > Date: Wed, 7 Jan 2009 14:58:48 +0400 > From: Joel Brobecker > > context_offset (FloatSave.ErrorSelector), > context_offset (FloatSave.ErrorOffset), > context_offset (FloatSave.DataSelector), > context_offset (FloatSave.DataOffset), > context_offset (FloatSave.ErrorSelector) > > These entries are supposed to be the offset of the following > registers in the CONTEXT structure: > > "fiseg", "fioff", "foseg", "fooff", "fop", > > I couldn't find what these registers are about, so I cheated and > used the sources that Kai sent me. I have no idea whether this > is correct or not. These registers are part of the FPU state, and set whenever a floating-point exception happens. Judging from the names that bit of code is right. And it would be very hard to claim copyright over those five lines, so I wouldn't worry too much about issues there. > +++ b/gdb/amd64-windows-tdep.c > @@ -0,0 +1,41 @@ > +/* Copyright (C) 2009 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#include "defs.h" > +#include "osabi.h" > +#include "amd64-tdep.h" > +#include "solib.h" > +#include "solib-target.h" > + > +static void > +amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) > +{ > + amd64_init_abi (info, gdbarch); > + > + /* On Windows, "long"s are only 32bit. */ > + set_gdbarch_long_bit (gdbarch, 32); I wouldn't mind a comment how utterly retarded the choice made by Microsoft is ;). > index bceba76..1badecf 100644 > --- a/gdb/config.in > +++ b/gdb/config.in > @@ -175,6 +175,9 @@ > /* Define to 1 if you have the header file. */ > #undef HAVE_INTTYPES_H > > +/* Define to 1 if you have the `kill' function. */ > +#undef HAVE_KILL > + See my comment below. > +/* Define to 1 if host is LLP64 (pointers is 64bits and "long" is32bits) */ > +#undef HOST_IS_LLP64 I think there are more elegant ways to handle Microsoft's retarded "64-bit" ABI. > --- /dev/null > +++ b/gdb/config/i386/nm-cygwin64.h > @@ -0,0 +1,36 @@ > +/* Copyright 2008, 2009 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#define ADD_SHARED_SYMBOL_FILES dll_symbol_command > +void dll_symbol_command (char *, int); At some point we should find a more elegant solution for this, but I guess this is ok for now. > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -774,7 +774,7 @@ AC_FUNC_ALLOCA > AC_FUNC_MMAP > AC_FUNC_VFORK > AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \ > - getgid poll pread64 sbrk setpgid setpgrp setsid \ > + getgid kill poll pread64 sbrk setpgid setpgrp setsid \ > sigaction sigprocmask sigsetmask socketpair syscall \ > ttrace wborder setlocale]) Why the hell do we need to add a check for a function defined by ISO C90? > --- a/gdb/defs.h > +++ b/gdb/defs.h > @@ -132,6 +132,17 @@ typedef bfd_vma CORE_ADDR; > > #endif /* ! LONGEST */ > > +/* Define an integer type that has the same size as a pointer type. > + It is sometimes necessary to cast a pointer to an integer type > + (for instance to perform bitwise operations on it), and we need > + to use an integer type that has the same size as the pointer > + to prevent an error message from GCC. */ > +#ifdef HOST_IS_LLP64 > +typedef long long ptr_int_t; > +#else > +typedef long ptr_int_t; > +#endif Instead of adding this type, can't you simply use intptr_t/uintptr_t? > --- a/gdb/event-top.c > +++ b/gdb/event-top.c > @@ -50,6 +50,14 @@ static void change_line_handler (void); > static void change_annotation_level (void); > static void command_handler (char *command); > > +#if defined (SIGHUP) && !defined (HAVE_KILL) > +/* On x86_64-windows, MingW's signal.h defines SIGHUP but does not > + provide "kill". However, the code that uses SIGHUP below also > + uses kill. So, if kill is not available, pretend SIGHUP isn't > + either. */ > +#undef SIGHUP > +#endif This must be a bug in MingW. Please tell the MingW people that in 2008 they manage to ship an environment that doesn't even implement ISO C90 correctly. If they fix it (or have already fixed it) is it really necessary to add this ugly workaround?