🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #2589

Re: cygwin gdb does not pass along exported enviornment variables

#2589
From: Gill Bates
Date: Wed, 06 Mar 2002 23:03
27 lines
2593 bytes
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: <8e6815bd.0203061502.650502b3@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sunqbc.risq.qc.ca!newspeer.monmouth.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!not-for-mail
References: <8e6815bd.0203052011.4d0e2c0f@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f5053,9088e1c11f9b4cc2
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 2002-03-06 15:03:14 PST
x-uunet-gateway: sjc3sosrv11.alter.net from bug-gdb to gnu.gdb.bug; Wed, 6 Mar 2002 23:03:11 GMT
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sunqbc.risq.qc.ca!newspeer.monmouth.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!not-for-mail
From: gill_bates@hotmail.com (Gill Bates)
Subject: Re: cygwin gdb does not pass along exported enviornment variables
Date: 6 Mar 2002 15:03:01 -0800
Organization: http://groups.google.com/
Message-ID: <8e6815bd.0203061502.650502b3@posting.google.com>
References: <8e6815bd.0203052011.4d0e2c0f@posting.google.com>
NNTP-Posting-Host: 24.94.114.18
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1015455781 1031 127.0.0.1 (6 Mar 2002 23:03:01 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 6 Mar 2002 23:03:01 GMT
Approved: bug-gdb-request@mail.gnu.org
Newsgroups: gnu.gdb.bug
Sender: bug-gdb-request@mail.gnu.org
Lines: 27