Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Kai.Tietz@onevision.com, gdb@sourceware.org
Subject: Re: Support of gdb for Windows 64 native systems
Date: Sat, 13 Oct 2007 10:48:00 -0000	[thread overview]
Message-ID: <uk5prl27s.fsf@gnu.org> (raw)
In-Reply-To: <20071013024116.GB29152@adacore.com> (message from Joel Brobecker 	on Fri, 12 Oct 2007 19:41:16 -0700)

> Date: Fri, 12 Oct 2007 19:41:16 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Kai.Tietz@onevision.com, gdb@sourceware.org
> 
> I'm attaching a rough sketch of the changes I think are needed
> to adapt the cygwin port to also support mingw.

Thanks!

> It turns out that there are more changes that I was claiming.

I'm not surprised, in particular because I've seen the patches applied
by the MinGW folks to produce a native MinGW port.  Personally, I
still think that at this magnitude of ifdef'ing we can certainly
justify two different targets.  But this is not my call, and the
prospects of finally having MinGW support part of the official
repository are so thrilling for me that I'd hate if this argument
would stand in the way.  IOW, let's have MinGW support in the CVS, and
argue about separation later!

What follows are some more or less random comments on the patch; HTH.

> > > >     #ifdef __MINGW32__
> > > >       #define MAXPATHLEN PATH_MAX
> > > >     #endif
> > > 
> > > This, for example, is strictly speaking wrong on Windows: Windows
> > > supports much longer file names (up to 32K), if you use Unicode APIs.
> > 
> > You are probably correct, I really know very little about Windows.
> 
> This, I still haven't fixed, because I don't know what the proper
> thing to do is. What do you think I should use on Windows? I'll
> happily fix it.

Well, I don't think you should do anything with the issue of
supporting longer file names, because I'm quite sure there are lots of
problems with that elsewhere in GDB.  I believe GDB currently can only
support UTF-8 encoded file names, whereas Windows filesystems use
UTF-16.  Adding support for Windows non-ASCII file names to GDB will
need much more work.

However, I'm surprised you needed to define MAXPATHLEN at all, since
sys/param.h in the MinGW headers already does that.  Can you tell why
you need this, and after including sys/param.h on top of that?

>  #include <sys/param.h>
> +#ifdef __MINGW32__
> +  #define MAXPATHLEN PATH_MAX
> +#endif

What am I missing here?  Are you perhaps targeting some old MinGW
versions that didn't have that in sys/param.h?

> +#ifndef HAVE_CYGWIN_CONV_TO_POSIX_PATH
> +/* A basic replacement implementation for cygwin_conv_to_posix_path ()
> +   when not available (basically, when building using a MinGW compiler).  */
> +
> +static void
> +cygwin_conv_to_posix_path (const char *path, char *posix_path)
> +{
> +  strcpy (posix_path, path);
> +}
> +#endif
> +
> +#ifndef HAVE_CYGWIN_CONV_TO_WIN32_PATH
> +/* A basic replacement implementation for cygwin_conv_to_win32_path ()
> +   when not available (basically, when building using a MinGW compiler).  */
> +static void
> +cygwin_conv_to_win32_path (const char *path, char *win32_path)
> +{
> +  strcpy (win32_path, path);
> +}
> +#endif

I hope these will be eventually rewritten to do something useful,
otherwise that's a gratuitous ugliness.

> +#ifdef _WIN32
> +  /* The executable must not be closed because it will not been possible to
> +     reopen it later under Windows NT if this executable is the one being
> +     debugged. */
> +
> +  if (strstr (name, ".exe") != NULL)
> +    sym_bfd->cacheable = FALSE;
> +  else
> +#endif

Doesn't Cygwin define _WIN32?  If it does, why do you need to
condition this fragment?


  reply	other threads:[~2007-10-13 10:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071011142348.GA18239@caradoc.them.org>
2007-10-11 14:47 ` Kai Tietz
     [not found]   ` <20071011145549.GA19918@caradoc.them.org>
2007-10-11 16:01     ` Joel Brobecker
2007-10-12  3:38       ` Christopher Faylor
2007-10-12  4:27         ` Joel Brobecker
2007-10-11 16:37     ` Mark Kettenis
2007-10-12  7:19     ` Kai Tietz
2007-10-12  8:44     ` Eli Zaretskii
2007-10-12 16:11       ` Joel Brobecker
2007-10-12 16:51         ` Eli Zaretskii
2007-10-12 17:45           ` Joel Brobecker
2007-10-12 20:29             ` Eli Zaretskii
2007-10-12 22:28               ` Joel Brobecker
2007-10-13  2:41                 ` Joel Brobecker
2007-10-13 10:48                   ` Eli Zaretskii [this message]
2007-10-13 15:47                     ` Joel Brobecker
2007-10-13 17:05                       ` Christopher Faylor
2007-10-13 17:36                       ` Pedro Alves
2007-10-13 19:09                         ` Eli Zaretskii
2007-10-13 19:19                           ` Pedro Alves
2007-10-13 20:51                         ` Joel Brobecker
2007-10-13 22:52                           ` Pedro Alves
2007-10-14  5:16                             ` Joel Brobecker
2007-10-14 11:44                               ` Pedro Alves
2007-10-14 20:33                                 ` Eli Zaretskii
2007-10-12 17:38         ` Pedro Alves
2007-10-11 13:53 Kai Tietz
2007-10-11 14:05 ` Daniel Jacobowitz
2007-10-11 14:18   ` Kai Tietz

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=uk5prl27s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=Kai.Tietz@onevision.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@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