Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] win32-nat.c: Simplify generation of Windows environment
Date: Fri, 08 Dec 2006 08:57:00 -0000	[thread overview]
Message-ID: <20061208085719.GB9829@calimero.vinschen.de> (raw)
In-Reply-To: <m33b7rh4fx.fsf@codesourcery.com>

On Dec  7 11:49, Jim Blandy wrote:
> Corinna Vinschen <vinschen@redhat.com> writes:
> > the below patch simplifies the code which translates the Cygwin
> > environment into the native Windows environment.  So far this is
> > done in GDB manually.  However, there's a Cygwin specific function
> > call which does the same for the calling process.  Using this call
> > has three advantages.
> >
> > - We can drop a rather big chunk of code from GDB which should be the
> >   task of Cygwin anyway.
> > - By using the Cygwin method of converting the environment, we take
> >   care of all environment variables which have to be converted in
> >   some way; not only the PATH variable, but all variables which are
> >   also translated by Cygwin, thus making this process more transparent.
> > - Subsequent changes in Cygwin don't require to change GDB.
> >
> >
> > Ok to apply?
> 
> I'm very much inclined to take your advice on Cygwin-related issues,
> and I love the deletion of code, but I still have some questions:
> 
> Is it really okay to call cygwin_internal?  (That's not the name I'd
> expect a public, stable interface to have.)

cygwin_internal is a stable interface existing for a lot of years.  It's
supposed to provide an interface to Cygwin internal functionality which
is not covered by any "official" POSIX/Linux/BSD API.  Functionality is
never removed from this function.

It's used already for quite some time in gdb:

$ grep -n cygwin_internal win32-nat.c
1738:      pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid);
1813:  cygwin_internal (CW_LOCK_PINFO, 1000);
1816:   cygwin_internal (CW_GETPINFO, cpid | CW_NEXTPID));
1826:  cygwin_internal (CW_UNLOCK_PINFO);

> How well will this work on older versions of Cygwin?  Will people
> still be able to compile GDB against the Cygwin versions they can now?

The interface exists since at least 1999, but CW_SYNC_WINENV has been
introduced in February 2006.  This requires at least Cygwin 1.5.21,
which is the version before the current version.  I didn't expect that
we're trying to support old Cygwin versions in new GDB versions,
though.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


  reply	other threads:[~2006-12-08  8:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-07  9:58 Corinna Vinschen
2006-12-07 16:35 ` Corinna Vinschen
2006-12-07 19:48 ` Jim Blandy
2006-12-08  8:57   ` Corinna Vinschen [this message]
2006-12-07 21:37 ` Eli Zaretskii
2006-12-08  0:09   ` Jim Blandy
2006-12-08  7:31     ` Eli Zaretskii
2006-12-08  9:12       ` Corinna Vinschen
2006-12-08 11:31         ` Eli Zaretskii
2006-12-08 12:05           ` Corinna Vinschen
2006-12-09  8:01       ` Jim Blandy
2006-12-08 20:43   ` Christopher Faylor
2006-12-09  9:15     ` Corinna Vinschen

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=20061208085719.GB9829@calimero.vinschen.de \
    --to=vinschen@redhat.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