[lazarus] Display option problem..

Jesus Reyes jesusrmx at yahoo.com.mx
Fri Aug 1 16:46:27 EDT 2003



Sorry, the email thread was stored in other computer, 

{
Don't think so. But somewhere the DISPLAY variable is lost.
Maybe you want to find out yourself:
The environment variables are given to the debugger in
debugmanager.pas line 1338:
Project1.RunParameterOptions.AssignEnvironmentTo(FDebugger.Environment);
You can add a writeln(FDebugger.Environment.Text); to see the
variables.
If you follow the AssignEnvironmentTo with "find declaration" you
will see,
that there is not much code in there. It fetches the current env vars
and
replaces the overrides.
The debugger creates a TProcess and assigns the variables to it in 
debugger/cmdlinedebugger.pp line 180.
Just add a few writelns to find out, where the DISPLAY variable is
lost.
Mattias
}

I tried that. 

It seems that when the Fdebugger creates the debugger process (the
first time the program is about to run) the environment (FEnviroment)
is empty (doRunProject->doInitProjectRun->doInitDebugger->
fDebugger:=TgdbMiDebuger.create [0]) and this value is used in the
CreateProcess call (deep into fDebugger.Init).

After that the call
Project1.RunParameterOptions.AssignEnvironmentTo(FDebugger.Environment);
[1]
tries to update the environment but it only assign to
FDebugger.FEnviroment.

It seems that this value (I can confirm that it is the wished
environment) is never propagated? to the debugger running process
before running the application. The application doesn't receive the
intended enviroment in my case, I added the following line to the
application code:

WriteLn('DISPLAY env var= ', GetEnvironmentVariable('DISPLAY'));

it should display: DISPLAY env var= quimica:0.0 but it gives: DISPLAY
env var= :0.0

in next runs [0] doesn't get called and before and after the [1] call
 the enviroment that shows it's ok, so I think it is just not
propagated? to the running debugger process but I'm not sure.

regards.

Jesus Reyes A.

_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx






More information about the Lazarus mailing list