🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #2590

Re: cygwin gdb does not pass along exported enviornment variables

#2590
From: Andrew Cagney
Date: Wed, 06 Mar 2002 23:32
37 lines
2685 bytes
Hello,

Can you file a bug report explaining this?  See 
http://sources.redhat.com/gdb/bugs/

Andrew

> gill_bates@hotmail.com (Gill Bates) wrote in message news:<8e6815bd.0203052011.4d0e2c0f@posting.google.com>...
> 
>> Does anyone know why the cygwin version of gdb doesn't pass exported
>> variables to the program being debugged? I have a simple test case
>> where the program can retrieve an environment variable via getenv().
>> The program works when NOT running with gdb. If I run the same
>> executable with gdb, either window or non-window mode, the same
>> variable is not defined -- not retrievable via getenv().
>> 
>> Thanks for any help!!
>> 
>> 
> 
> 
> OK;  mystery mostly solved...
> After much arduous debugging gdb using gdb (that was pretty weird and
> confusing...), I found the function 'child_create_inferior (char
> *exec_file, char *allargs, char **env)' in win32-nat.c was building
> the env string correctly then passed it to the win32api CreateProcess.
> It appears the win32 function is 'limited' to the number of env
> variables it will accept and will silently discard any that are beyond
> this undocumented limit. Anyone know what the number is? I thought
> not... In any case, the problem appears to be isolated to this bogus
> win32 api function. But; it leaves me wondering how the cygwin exec
> function gets around the dilemma. What I plan to do is dump the
> variables into a file, then suck them into the exec'ed program and
> define them using putenv()...
> 
> Thanks for the HELP!!!
> 
Technical Details
Message-ID: <3C86A723.5020700@cygnus.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.frii.com!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb
References: <8e6815bd.0203052011.4d0e2c0f@posting.google.com> <8e6815bd.0203061502.650502b3@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,9088e1c11f9b4cc2
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 2002-03-06 15:33:14 PST
x-uunet-gateway: mr0.ash.ops.us.uu.net from bug-gdb to gnu.gdb.bug; Wed, 6 Mar 2002 23:33:10 GMT
Message-ID: <3C86A723.5020700@cygnus.com>
Date: Wed, 06 Mar 2002 18:32:51 -0500
From: ac131313@cygnus.com (Andrew Cagney)
User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.8) Gecko/20020210
X-Accept-Language: en-us
MIME-Version: 1.0
Subject: Re: cygwin gdb does not pass along exported enviornment variables
References: <8e6815bd.0203052011.4d0e2c0f@posting.google.com>
 <8e6815bd.0203061502.650502b3@posting.google.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Approved: bug-gdb-request@mail.gnu.org
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.frii.com!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb
Sender: bug-gdb-request@mail.gnu.org
Lines: 39