SBEnvironment#
- class lldb.SBEnvironment(*args)#
Represents the environment of a certain process.
Example:
for entry in lldb.debugger.GetSelectedTarget().GetEnvironment().GetEntries(): print(entry)
Methods Summary
Clear
()Delete all the environment variables.
Get
(name)Return the value of a given environment variable.
Return all environment variables contained in this object. Each variable is returned as a string with the following format name=value.
GetNameAtIndex
(index)Return the name of the environment variable at a given index from the internal list of environment variables.
- rtype:
int
GetValueAtIndex
(index)Return the value of the environment variable at a given index from the internal list of environment variables.
PutEntry
(name_and_value)Add or replace an existing environment variable. The input must be a string with the format name=value.
Set
(name, value, overwrite)Set the value of a given environment variable.
SetEntries
(entries, append)Update this object with the given environment variables.
Unset
(name)Unset an environment variable if exists.
Methods Documentation
- Clear()#
Delete all the environment variables.
- Get(name)#
Return the value of a given environment variable.
- Parameters:
[in] – name The name of the environment variable.
- Return type:
string
- Returns:
The value of the environment variable or null if not present. If the environment variable has no value but is present, a valid pointer to an empty string will be returned.
- GetEntries()#
Return all environment variables contained in this object. Each variable is returned as a string with the following format
name=value
- Return type:
- Returns:
Return an lldb::SBStringList object with the environment variables.
- GetNameAtIndex(index)#
Return the name of the environment variable at a given index from the internal list of environment variables.
- Parameters:
[in] – index The index of the environment variable in the internal list.
- Return type:
string
- Returns:
The name at the given index or null if the index is invalid.
- GetNumValues()#
- Return type:
int
- Returns:
The number of environment variables.
- GetValueAtIndex(index)#
Return the value of the environment variable at a given index from the internal list of environment variables.
- Parameters:
[in] – index The index of the environment variable in the internal list.
- Return type:
string
- Returns:
The value at the given index or null if the index is invalid. If the environment variable has no value but is present, a valid pointer to an empty string will be returned.
- PutEntry(name_and_value)#
Add or replace an existing environment variable. The input must be a string with the format
name=value
- Parameters:
[in] – name_and_value The entry to set which conforms to the format mentioned above.
- Set(name, value, overwrite)#
Set the value of a given environment variable. If the variable exists, its value is updated only if overwrite is true.
- Parameters:
[in] – name The name of the environment variable to set.
[in] – value The value of the environment variable to set.
[in] – overwrite Flag that indicates whether to overwrite an existing environment variable.
- Return type:
boolean
- Returns:
Return whether the variable was added or modified.
- SetEntries(entries, append)#
Update this object with the given environment variables. The input is a list of entries with the same format required by SBEnvironment::PutEntry.
If append is false, the provided environment will replace the existing environment. Otherwise, existing values will be updated of left untouched accordingly.
- Parameters:
[in] – entries The environment variable entries.
[in] – append Flag that controls whether to replace the existing environment.
- Unset(name)#
Unset an environment variable if exists.
- Parameters:
[in] – name The name of the environment variable to unset.
- Return type:
boolean
- Returns:
Return whether a variable was actually unset.