[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ptp-dev] Question about examining launch config. attributes
|
Greg
I'm looking for a way to get a reference to the ILaunchManager object. It
looks like the only way I can get this reference is if I was in a class
extending AbstractLaunchConfigurationTab. The ResourceTab class, which
invokes my PERMLaunchConfigurationDynamicTab would work, but I have no
access to the ResourceTab object from within my class.
If I get back null when I try to retrieve the environmentVariables
attribute, I don't think that is a problem. I think that tells me that the
user has not set any environment variables in the environment tab of the
launch configuration, and I therefore don't have a conflict with settings
in my resource tab and what's set in the environment tab.
This does not give me access to environment variables that are set by the
user before invoking Eclipse, such as in a .profile or .bashrc. I'm not
sure I want to catch those and raise an error, since that forces the user
to either change his environment setup scripts or chick the option on the
environment tab telling Eclipse to only pass the environment variables set
in the environment tab.
The other option is for me to pull out the code that is checking
environment variables and command line options for PE options and
environment variables, since I'm being overly protective and restrictive
of users running in basic mode, and since I probably don't want to prevent
a user from using the environment setup script, which might have been
given to the user by his sysadmins.
Dave
Greg Watson <g.watson@xxxxxxxxxxxx>
Sent by: ptp-dev-bounces@xxxxxxxxxxx
12/13/2007 02:13 PM
Please respond to
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
To
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
cc
Subject
Re: [ptp-dev] Question about examining launch config. attributes
Dave,
According the comment associated with envronmentVariables attribute:
/**
* Launch configuration attribute name. The value is a
map of
environment
* variables passed into Runtime.exec(...) when a launch
configuration is launched.
* Default value is <code>null</code> which indicates the
default
environment
* should be used.
*
So it seems like this could be null, which will probably result in
behavior you don't want.
I think you probably want to use ILaunchManager.getEnvironment() or
ILaunchManager.getNativeEnvironment().
Greg
On Dec 11, 2007, at 10:48 AM, Dave Wootton wrote:
> I'm working on code which will ensure that when a user is running my
> PE
> proxy in basic mode (where he fills in widgets to set PE options)
> that he
> has not set any PE environment variables, which all start with 'MP_'
> or
> specified any PE command line options. My intent in disallowing
> these is
> to avoid problems where a command line option or environment
> variable is
> set and that setting conflicts with values entered in the resources
> tab of
> the launch configuration.
>
> I've found that I can do this by retrieving the
> "org.eclipse.debug.core.environmentVariables" attribute as a Map and
> by
> retrieving the "org.eclipse.ptp.launch.ARGUMENT_ATTR" attribute as a
> string and examining those. This works, but I want to know if I will
> run
> into problems in the future by doing this.
>
> Thanks
>
> Dave
> _______________________________________________
> ptp-dev mailing list
> ptp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ptp-dev
>
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev