Allow variables to reference other variables in other layers
This commit is contained in:
parent
be55649470
commit
d8d22b15bc
2 changed files with 6 additions and 4 deletions
|
|
@ -113,9 +113,11 @@ class DebugSession( object ):
|
||||||
'gadgetDir': install.GetGadgetDir( VIMSPECTOR_HOME, install.GetOS() )
|
'gadgetDir': install.GetGadgetDir( VIMSPECTOR_HOME, install.GetOS() )
|
||||||
}
|
}
|
||||||
self._variables.update(
|
self._variables.update(
|
||||||
utils.ParseVariables( adapter.get( 'variables', {} ) ) )
|
utils.ParseVariables( adapter.get( 'variables', {} ),
|
||||||
|
self._variables ) )
|
||||||
self._variables.update(
|
self._variables.update(
|
||||||
utils.ParseVariables( configuration.get( 'variables', {} ) ) )
|
utils.ParseVariables( configuration.get( 'variables', {} ),
|
||||||
|
self._variables ) )
|
||||||
self._variables.update( launch_variables )
|
self._variables.update( launch_variables )
|
||||||
|
|
||||||
utils.ExpandReferencesInDict( configuration, self._variables )
|
utils.ExpandReferencesInDict( configuration, self._variables )
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,7 @@ def ExpandReferencesInDict( obj, mapping, **kwargs ):
|
||||||
obj[ k ] = expand_refs_in_object( obj[ k ] )
|
obj[ k ] = expand_refs_in_object( obj[ k ] )
|
||||||
|
|
||||||
|
|
||||||
def ParseVariables( variables ):
|
def ParseVariables( variables, mapping, **kwargs ):
|
||||||
new_variables = {}
|
new_variables = {}
|
||||||
for n, v in variables.items():
|
for n, v in variables.items():
|
||||||
if isinstance( v, dict ):
|
if isinstance( v, dict ):
|
||||||
|
|
@ -353,7 +353,7 @@ def ParseVariables( variables ):
|
||||||
|
|
||||||
new_v = v.copy()
|
new_v = v.copy()
|
||||||
# Bit of a hack. Allows environment variables to be used.
|
# Bit of a hack. Allows environment variables to be used.
|
||||||
ExpandReferencesInDict( new_v, {} )
|
ExpandReferencesInDict( new_v, mapping, **kwargs )
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env.update( new_v.get( 'env' ) or {} )
|
env.update( new_v.get( 'env' ) or {} )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue