Skip to content

Commit 5366510

Browse files
authored
Merge main into release branch (#2444)
2 parents f3ffe27 + 8cffa1d commit 5366510

File tree

71 files changed

+2603
-1382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2603
-1382
lines changed

compileoptions.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ if(CLR_CMAKE_PLATFORM_UNIX_ARM)
7979
endif(ARM_SOFTFP)
8080
endif(CLR_CMAKE_PLATFORM_UNIX_ARM)
8181

82+
if(CLR_CMAKE_PLATFORM_FREEBSD)
83+
add_compile_options(-Wno-macro-redefined)
84+
add_compile_options(-Wno-pointer-to-int-cast)
85+
endif(CLR_CMAKE_PLATFORM_FREEBSD)
86+
8287
if (WIN32)
8388
# Compile options for targeting windows
8489

documentation/design-docs/ipc-protocol.md

+60-2
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,10 @@ See: [Profiler Commands](#Profiler-Commands)
376376
```c++
377377
enum class ProcessCommandId : uint8_t
378378
{
379-
ProcessInfo = 0x00,
380-
ResumeRuntime = 0x01,
379+
ProcessInfo = 0x00,
380+
ResumeRuntime = 0x01,
381+
ProcessEnvironment = 0x02,
382+
ProcessInfo2 = 0x04,
381383
// future
382384
}
383385
```
@@ -787,6 +789,62 @@ struct Payload
787789
}
788790
```
789791

792+
> Available since .NET 6.0
793+
794+
### `ProcessInfo2`
795+
796+
Command Code: `0x0404`
797+
798+
The `ProcessInfo2` command queries the runtime for some basic information about the process. The returned payload has the same information as that of the `ProcessInfo` command in addition to the managed entrypoint assembly name and CLR product version.
799+
800+
In the event of an [error](#Errors), the runtime will attempt to send an error message and subsequently close the connection.
801+
802+
#### Inputs:
803+
804+
Header: `{ Magic; Size; 0x0402; 0x0000 }`
805+
806+
There is no payload.
807+
808+
#### Returns (as an IPC Message Payload):
809+
810+
Header: `{ Magic; size; 0xFF00; 0x0000; }`
811+
812+
Payload:
813+
* `int64 processId`: the process id in the process's PID-space
814+
* `GUID runtimeCookie`: a 128-bit GUID that should be unique across PID-spaces
815+
* `string commandLine`: the command line that invoked the process
816+
* Windows: will be the same as the output of `GetCommandLineW`
817+
* Non-Windows: will be the fully qualified path of the executable in `argv[0]` followed by all arguments as the appear in `argv` separated by spaces, i.e., `/full/path/to/argv[0] argv[1] argv[2] ...`
818+
* `string OS`: the operating system that the process is running on
819+
* macOS => `"macOS"`
820+
* Windows => `"Windows"`
821+
* Linux => `"Linux"`
822+
* other => `"Unknown"`
823+
* `string arch`: the architecture of the process
824+
* 32-bit => `"x86"`
825+
* 64-bit => `"x64"`
826+
* ARM32 => `"arm32"`
827+
* ARM64 => `"arm64"`
828+
* Other => `"Unknown"`
829+
* `string managedEntrypointAssemblyName`: the assembly name from the assembly identity of the entrypoint assembly of the process. This is the same value that is returned from executing `System.Reflection.Assembly.GetEntryAssembly().GetName().Name` in the target process.
830+
* `string clrProductVersion`: the product version of the CLR of the process; may contain prerelease label information e.g. `6.0.0-preview.6.#####`
831+
832+
##### Details:
833+
834+
Returns:
835+
```c++
836+
struct Payload
837+
{
838+
uint64_t ProcessId;
839+
LPCWSTR CommandLine;
840+
LPCWSTR OS;
841+
LPCWSTR Arch;
842+
GUID RuntimeCookie;
843+
LPCWSTR ManagedEntrypointAssemblyName;
844+
LPCWSTR ClrProductVersion;
845+
}
846+
```
847+
790848
## Errors
791849
792850
In the event an error occurs in the handling of an Ipc Message, the Diagnostic Server will attempt to send an Ipc Message encoding the error and subsequently close the connection. The connection will be closed **regardless** of the success of sending the error message. The Client is expected to be resilient in the event of a connection being abruptly closed.

documentation/diagnostics-client-library-instructions.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,36 @@ public static void PrintEventsLive(int processId)
224224

225225
This sample shows how to attach an ICorProfiler to a process (profiler attach).
226226
```cs
227-
public static int AttachProfiler(int processId, Guid profilerGuid, string profilerPath)
227+
public static void AttachProfiler(int processId, Guid profilerGuid, string profilerPath)
228228
{
229229
var client = new DiagnosticsClient(processId);
230-
return client.AttachProfiler(TimeSpan.FromSeconds(10), profilerGuid, profilerPath);
230+
client.AttachProfiler(TimeSpan.FromSeconds(10), profilerGuid, profilerPath);
231231
}
232232
```
233233

234+
#### 8. Set an ICorProfiler to be used as the startup profiler
234235

236+
This sample shows how to request that the runtime use an ICorProfiler as the startup profiler (not as an attaching profiler). It is only valid to issue this command while the runtime is paused in "reverse server" mode.
237+
238+
```cs
239+
public static void SetStartupProfilerProfiler(Guid profilerGuid, string profilerPath)
240+
{
241+
var client = new DiagnosticsClient(processId);
242+
client.SetStartupProfiler(profilerGuid, profilerPath);
243+
}
244+
```
245+
246+
#### 9. Resume the runtime when it is paused in reverse server mode
247+
248+
This sample shows how a client can instruct the runtime to resume loading after it has been paused in "reverse server" mode.
249+
250+
```cs
251+
public static void ResumeRuntime(Guid profilerGuid, string profilerPath)
252+
{
253+
var client = new DiagnosticsClient(processId);
254+
client.ResumeRuntime();
255+
}
256+
```
235257

236258
## API Description
237259

eng/Version.Details.xml

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<Uri>https://github.com/dotnet/symstore</Uri>
99
<Sha>3ed87724fe4e98c7ecc77617720591783ee2e676</Sha>
1010
</Dependency>
11-
<Dependency Name="Microsoft.Diagnostics.Runtime" Version="2.0.226801">
11+
<Dependency Name="Microsoft.Diagnostics.Runtime" Version="2.0.230301">
1212
<Uri>https://github.com/microsoft/clrmd</Uri>
13-
<Sha>52b244f9b62e7a4e398f0cd9cb99d3c9a76f3130</Sha>
13+
<Sha>957981f36eeccb6e9d266407df6522ca5cfbd899</Sha>
1414
</Dependency>
15-
<Dependency Name="Microsoft.Diagnostics.Runtime.Utilities" Version="2.0.226801">
15+
<Dependency Name="Microsoft.Diagnostics.Runtime.Utilities" Version="2.0.230301">
1616
<Uri>https://github.com/microsoft/clrmd</Uri>
17-
<Sha>52b244f9b62e7a4e398f0cd9cb99d3c9a76f3130</Sha>
17+
<Sha>957981f36eeccb6e9d266407df6522ca5cfbd899</Sha>
1818
</Dependency>
1919
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.100-preview.1.21103.13">
2020
<Uri>https://github.com/dotnet/installer</Uri>
@@ -32,21 +32,21 @@
3232
<Sha>7f13798e5f567b72ffe63205bf49839245f0f8c1</Sha>
3333
<SourceBuild RepoName="arcade" ManagedOnly="true" />
3434
</Dependency>
35-
<Dependency Name="Microsoft.AspNetCore.App.Ref.Internal" Version="6.0.0-preview.6.21275.8">
35+
<Dependency Name="Microsoft.AspNetCore.App.Ref.Internal" Version="6.0.0-preview.7.21363.17">
3636
<Uri>https://github.com/dotnet/aspnetcore</Uri>
37-
<Sha>e7b5aa6f713e9f040ba0730b915ae407d35971c1</Sha>
37+
<Sha>837b17847c427be12d69623cf32223c10a4ddba5</Sha>
3838
</Dependency>
39-
<Dependency Name="Microsoft.AspNetCore.App.Ref" Version="6.0.0-preview.6.21275.8">
39+
<Dependency Name="Microsoft.AspNetCore.App.Ref" Version="6.0.0-preview.7.21363.17">
4040
<Uri>https://github.com/dotnet/aspnetcore</Uri>
41-
<Sha>e7b5aa6f713e9f040ba0730b915ae407d35971c1</Sha>
41+
<Sha>837b17847c427be12d69623cf32223c10a4ddba5</Sha>
4242
</Dependency>
43-
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="6.0.0-preview.6.21276.1">
43+
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="6.0.0-preview.7.21361.10">
4444
<Uri>https://github.com/dotnet/runtime</Uri>
45-
<Sha>f584c7401a24781b4c8e8e2a8097b85462ee4941</Sha>
45+
<Sha>98b7ed1a3b0543a31b5a0f9069cf44cb70c9230c</Sha>
4646
</Dependency>
47-
<Dependency Name="VS.Redist.Common.NetCore.SharedFramework.x64.6.0" Version="6.0.0-preview.6.21276.1">
47+
<Dependency Name="VS.Redist.Common.NetCore.SharedFramework.x64.6.0" Version="6.0.0-preview.7.21361.10">
4848
<Uri>https://github.com/dotnet/runtime</Uri>
49-
<Sha>f584c7401a24781b4c8e8e2a8097b85462ee4941</Sha>
49+
<Sha>98b7ed1a3b0543a31b5a0f9069cf44cb70c9230c</Sha>
5050
</Dependency>
5151
</ToolsetDependencies>
5252
</Dependencies>

eng/Versions.props

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<MicrosoftNETCoreApp50Version>5.0.6</MicrosoftNETCoreApp50Version>
1818
<MicrosoftAspNetCoreApp50Version>$(MicrosoftNETCoreApp50Version)</MicrosoftAspNetCoreApp50Version>
1919
<!-- Latest shared runtime version updated by darc -->
20-
<VSRedistCommonNetCoreSharedFrameworkx6460Version>6.0.0-preview.6.21276.1</VSRedistCommonNetCoreSharedFrameworkx6460Version>
21-
<MicrosoftNETCoreAppRuntimewinx64Version>6.0.0-preview.6.21276.1</MicrosoftNETCoreAppRuntimewinx64Version>
20+
<VSRedistCommonNetCoreSharedFrameworkx6460Version>6.0.0-preview.7.21361.10</VSRedistCommonNetCoreSharedFrameworkx6460Version>
21+
<MicrosoftNETCoreAppRuntimewinx64Version>6.0.0-preview.7.21361.10</MicrosoftNETCoreAppRuntimewinx64Version>
2222
<!-- Latest shared aspnetcore version updated by darc -->
23-
<MicrosoftAspNetCoreAppRefInternalVersion>6.0.0-preview.6.21275.8</MicrosoftAspNetCoreAppRefInternalVersion>
24-
<MicrosoftAspNetCoreAppRefVersion>6.0.0-preview.6.21275.8</MicrosoftAspNetCoreAppRefVersion>
23+
<MicrosoftAspNetCoreAppRefInternalVersion>6.0.0-preview.7.21363.17</MicrosoftAspNetCoreAppRefInternalVersion>
24+
<MicrosoftAspNetCoreAppRefVersion>6.0.0-preview.7.21363.17</MicrosoftAspNetCoreAppRefVersion>
2525
<!-- dotnet/installer: Testing version of the SDK. Needed for the signed & entitled host. -->
2626
<MicrosoftDotnetSdkInternalVersion>6.0.100-preview.1.21103.13</MicrosoftDotnetSdkInternalVersion>
2727
</PropertyGroup>
@@ -36,8 +36,8 @@
3636
<MicrosoftWin32PrimitivesVersion>4.3.0</MicrosoftWin32PrimitivesVersion>
3737
<!-- Other libs -->
3838
<MicrosoftBclAsyncInterfacesVersion>1.1.0</MicrosoftBclAsyncInterfacesVersion>
39-
<MicrosoftDiagnosticsRuntimeVersion>2.0.226801</MicrosoftDiagnosticsRuntimeVersion>
40-
<MicrosoftDiagnosticsRuntimeUtilitiesVersion>2.0.226801</MicrosoftDiagnosticsRuntimeUtilitiesVersion>
39+
<MicrosoftDiagnosticsRuntimeVersion>2.0.230301</MicrosoftDiagnosticsRuntimeVersion>
40+
<MicrosoftDiagnosticsRuntimeUtilitiesVersion>2.0.230301</MicrosoftDiagnosticsRuntimeUtilitiesVersion>
4141
<MicrosoftDiaSymReaderNativePackageVersion>16.9.0-beta1.21055.5</MicrosoftDiaSymReaderNativePackageVersion>
4242
<MicrosoftDiagnosticsTracingTraceEventVersion>2.0.64</MicrosoftDiagnosticsTracingTraceEventVersion>
4343
<MicrosoftExtensionsLoggingVersion>2.1.1</MicrosoftExtensionsLoggingVersion>

eng/build.sh

+2-11
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ case $CPUName in
100100
__HostArch=x86
101101
;;
102102

103-
x86_64)
103+
x86_64|amd64)
104104
__BuildArch=x64
105105
__HostArch=x64
106106
;;
@@ -259,7 +259,7 @@ while :; do
259259
-clang*)
260260
__Compiler=clang
261261
# clangx.y or clang-x.y
262-
version="$(echo "$lowerI" | tr -d '[:alpha:]-=')"
262+
version="$(echo "$1" | tr -d '[:alpha:]-=')"
263263
parts=(${version//./ })
264264
__ClangMajorVersion="${parts[0]}"
265265
__ClangMinorVersion="${parts[1]}"
@@ -433,15 +433,6 @@ if [ "$__HostOS" == "OSX" ]; then
433433

434434
export MACOSX_DEPLOYMENT_TARGET=10.12
435435

436-
# If Xcode 9.2 exists (like on the CI/build machines), use that. Xcode 9.3 or
437-
# greater (swift 4.1 lldb) doesn't work that well (seg faults on exit).
438-
if [ -f "/Applications/Xcode_9.2.app/Contents/Developer/usr/bin/lldb" ]; then
439-
if [ -f "/Applications/Xcode_9.2.app/Contents/SharedFrameworks/LLDB.framework/LLDB" ]; then
440-
export LLDB_PATH=/Applications/Xcode_9.2.app/Contents/Developer/usr/bin/lldb
441-
export LLDB_LIB=/Applications/Xcode_9.2.app/Contents/SharedFrameworks/LLDB.framework/LLDB
442-
fi
443-
fi
444-
445436
if [ ! -f $LLDB_LIB ]; then
446437
echo "Cannot find the lldb library. Try installing Xcode."
447438
exit 1

eng/common/native/find-native-compiler.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ check_version_exists() {
4545
desired_version="$1$2"
4646
elif command -v "$compiler-$1$2" > /dev/null; then
4747
desired_version="-$1$2"
48+
elif command -v "$compiler$1" > /dev/null; then
49+
desired_version="$1"
50+
elif command -v "$compiler-$1" > /dev/null; then
51+
desired_version="-$1"
4852
fi
4953

5054
echo "$desired_version"
@@ -55,7 +59,7 @@ if [ -z "$CLR_CC" ]; then
5559
# Set default versions
5660
if [ -z "$majorVersion" ]; then
5761
# note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
58-
if [ "$compiler" = "clang" ]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
62+
if [ "$compiler" = "clang" ]; then versions=( 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
5963
elif [ "$compiler" = "gcc" ]; then versions=( 9 8 7 6 5 4.9 ); fi
6064

6165
for version in "${versions[@]}"; do

eng/gen-buildsys-clang.sh

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ elif command -v "clang$2$3" > /dev/null
2929
elif command -v "clang-$2$3" > /dev/null
3030
then
3131
desired_llvm_version="-$2$3"
32+
elif command -v "clang-$2" > /dev/null
33+
then
34+
desired_llvm_version="-$2"
35+
elif command -v "clang$2" > /dev/null
36+
then
37+
desired_llvm_version="$2"
3238
elif command -v clang > /dev/null
3339
then
3440
desired_llvm_version=

src/Microsoft.Diagnostics.DebugServices.Implementation/Module.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public enum Flags : byte
3434

3535
private readonly IDisposable _onChangeEvent;
3636
private Flags _flags;
37-
private PdbInfo _pdbInfo;
37+
private PdbFileInfo _pdbFileInfo;
3838
private ImmutableArray<byte> _buildId;
39-
private VersionInfo? _version;
39+
private VersionData _versionData;
4040
private PEImage _peImage;
4141

4242
public readonly ServiceProvider ServiceProvider;
@@ -118,12 +118,12 @@ public bool? IsFileLayout
118118
}
119119
}
120120

121-
public PdbInfo PdbInfo
121+
public PdbFileInfo PdbFileInfo
122122
{
123123
get
124124
{
125125
GetPEInfo();
126-
return _pdbInfo;
126+
return _pdbFileInfo;
127127
}
128128
}
129129

@@ -147,10 +147,10 @@ public ImmutableArray<byte> BuildId
147147
}
148148
}
149149

150-
public virtual VersionInfo? Version
150+
public virtual VersionData VersionData
151151
{
152-
get { return _version; }
153-
set { _version = value; }
152+
get { return _versionData; }
153+
set { _versionData = value; }
154154
}
155155

156156
public abstract string VersionString { get; }
@@ -162,7 +162,7 @@ protected void GetVersionFromVersionString()
162162
GetPEInfo();
163163

164164
// If we can't get the version from the PE, search for version string embedded in the module data
165-
if (!_version.HasValue && !IsPEImage)
165+
if (_versionData is null && !IsPEImage)
166166
{
167167
string versionString = VersionString;
168168
if (versionString != null)
@@ -178,7 +178,7 @@ protected void GetVersionFromVersionString()
178178
try
179179
{
180180
Version version = System.Version.Parse(versionToParse);
181-
_version = new VersionInfo(version.Major, version.Minor, version.Build, version.Revision);
181+
_versionData = new VersionData(version.Major, version.Minor, version.Build, version.Revision);
182182
}
183183
catch (ArgumentException ex)
184184
{
@@ -192,7 +192,7 @@ protected void GetVersionFromVersionString()
192192
protected PEImage GetPEInfo()
193193
{
194194
if (InitializeValue(Flags.InitializePEInfo)) {
195-
_peImage = ModuleService.GetPEInfo(ImageBase, ImageSize, ref _pdbInfo, ref _version, ref _flags);
195+
_peImage = ModuleService.GetPEInfo(ImageBase, ImageSize, ref _pdbFileInfo, ref _versionData, ref _flags);
196196
}
197197
return _peImage;
198198
}

0 commit comments

Comments
 (0)