Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: brobecker@adacore.com
Cc: gdb-patches@sourceware.org
Subject: Re: some news about the x86_64-windows port...
Date: Wed, 07 Jan 2009 11:30:00 -0000	[thread overview]
Message-ID: <200901071130.n07BUctK004303@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <20090107105848.GM3664@adacore.com> (message from Joel Brobecker 	on Wed, 7 Jan 2009 14:58:48 +0400)

> Date: Wed, 7 Jan 2009 14:58:48 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> 
>   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 <http://www.gnu.org/licenses/>.  */
> +
> +#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 <inttypes.h> 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 <http://www.gnu.org/licenses/>.  */
> +
> +#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?


  reply	other threads:[~2009-01-07 11:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 10:59 Joel Brobecker
2009-01-07 11:30 ` Mark Kettenis [this message]
2009-01-07 12:21   ` Andreas Schwab
2009-01-07 12:30     ` Mark Kettenis
2009-01-07 16:54 ` Christopher Faylor
2009-01-08 10:31   ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200901071130.n07BUctK004303@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox