Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GetProcessEnvironment command to diagnostics server #40556

Merged
merged 12 commits into from
Aug 14, 2020
6 changes: 3 additions & 3 deletions src/tests/tracing/eventpipe/processinfo/processinfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static int Main(string[] args)
string envKey = "TESTKEY";
string envVal = "TESTVAL";
System.Environment.SetEnvironmentVariable(envKey, envVal);
josalem marked this conversation as resolved.
Show resolved Hide resolved
System.Environment.SetEnvironmentVariable("foo", "");
josalem marked this conversation as resolved.
Show resolved Hide resolved

Stream stream = ConnectionHelper.GetStandardTransport(pid);

Expand Down Expand Up @@ -214,9 +215,8 @@ public static int Main(string[] args)
end = start + ((int)pairLength * sizeof(char));
Utils.Assert(end <= totalSize, $"String end can't exceed payload size. Expected: <{totalSize}, Received: {end} (decoded length: {pairLength})");
string envPair = System.Text.Encoding.Unicode.GetString(response.Payload[start..end]).TrimEnd('\0');
string[] parts = envPair.Split('=');
string value = string.Join('=', parts[1..]);
env[parts[0]] = value;
int equalsIndex = envPair.IndexOf('=');
env[envPair[0..equalsIndex]] = envPair[(equalsIndex+1)..];
}
Logger.logger.Log($"finished parsing env");

Expand Down