Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] Support for specifying Environment from Launch Configurations...

Hi,

We are actually thinking that the utility of Environment Support extends
outside the debugger.  For example within the CDT there are at least 2
other places besides debug that we need Environment Support:  Building a
"C/C++ Project", and running arbitrary commands (we provide mechanisms for
a user to run arbitrary commands in a shell-like manner).  Both of these
situations require control over the execution environment.  Also it is not
hard to imagine that other teams will have similar requirements (for
example plugins that launch external tools like daemons, web-servers, or
other programs which can depend on Environment Variables).  So I am
currently updating the design document and will subsequently post on
platform-dev to see if there is any interest.

>Question: Your document correctly points out that the environment cannot
be directly
>modified by a Java program, but it also states that as part of the CDT
startup
>process, the "read-only" environment is queried. How do you perform this
query?
>Looking at the JavaDoc for java.lang.System.getEnv(...), there is also no
way to
>retrieve the environment from a Java program.

Yes it's not pretty...java provides no access to variables other than those
defined with -D at the jvm invocation.  So we do this in a "system-aware"
way.  We use Runtime.exec() to do either a "sh -c env" on Linux (and other
Unix-variants) or "cmd /c set" on Windows.  Then we parse the output into
Environment Variables.  Like I say it is not ideal, but we have had success
with that approach so far.

============================
  Jeff Turnham
  Linux Application Development
  IBM Toronto Lab, D2-328
  (905) 413-4319
============================


                                                                                                                               
                    Darin_Wright@xxxxxxx                                                                                       
                    Sent by:                         To:     platform-debug-dev@xxxxxxxxxxx                                    
                    platform-debug-dev-admin@e       cc:                                                                       
                    clipse.org                       Subject:     Re: [platform-debug-dev] Support for specifying Environment  
                                                      from Launch Configurations...                                            
                                                                                                                               
                    04/30/2002 11:15 AM                                                                                        
                    Please respond to                                                                                          
                    platform-debug-dev                                                                                         
                                                                                                                               
                                                                                                                               




Providing environment support in a generic, re-useable location would be
beneficial. The obvious location for environments is in the debug core
(however, this would not be a 2.0 feature, as time has run out for new
features). Environments are not applicable to every type of launch
configuration, so I envision the following support:

(1) A way to define/persist environments by name (in
org.eclipse.debug.core)
(2) A way to manipulate environments by the user (in org.eclipse.debug.ui)
(3) A re-useable launch configuration tab for choosing/editing environments
(in org.eclipse.debug.ui)

With this breakdown, launch configurations that support environments could
simply re-use the appropriate tab.

Question: Your document correctly points out that the evironment cannot be
directly modified by a Java program, but it also states that as part of the
CDT startup process, the "read-only" environment is queried. How do you
perform this query? Looking at the JavaDoc for java.lang.System.getEnv
(...), there is also no way to retrieve the envrionment from a Java
program.


Darin


                                                                           
   turnham@xxxxxxxxxx                                                      
   Sent by:                       To:                                      
   platform-debug-dev-adm platform-debug-dev@xxxxxxxxxxx                   
   in@xxxxxxxxxxx                 cc:                                      
                                  Subject:        [platform-debug-dev]     
                          Support for specifying Environment from Launch   
   04/26/2002 10:36 AM    Configurations...                                
   Please respond to                                                       
   platform-debug-dev                                                      
                                                                           




Hi All,

I've created an initial design proposal for uniformly handling Environment
Variables across various functions in the CDT (C/C++ Development Tools),
such as building, running arbitrary commands, and debugging and am
wondering if this would have value for other teams.  .A user can create
named Environments that contain Environment Variables and override other
Environments (such as the default System Environment that was present when
the user started Eclipse).  Then in the various places the user simply
chooses which named Environment should be applied to the given action.
Here is the link to the document:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/cdt-core-home/designs/environment_proposal.html?cvsroot=Tools_Project


The questions are:
1.  Are other teams currently implementing something similar?
2.  Does it make sense to add some sort of support for this feature to
Launch Configurations?

I'm not very familiar with the Launch Configuration stuff, so I'm not
really sure the best way this sort of thing would be supported, if at all.
I defer to the experts ;-)

Thanks...

============================
 Jeff Turnham
 Linux Application Development
 IBM Toronto Lab, D2-328
 (905) 413-4319
============================


_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-debug-dev






Back to the top