mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
Compare commits
94
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
620cf53820 | ||
|
|
41494af55d | ||
|
|
66e2b84002 | ||
|
|
d3daacdaa8 | ||
|
|
e59c1cd70f | ||
|
|
648655b86d | ||
|
|
ec71e8a7ae | ||
|
|
20bb4f9a6d | ||
|
|
9ca6fa646a | ||
|
|
2ff424be29 | ||
|
|
83105ba224 | ||
|
|
109b4b6f44 | ||
|
|
15782aa740 | ||
|
|
6ea4cbcee0 | ||
|
|
d45ff3af75 | ||
|
|
bc1dd071a7 | ||
|
|
87ef555701 | ||
|
|
8c085a99b3 | ||
|
|
89d772a3ab | ||
|
|
e9d3af508e | ||
|
|
d6f0c25d34 | ||
|
|
075c3f0619 | ||
|
|
35cc82cc6c | ||
|
|
00ae178a04 | ||
|
|
c23ad4f5b3 | ||
|
|
83558de96b | ||
|
|
051408e0be | ||
|
|
58b04da0d7 | ||
|
|
f51cb7ad85 | ||
|
|
62414d588b | ||
|
|
259ec2ef65 | ||
|
|
165f4b0341 | ||
|
|
b04dc7e6a4 | ||
|
|
ecde08600b | ||
|
|
8fb9301292 | ||
|
|
7bfb441fb4 | ||
|
|
e77cea1910 | ||
|
|
fda73998f9 | ||
|
|
beccf5ba43 | ||
|
|
5bea89d861 | ||
|
|
4b0424cd68 | ||
|
|
2444b38b3c | ||
|
|
93a2f4ea39 | ||
|
|
0565f6e2c0 | ||
|
|
b7196c45e8 | ||
|
|
88c1989895 | ||
|
|
d2be7389b1 | ||
|
|
a7e29665d2 | ||
|
|
c51a2eba84 | ||
|
|
f0784b26dd | ||
|
|
d90665a422 | ||
|
|
74bf77a59c | ||
|
|
f0ce5105d4 | ||
|
|
4ca7d77e34 | ||
|
|
338349925c | ||
|
|
3a4122f14f | ||
|
|
6134b2fdc9 | ||
|
|
8cac8ee9c3 | ||
|
|
8c184a19d1 | ||
|
|
72c8e7c7ff | ||
|
|
544930719e | ||
|
|
69d8e50279 | ||
|
|
017cd6e606 | ||
|
|
79f94d9960 | ||
|
|
2aa8108972 | ||
|
|
2b7e10ebda | ||
|
|
23b4f40e1b | ||
|
|
4cc5d1bdd3 | ||
|
|
86f2aad309 | ||
|
|
de18868297 | ||
|
|
9a18f06a45 | ||
|
|
e40d66b687 | ||
|
|
86679ca35a | ||
|
|
fce530c0b0 | ||
|
|
daf5d55df9 | ||
|
|
ab4049e219 | ||
|
|
76126c14e9 | ||
|
|
bfd182bd20 | ||
|
|
5070e45d54 | ||
|
|
8f348378ec | ||
|
|
124300cac1 | ||
|
|
ecc716b89e | ||
|
|
f460694bac | ||
|
|
778878e336 | ||
|
|
4fcb57e73b | ||
|
|
879f6699bb | ||
|
|
688a178aa4 | ||
|
|
5be9a0f156 | ||
|
|
a503f98e06 | ||
|
|
9af77d0093 | ||
|
|
75a7ff235a | ||
|
|
05dc198dfc | ||
|
|
950644e9de | ||
|
|
cd8a898912 |
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ AM_CFLAGS = $(WERROR_CFLAGS)
|
||||
|
||||
SUBDIRS = @MONO_SUBDIRS@
|
||||
noinst_SUBDIRS = @MONO_NOINST_SUBDIRS@
|
||||
DIST_SUBDIRS = $(SUBDIRS) m4 netcore
|
||||
DIST_SUBDIRS = $(SUBDIRS) m4 netcore netcore/corerun
|
||||
|
||||
if !ENABLE_NETCORE
|
||||
|
||||
|
||||
+5
-6
@@ -4,7 +4,7 @@
|
||||
# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
|
||||
# It should remain in the format they expect.
|
||||
#
|
||||
AC_INIT(mono, [6.13.0],
|
||||
AC_INIT(mono, [6.12.0],
|
||||
[https://github.com/mono/mono/issues/new])
|
||||
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
@@ -1208,6 +1208,7 @@ if test x$enable_monotouch = xyes; then
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(cxx, [ --enable-cxx compile some code as C++])
|
||||
AM_CONDITIONAL(ENABLE_CXX, test x$enable_cxx = xyes)
|
||||
|
||||
# mono/corefx/native has a lot of invalid C++98 in its headers
|
||||
# dotnet/corefx/native looks a lot better, i.e. 44e5bdafb8d989a220c9cf1b94f31a64a6e4f052
|
||||
@@ -1362,9 +1363,7 @@ MONO_LLVM_PATH_OPTION=llvm-path="`pwd`/llvm/usr/bin"
|
||||
|
||||
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
|
||||
DISABLE_MCS_DOCS_default=yes
|
||||
fi
|
||||
|
||||
if test x$with_runtime_preset = xnetcore; then
|
||||
elif test x$with_runtime_preset = xnetcore; then
|
||||
# Keep in sync with winconfig.h netcore configuration.
|
||||
DISABLE_MCS_DOCS_default=yes
|
||||
BTLS_SUPPORTED=no
|
||||
@@ -6099,8 +6098,8 @@ fi
|
||||
AC_SUBST(mono_runtime)
|
||||
AC_SUBST(mono_runtime_wrapper)
|
||||
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe
|
||||
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.6.0/csc.exe
|
||||
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.6.0/VBCSCompiler.exe
|
||||
|
||||
if test $csc_compiler = mcs; then
|
||||
CSC=$mcs_topdir/class/lib/build/mcs.exe
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
</Dependency>
|
||||
</ProductDependencies>
|
||||
<ToolsetDependencies>
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20109.1">
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20076.3">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>b0e8d3944155f94f83deea8afe025debe369e69f</Sha>
|
||||
<Sha>cc8fe69635c7c6e791c87540851aea75946945fa</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20109.1">
|
||||
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20076.3">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>b0e8d3944155f94f83deea8afe025debe369e69f</Sha>
|
||||
<Sha>cc8fe69635c7c6e791c87540851aea75946945fa</Sha>
|
||||
</Dependency>
|
||||
</ToolsetDependencies>
|
||||
</Dependencies>
|
||||
@@ -24,15 +24,13 @@ function InstallDarcCli ($darcVersion) {
|
||||
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
|
||||
}
|
||||
|
||||
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
|
||||
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
|
||||
|
||||
Write-Host "Installing Darc CLI version $darcVersion..."
|
||||
Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.'
|
||||
if (-not $toolpath) {
|
||||
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
|
||||
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g
|
||||
}else {
|
||||
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g --tool-path '$toolpath'"
|
||||
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ Param(
|
||||
[Parameter(Mandatory=$true)][string] $gitHubPat, # GitHub personal access token from https://github.com/settings/tokens (no auth scopes needed)
|
||||
[Parameter(Mandatory=$true)][string] $azdoPat, # Azure Dev Ops tokens from https://dev.azure.com/dnceng/_details/security/tokens (code read scope needed)
|
||||
[Parameter(Mandatory=$true)][string] $outputFolder, # Where the graphviz.txt file will be created
|
||||
[string] $darcVersion, # darc's version
|
||||
[string] $darcVersion = '1.1.0-beta.19175.6', # darc's version
|
||||
[string] $graphvizVersion = '2.38', # GraphViz version
|
||||
[switch] $includeToolset # Whether the graph should include toolset dependencies or not. i.e. arcade, optimization. For more about
|
||||
# toolset dependencies see https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#toolset-vs-product-dependencies
|
||||
|
||||
@@ -9,12 +9,12 @@ Param(
|
||||
[string] $Branch=$env:BUILD_SOURCEBRANCH,
|
||||
[string] $CommitSha=$env:BUILD_SOURCEVERSION,
|
||||
[string] $BuildNumber=$env:BUILD_BUILDNUMBER,
|
||||
[string] $RunCategories="Libraries Runtime",
|
||||
[string] $RunCategories="coreclr corefx",
|
||||
[string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj",
|
||||
[string] $Kind="micro",
|
||||
[switch] $Internal,
|
||||
[switch] $Compare,
|
||||
[string] $Configurations="CompilationMode=$CompilationMode RunKind=$Kind"
|
||||
[string] $Configurations="CompilationMode=$CompilationMode"
|
||||
)
|
||||
|
||||
$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") -or ($Repository -eq "dotnet-performance")
|
||||
@@ -50,7 +50,7 @@ if ($Internal) {
|
||||
}
|
||||
|
||||
# FIX ME: This is a workaround until we get this from the actual pipeline
|
||||
$CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations --architecture $Architecture"
|
||||
$CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations"
|
||||
$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments"
|
||||
|
||||
if ($RunFromPerformanceRepo) {
|
||||
|
||||
@@ -13,9 +13,9 @@ build_number=$BUILD_BUILDNUMBER
|
||||
internal=false
|
||||
compare=false
|
||||
kind="micro"
|
||||
run_categories="Libraries Runtime"
|
||||
run_categories="coreclr corefx"
|
||||
csproj="src\benchmarks\micro\MicroBenchmarks.csproj"
|
||||
configurations="CompliationMode=$compilation_mode RunKind=$kind"
|
||||
configurations=
|
||||
run_from_perf_repo=false
|
||||
use_core_run=true
|
||||
use_baseline_core_run=true
|
||||
@@ -164,7 +164,7 @@ if [[ "$internal" == true ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations --architecture $architecture"
|
||||
common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations"
|
||||
setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments"
|
||||
|
||||
if [[ "$run_from_perf_repo" = true ]]; then
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ try {
|
||||
ExitWithExitCode 1
|
||||
}
|
||||
|
||||
# Get info about which channel(s) the build has already been promoted to
|
||||
# Get info about which channels the build has already been promoted to
|
||||
$buildInfo = Get-MaestroBuild -BuildId $BuildId
|
||||
|
||||
if (!$buildInfo) {
|
||||
@@ -1,5 +1,4 @@
|
||||
parameters:
|
||||
enable: 'false' # Whether the SDL validation job should execute or not
|
||||
overrideParameters: '' # Optional: to override values for parameters.
|
||||
additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")'
|
||||
# There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named
|
||||
@@ -17,15 +16,8 @@ jobs:
|
||||
- job: Run_SDL
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
displayName: Run SDL tool
|
||||
condition: eq( ${{ parameters.enable }}, 'true')
|
||||
variables:
|
||||
- group: DotNet-VSTS-Bot
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
pool:
|
||||
name: Hosted VS2017
|
||||
steps:
|
||||
@@ -36,22 +28,14 @@ jobs:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Build Artifacts
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
buildType: current
|
||||
artifactName: ${{ artifactName }}
|
||||
downloadPath: $(Build.ArtifactStagingDirectory)\artifacts
|
||||
- ${{ if eq(parameters.artifactNames, '') }}:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Build Artifacts
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
buildType: current
|
||||
downloadType: specific files
|
||||
itemPattern: "**"
|
||||
downloadPath: $(Build.ArtifactStagingDirectory)\artifacts
|
||||
|
||||
@@ -23,15 +23,9 @@ stages:
|
||||
- job: publish_symbols
|
||||
displayName: Symbol Publishing
|
||||
dependsOn: setupMaestroVars
|
||||
condition: or(contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }} )), eq(dependencies.setupMaestroVars.outputs['setReleaseVars.PromoteToMaestroChannelId'], ${{ parameters.channelId }}))
|
||||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }} ))
|
||||
variables:
|
||||
- group: DotNet-Symbol-Server-Pats
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
@@ -39,14 +33,10 @@ stages:
|
||||
displayName: Download Build Assets
|
||||
continueOnError: true
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
buildType: 'current'
|
||||
downloadType: 'specific'
|
||||
itemPattern: |
|
||||
PdbArtifacts/**
|
||||
PDBArtifacts/**
|
||||
BlobArtifacts/**
|
||||
downloadPath: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
@@ -89,13 +79,7 @@ stages:
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
|
||||
- name: IsStableBuild
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
condition: or(contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }} )), eq(dependencies.setupMaestroVars.outputs['setReleaseVars.PromoteToMaestroChannelId'], ${{ parameters.channelId }}))
|
||||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }}))
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
@@ -103,11 +87,7 @@ stages:
|
||||
displayName: Download Build Assets
|
||||
continueOnError: true
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
buildType: 'current'
|
||||
downloadType: 'specific'
|
||||
itemPattern: |
|
||||
PackageArtifacts/**
|
||||
@@ -166,6 +146,6 @@ stages:
|
||||
StageLabel: '${{ parameters.stageName }}'
|
||||
JobLabel: 'AssetsPublishing'
|
||||
|
||||
- template: ../../steps/add-build-to-channel.yml
|
||||
- template: ../../steps/promote-build.yml
|
||||
parameters:
|
||||
ChannelId: ${{ parameters.channelId }}
|
||||
@@ -23,15 +23,9 @@ stages:
|
||||
- job: publish_symbols
|
||||
displayName: Symbol Publishing
|
||||
dependsOn: setupMaestroVars
|
||||
condition: or(contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }} )), eq(dependencies.setupMaestroVars.outputs['setReleaseVars.PromoteToMaestroChannelId'], ${{ parameters.channelId }}))
|
||||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }} ))
|
||||
variables:
|
||||
- group: DotNet-Symbol-Server-Pats
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
@@ -39,14 +33,10 @@ stages:
|
||||
displayName: Download Build Assets
|
||||
continueOnError: true
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
buildType: 'current'
|
||||
downloadType: 'specific'
|
||||
itemPattern: |
|
||||
PdbArtifacts/**
|
||||
PDBArtifacts/**
|
||||
BlobArtifacts/**
|
||||
downloadPath: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
@@ -88,13 +78,7 @@ stages:
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
|
||||
- name: IsStableBuild
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
condition: or(contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }} )), eq(dependencies.setupMaestroVars.outputs['setReleaseVars.PromoteToMaestroChannelId'], ${{ parameters.channelId }}))
|
||||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }}))
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
@@ -102,11 +86,7 @@ stages:
|
||||
displayName: Download Build Assets
|
||||
continueOnError: true
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
buildType: 'current'
|
||||
downloadType: 'specific'
|
||||
itemPattern: |
|
||||
PackageArtifacts/**
|
||||
@@ -165,6 +145,6 @@ stages:
|
||||
StageLabel: '${{ parameters.stageName }}'
|
||||
JobLabel: 'AssetsPublishing'
|
||||
|
||||
- template: ../../steps/add-build-to-channel.yml
|
||||
- template: ../../steps/promote-build.yml
|
||||
parameters:
|
||||
ChannelId: ${{ parameters.channelId }}
|
||||
@@ -26,136 +26,97 @@ stages:
|
||||
- stage: Validate
|
||||
dependsOn: ${{ parameters.validateDependsOn }}
|
||||
displayName: Validate
|
||||
variables:
|
||||
- template: common-variables.yml
|
||||
jobs:
|
||||
- template: setup-maestro-vars.yml
|
||||
- ${{ if eq(parameters.enableNugetValidation, 'true') }}:
|
||||
- job:
|
||||
displayName: NuGet Validation
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Package Artifacts
|
||||
inputs:
|
||||
buildType: current
|
||||
artifactName: PackageArtifacts
|
||||
|
||||
- job:
|
||||
displayName: NuGet Validation
|
||||
dependsOn: setupMaestroVars
|
||||
condition: eq( ${{ parameters.enableNugetValidation }}, 'true')
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
variables:
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Package Artifacts
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
artifactName: PackageArtifacts
|
||||
- task: PowerShell@2
|
||||
displayName: Validate
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1
|
||||
arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/
|
||||
-ToolDestinationPath $(Agent.BuildDirectory)/Extract/
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Validate
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1
|
||||
arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/
|
||||
-ToolDestinationPath $(Agent.BuildDirectory)/Extract/
|
||||
- ${{ if eq(parameters.enableSigningValidation, 'true') }}:
|
||||
- job:
|
||||
displayName: Signing Validation
|
||||
variables:
|
||||
- template: common-variables.yml
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Package Artifacts
|
||||
inputs:
|
||||
buildType: current
|
||||
artifactName: PackageArtifacts
|
||||
|
||||
- job:
|
||||
displayName: Signing Validation
|
||||
dependsOn: setupMaestroVars
|
||||
condition: eq( ${{ parameters.enableSigningValidation }}, 'true')
|
||||
variables:
|
||||
- template: common-variables.yml
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Package Artifacts
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
artifactName: PackageArtifacts
|
||||
# This is necessary whenever we want to publish/restore to an AzDO private feed
|
||||
# Since sdk-task.ps1 tries to restore packages we need to do this authentication here
|
||||
# otherwise it'll complain about accessing a private feed.
|
||||
- task: NuGetAuthenticate@0
|
||||
displayName: 'Authenticate to AzDO Feeds'
|
||||
|
||||
# This is necessary whenever we want to publish/restore to an AzDO private feed
|
||||
# Since sdk-task.ps1 tries to restore packages we need to do this authentication here
|
||||
# otherwise it'll complain about accessing a private feed.
|
||||
- task: NuGetAuthenticate@0
|
||||
displayName: 'Authenticate to AzDO Feeds'
|
||||
- task: PowerShell@2
|
||||
displayName: Enable cross-org publishing
|
||||
inputs:
|
||||
filePath: eng\common\enable-cross-org-publishing.ps1
|
||||
arguments: -token $(dn-bot-dnceng-artifact-feeds-rw)
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Enable cross-org publishing
|
||||
inputs:
|
||||
filePath: eng\common\enable-cross-org-publishing.ps1
|
||||
arguments: -token $(dn-bot-dnceng-artifact-feeds-rw)
|
||||
- task: PowerShell@2
|
||||
displayName: Validate
|
||||
inputs:
|
||||
filePath: eng\common\sdk-task.ps1
|
||||
arguments: -task SigningValidation -restore -msbuildEngine dotnet
|
||||
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts'
|
||||
/p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt'
|
||||
${{ parameters.signingValidationAdditionalParameters }}
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Validate
|
||||
inputs:
|
||||
filePath: eng\common\sdk-task.ps1
|
||||
arguments: -task SigningValidation -restore -msbuildEngine dotnet
|
||||
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts'
|
||||
/p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt'
|
||||
${{ parameters.signingValidationAdditionalParameters }}
|
||||
- template: ../steps/publish-logs.yml
|
||||
parameters:
|
||||
StageLabel: 'Validation'
|
||||
JobLabel: 'Signing'
|
||||
|
||||
- template: ../steps/publish-logs.yml
|
||||
parameters:
|
||||
StageLabel: 'Validation'
|
||||
JobLabel: 'Signing'
|
||||
- ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}:
|
||||
- job:
|
||||
displayName: SourceLink Validation
|
||||
variables:
|
||||
- template: common-variables.yml
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Blob Artifacts
|
||||
inputs:
|
||||
buildType: current
|
||||
artifactName: BlobArtifacts
|
||||
|
||||
- job:
|
||||
displayName: SourceLink Validation
|
||||
dependsOn: setupMaestroVars
|
||||
condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true')
|
||||
variables:
|
||||
- template: common-variables.yml
|
||||
- name: AzDOProjectName
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ]
|
||||
- name: AzDOPipelineId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
|
||||
- name: AzDOBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Blob Artifacts
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(AzDOProjectName)
|
||||
pipeline: $(AzDOPipelineId)
|
||||
buildId: $(AzDOBuildId)
|
||||
artifactName: BlobArtifacts
|
||||
- task: PowerShell@2
|
||||
displayName: Validate
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
|
||||
arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/
|
||||
-ExtractPath $(Agent.BuildDirectory)/Extract/
|
||||
-GHRepoName $(Build.Repository.Name)
|
||||
-GHCommit $(Build.SourceVersion)
|
||||
-SourcelinkCliVersion $(SourceLinkCLIVersion)
|
||||
continueOnError: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Validate
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
|
||||
arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/
|
||||
-ExtractPath $(Agent.BuildDirectory)/Extract/
|
||||
-GHRepoName $(Build.Repository.Name)
|
||||
-GHCommit $(Build.SourceVersion)
|
||||
-SourcelinkCliVersion $(SourceLinkCLIVersion)
|
||||
continueOnError: true
|
||||
|
||||
- template: /eng/common/templates/job/execute-sdl.yml
|
||||
parameters:
|
||||
enable: ${{ parameters.SDLValidationParameters.enable }}
|
||||
dependsOn: setupMaestroVars
|
||||
additionalParameters: ${{ parameters.SDLValidationParameters.params }}
|
||||
continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }}
|
||||
artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }}
|
||||
- ${{ if eq(parameters.SDLValidationParameters.enable, 'true') }}:
|
||||
- template: /eng/common/templates/job/execute-sdl.yml
|
||||
parameters:
|
||||
additionalParameters: ${{ parameters.SDLValidationParameters.params }}
|
||||
continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }}
|
||||
artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }}
|
||||
|
||||
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
|
||||
parameters:
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
parameters:
|
||||
ChannelId: 0
|
||||
|
||||
jobs:
|
||||
- job:
|
||||
displayName: Promote Build
|
||||
dependsOn: setupMaestroVars
|
||||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.ChannelId }}))
|
||||
variables:
|
||||
- name: BARBuildId
|
||||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
|
||||
- name: ChannelId
|
||||
value: ${{ parameters.ChannelId }}
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
- task: PowerShell@2
|
||||
displayName: Add Build to Channel
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1
|
||||
arguments: -BuildId $(BARBuildId)
|
||||
-ChannelId $(ChannelId)
|
||||
-MaestroApiAccessToken $(MaestroApiAccessToken)
|
||||
-MaestroApiEndPoint $(MaestroApiEndPoint)
|
||||
-MaestroApiVersion $(MaestroApiVersion)
|
||||
@@ -1,12 +1,6 @@
|
||||
jobs:
|
||||
- job: setupMaestroVars
|
||||
displayName: Setup Maestro Vars
|
||||
variables:
|
||||
- template: common-variables.yml
|
||||
- name: BuildId
|
||||
value: $[ coalesce(variables.BARBuildId, 0) ]
|
||||
- name: PromoteToChannelId
|
||||
value: $[ coalesce(variables.PromoteToMaestroChannelId, 0) ]
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
@@ -14,7 +8,6 @@ jobs:
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Release Configs
|
||||
condition: eq(variables.PromoteToChannelId, 0)
|
||||
inputs:
|
||||
buildType: current
|
||||
artifactName: ReleaseConfigs
|
||||
@@ -26,50 +19,18 @@ jobs:
|
||||
targetType: inline
|
||||
script: |
|
||||
try {
|
||||
if ($Env:PromoteToChannelId -eq 0) {
|
||||
$Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt
|
||||
$Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt
|
||||
|
||||
$BarId = $Content | Select -Index 0
|
||||
$BarId = $Content | Select -Index 0
|
||||
|
||||
$Channels = ""
|
||||
$Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," }
|
||||
|
||||
$IsStableBuild = $Content | Select -Index 2
|
||||
$Channels = ""
|
||||
$Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," }
|
||||
|
||||
$AzureDevOpsProject = $Env:System_TeamProject
|
||||
$AzureDevOpsBuildDefinitionId = $Env:System_DefinitionId
|
||||
$AzureDevOpsBuildId = $Env:Build_BuildId
|
||||
$PromoteToMaestroChannelId = 0
|
||||
}
|
||||
else {
|
||||
$buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}"
|
||||
|
||||
$apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
|
||||
$apiHeaders.Add('Accept', 'application/json')
|
||||
$apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}")
|
||||
|
||||
$buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
|
||||
|
||||
$BarId = $Env:BARBuildId
|
||||
$Channels = 'None'
|
||||
|
||||
#TODO: Fix this once this issue is done: https://github.com/dotnet/arcade/issues/3834
|
||||
$IsStableBuild = 'False'
|
||||
|
||||
$AzureDevOpsProject = $buildInfo.azureDevOpsProject
|
||||
$AzureDevOpsBuildDefinitionId = $buildInfo.azureDevOpsBuildDefinitionId
|
||||
$AzureDevOpsBuildId = $buildInfo.azureDevOpsBuildId
|
||||
$PromoteToMaestroChannelId = $Env:PromoteToMaestroChannelId
|
||||
}
|
||||
$IsStableBuild = $Content | Select -Index 2
|
||||
|
||||
Write-Host "##vso[task.setvariable variable=BARBuildId;isOutput=true]$BarId"
|
||||
Write-Host "##vso[task.setvariable variable=InitialChannels;isOutput=true]$Channels"
|
||||
Write-Host "##vso[task.setvariable variable=IsStableBuild;isOutput=true]$IsStableBuild"
|
||||
|
||||
Write-Host "##vso[task.setvariable variable=AzDOProjectName;isOutput=true]$AzureDevOpsProject"
|
||||
Write-Host "##vso[task.setvariable variable=AzDOPipelineId;isOutput=true]$AzureDevOpsBuildDefinitionId"
|
||||
Write-Host "##vso[task.setvariable variable=AzDOBuildId;isOutput=true]$AzureDevOpsBuildId"
|
||||
Write-Host "##vso[task.setvariable variable=PromoteToMaestroChannelId;isOutput=true]$PromoteToMaestroChannelId"
|
||||
}
|
||||
catch {
|
||||
Write-Host $_
|
||||
@@ -77,5 +38,3 @@ jobs:
|
||||
Write-Host $_.ScriptStackTrace
|
||||
exit 1
|
||||
}
|
||||
env:
|
||||
MAESTRO_API_TOKEN: $(MaestroApiAccessToken)
|
||||
+2
-2
@@ -5,9 +5,9 @@ steps:
|
||||
- task: PowerShell@2
|
||||
displayName: Add Build to Channel
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/add-build-to-channel.ps1
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1
|
||||
arguments: -BuildId $(BARBuildId)
|
||||
-ChannelId ${{ parameters.ChannelId }}
|
||||
-MaestroApiAccessToken $(MaestroApiAccessToken)
|
||||
-MaestroApiEndPoint $(MaestroApiEndPoint)
|
||||
-MaestroApiVersion $(MaestroApiVersion)
|
||||
-MaestroApiVersion $(MaestroApiVersion)
|
||||
+14
-37
@@ -155,12 +155,12 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
|
||||
# The following code block is protecting against concurrent access so that this function can
|
||||
# be called in parallel.
|
||||
if ($createSdkLocationFile) {
|
||||
do {
|
||||
do {
|
||||
$sdkCacheFileTemp = Join-Path $ToolsetDir $([System.IO.Path]::GetRandomFileName())
|
||||
}
|
||||
}
|
||||
until (!(Test-Path $sdkCacheFileTemp))
|
||||
Set-Content -Path $sdkCacheFileTemp -Value $dotnetRoot
|
||||
|
||||
|
||||
try {
|
||||
Rename-Item -Force -Path $sdkCacheFileTemp 'sdk.txt'
|
||||
} catch {
|
||||
@@ -188,33 +188,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
|
||||
if (!(Test-Path $installScript)) {
|
||||
Create-Directory $dotnetRoot
|
||||
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
|
||||
|
||||
$maxRetries = 5
|
||||
$retries = 1
|
||||
|
||||
$uri = "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1"
|
||||
|
||||
while($true) {
|
||||
try {
|
||||
Write-Host "GET $uri"
|
||||
Invoke-WebRequest $uri -OutFile $installScript
|
||||
break
|
||||
}
|
||||
catch {
|
||||
Write-Host "Failed to download '$uri'"
|
||||
Write-Error $_.Exception.Message -ErrorAction Continue
|
||||
}
|
||||
|
||||
if (++$retries -le $maxRetries) {
|
||||
$delayInSeconds = [math]::Pow(2, $retries) - 1 # Exponential backoff
|
||||
Write-Host "Retrying. Waiting for $delayInSeconds seconds before next attempt ($retries of $maxRetries)."
|
||||
Start-Sleep -Seconds $delayInSeconds
|
||||
}
|
||||
else {
|
||||
throw "Unable to download file in $maxRetries attempts."
|
||||
}
|
||||
|
||||
}
|
||||
Invoke-WebRequest "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1" -OutFile $installScript
|
||||
}
|
||||
|
||||
return $installScript
|
||||
@@ -224,12 +198,12 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc
|
||||
InstallDotNet $dotnetRoot $version $architecture
|
||||
}
|
||||
|
||||
function InstallDotNet([string] $dotnetRoot,
|
||||
[string] $version,
|
||||
[string] $architecture = '',
|
||||
[string] $runtime = '',
|
||||
[bool] $skipNonVersionedFiles = $false,
|
||||
[string] $runtimeSourceFeed = '',
|
||||
function InstallDotNet([string] $dotnetRoot,
|
||||
[string] $version,
|
||||
[string] $architecture = '',
|
||||
[string] $runtime = '',
|
||||
[bool] $skipNonVersionedFiles = $false,
|
||||
[string] $runtimeSourceFeed = '',
|
||||
[string] $runtimeSourceFeedKey = '') {
|
||||
|
||||
$installScript = GetDotNetInstallScript $dotnetRoot
|
||||
@@ -324,7 +298,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
|
||||
$vsMajorVersion = $vsMinVersion.Major
|
||||
$xcopyMSBuildVersion = "$vsMajorVersion.$($vsMinVersion.Minor).0-alpha"
|
||||
}
|
||||
|
||||
|
||||
$vsInstallDir = $null
|
||||
if ($xcopyMSBuildVersion.Trim() -ine "none") {
|
||||
$vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install
|
||||
@@ -681,6 +655,9 @@ Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir
|
||||
Write-PipelineSetVariable -Name 'TEMP' -Value $TempDir
|
||||
Write-PipelineSetVariable -Name 'TMP' -Value $TempDir
|
||||
|
||||
$env:TEMP=$TempDir
|
||||
$env:TMP=$TempDir
|
||||
|
||||
# Import custom tools configuration, if present in the repo.
|
||||
# Note: Import in global scope so that the script set top-level variables without qualification.
|
||||
if (!$disableConfigureToolsetImport) {
|
||||
|
||||
+8
-30
@@ -41,7 +41,7 @@ fi
|
||||
# Configures warning treatment in msbuild.
|
||||
warn_as_error=${warn_as_error:-true}
|
||||
|
||||
# True to attempt using .NET Core already that meets requirements specified in global.json
|
||||
# True to attempt using .NET Core already that meets requirements specified in global.json
|
||||
# installed on the machine instead of downloading one.
|
||||
use_installed_dotnet_cli=${use_installed_dotnet_cli:-true}
|
||||
|
||||
@@ -172,7 +172,7 @@ function InstallDotNetSdk {
|
||||
function InstallDotNet {
|
||||
local root=$1
|
||||
local version=$2
|
||||
|
||||
|
||||
GetDotNetInstallScript "$root"
|
||||
local install_script=$_GetDotNetInstallScript
|
||||
|
||||
@@ -218,28 +218,6 @@ function InstallDotNet {
|
||||
}
|
||||
}
|
||||
|
||||
function with_retries {
|
||||
local maxRetries=5
|
||||
local retries=1
|
||||
echo "Trying to run '$@' for maximum of $maxRetries attempts."
|
||||
while [[ $((retries++)) -le $maxRetries ]]; do
|
||||
"$@"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
echo "Ran '$@' successfully."
|
||||
return 0
|
||||
fi
|
||||
|
||||
timeout=$((2**$retries-1))
|
||||
echo "Failed to execute '$@'. Waiting $timeout seconds before next attempt ($retries out of $maxRetries)." 1>&2
|
||||
sleep $timeout
|
||||
done
|
||||
|
||||
echo "Failed to execute '$@' for $maxRetries times." 1>&2
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
function GetDotNetInstallScript {
|
||||
local root=$1
|
||||
local install_script="$root/dotnet-install.sh"
|
||||
@@ -252,13 +230,13 @@ function GetDotNetInstallScript {
|
||||
|
||||
# Use curl if available, otherwise use wget
|
||||
if command -v curl > /dev/null; then
|
||||
with_retries curl "$install_script_url" -isSLv --retry 10 --create-dirs -o "$install_script" || {
|
||||
curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script" || {
|
||||
local exit_code=$?
|
||||
Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to acquire dotnet install script (exit code '$exit_code')."
|
||||
ExitWithExitCode $exit_code
|
||||
}
|
||||
else
|
||||
with_retries wget -v -O "$install_script" "$install_script_url" || {
|
||||
else
|
||||
wget -q -O "$install_script" "$install_script_url" || {
|
||||
local exit_code=$?
|
||||
Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to acquire dotnet install script (exit code '$exit_code')."
|
||||
ExitWithExitCode $exit_code
|
||||
@@ -273,11 +251,11 @@ function InitializeBuildTool {
|
||||
if [[ -n "${_InitializeBuildTool:-}" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
InitializeDotNetCli $restore
|
||||
|
||||
# return values
|
||||
_InitializeBuildTool="$_InitializeDotNetCli/dotnet"
|
||||
_InitializeBuildTool="$_InitializeDotNetCli/dotnet"
|
||||
_InitializeBuildToolCommand="msbuild"
|
||||
_InitializeBuildToolFramework="netcoreapp2.1"
|
||||
}
|
||||
@@ -341,7 +319,7 @@ function InitializeToolset {
|
||||
if [[ "$binary_log" == true ]]; then
|
||||
bl="/bl:$log_dir/ToolsetRestore.binlog"
|
||||
fi
|
||||
|
||||
|
||||
echo '<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' > "$proj"
|
||||
MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file"
|
||||
|
||||
|
||||
Vendored
+1
-1
Submodule external/api-snapshot updated: 5b8247e289...e6b00a4772.
Vendored
+1
-1
Submodule external/bockbuild updated: 23374e3b63...0ab42dc099.
Vendored
+1
-1
Submodule external/boringssl updated: d7b108ee11...296137cf98.
Vendored
+1
-1
Submodule external/corefx updated: 7c9e215892...7c24bb0756.
Vendored
+1
-1
Submodule external/linker updated: 6e0105e0fc...e1c7a72951.
Vendored
+1
-1
Submodule external/nunit-lite updated: 26dbdb9a88...a977ca5757.
Vendored
+1
-1
Submodule external/roslyn-binaries updated: 27c352d6ed...8867d9ad53.
+2
-2
@@ -3,7 +3,7 @@
|
||||
"dotnet": "5.0.100-alpha1-015772"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20109.1",
|
||||
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20109.1"
|
||||
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20076.3",
|
||||
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20076.3"
|
||||
}
|
||||
}
|
||||
@@ -97,5 +97,6 @@ AC_DEFUN([AC_MONO_OUTPUT], [
|
||||
tools/mono-hang-watchdog/Makefile
|
||||
runtime/Makefile
|
||||
po/Makefile
|
||||
netcore/corerun/Makefile
|
||||
])
|
||||
])
|
||||
+7
-1
@@ -1498,6 +1498,9 @@ scanning is available.
|
||||
\fBno-managed-allocator\fR
|
||||
Disables the managed allocator.
|
||||
.TP
|
||||
\fBmanaged-allocator\fR
|
||||
Enables the managed allocator.
|
||||
.TP
|
||||
\fBcheck-scan-starts\fR
|
||||
If set, does a plausibility check on the scan_starts before and after each collection
|
||||
.TP
|
||||
@@ -1523,7 +1526,10 @@ sgen-gc.c. You can then use this command to explore the output
|
||||
\fBnursery-canaries\fR
|
||||
If set, objects allocated in the nursery are suffixed with a canary (guard)
|
||||
word, which is checked on each minor collection. Can be used to detect/debug
|
||||
heap corruption issues.
|
||||
heap corruption issues. This disables the usage of the managed allocator,
|
||||
because allocation from full aot code is inconsistent with this option. If
|
||||
the application is guaranteed not to use aot code, the managed allocator can
|
||||
be enabled back with managed-allocator option.
|
||||
|
||||
.TP
|
||||
\fBdo-not-finalize(=\fIclasses\fB)\fR
|
||||
|
||||
@@ -19,8 +19,7 @@ endif
|
||||
|
||||
TEST_HARNESS = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/$(PARENT_PROFILE)nunit-lite-console.exe
|
||||
PLATFORM_DEBUG_FLAGS = /debug:portable
|
||||
# Workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=59967
|
||||
MCS_FLAGS = /features:peverify-compat /langversion:latest
|
||||
MCS_FLAGS = /langversion:latest
|
||||
LIBRARY_FLAGS =
|
||||
ifndef CFLAGS
|
||||
CFLAGS = -g -O2
|
||||
|
||||
@@ -409,6 +409,9 @@ namespace Mono.Debugger.Soft
|
||||
public ErrorCode ErrorCode {
|
||||
get; set;
|
||||
}
|
||||
public string ErrorMessage {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -436,7 +439,7 @@ namespace Mono.Debugger.Soft
|
||||
* with newer runtimes, and vice versa.
|
||||
*/
|
||||
internal const int MAJOR_VERSION = 2;
|
||||
internal const int MINOR_VERSION = 54;
|
||||
internal const int MINOR_VERSION = 57;
|
||||
|
||||
enum WPSuspendPolicy {
|
||||
NONE = 0,
|
||||
@@ -792,10 +795,12 @@ namespace Mono.Debugger.Soft
|
||||
|
||||
// For reply packets
|
||||
offset = 0;
|
||||
ReadInt (); // length
|
||||
var len = ReadInt (); // length
|
||||
ReadInt (); // id
|
||||
ReadByte (); // flags
|
||||
ErrorCode = ReadShort ();
|
||||
if (ErrorCode == (int)Mono.Debugger.Soft.ErrorCode.INVALID_ARGUMENT && connection.Version.AtLeast (2, 56) && len > offset)
|
||||
ErrorMsg = ReadString ();
|
||||
}
|
||||
|
||||
public CommandSet CommandSet {
|
||||
@@ -810,6 +815,10 @@ namespace Mono.Debugger.Soft
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string ErrorMsg {
|
||||
get; internal set;
|
||||
}
|
||||
|
||||
public int Offset {
|
||||
get {
|
||||
return offset;
|
||||
@@ -1792,7 +1801,7 @@ namespace Mono.Debugger.Soft
|
||||
LogPacket (packetId, encoded_packet, reply, command_set, command, watch);
|
||||
if (r.ErrorCode != 0) {
|
||||
if (ErrorHandler != null)
|
||||
ErrorHandler (this, new ErrorHandlerEventArgs () { ErrorCode = (ErrorCode)r.ErrorCode });
|
||||
ErrorHandler (this, new ErrorHandlerEventArgs () { ErrorCode = (ErrorCode)r.ErrorCode, ErrorMessage = r.ErrorMsg});
|
||||
throw new NotImplementedException ("No error handler set.");
|
||||
} else {
|
||||
return r;
|
||||
|
||||
@@ -34,6 +34,11 @@ namespace Mono.Debugger.Soft
|
||||
}
|
||||
}
|
||||
|
||||
public int GetId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public EventType EventType {
|
||||
get {
|
||||
return etype;
|
||||
|
||||
@@ -371,7 +371,7 @@ namespace Mono.Debugger.Soft
|
||||
case ErrorCode.NO_SEQ_POINT_AT_IL_OFFSET:
|
||||
throw new ArgumentException ("Cannot set breakpoint on the specified IL offset.");
|
||||
default:
|
||||
throw new CommandException (args.ErrorCode);
|
||||
throw new CommandException (args.ErrorCode, args.ErrorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -657,7 +657,9 @@ namespace Mono.Debugger.Soft
|
||||
|
||||
internal EventRequest GetRequest (int id) {
|
||||
lock (requests_lock) {
|
||||
return requests [id];
|
||||
EventRequest obj;
|
||||
requests.TryGetValue (id, out obj);
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -885,13 +887,18 @@ namespace Mono.Debugger.Soft
|
||||
|
||||
public class CommandException : Exception {
|
||||
|
||||
internal CommandException (ErrorCode error_code) : base ("Debuggee returned error code " + error_code + ".") {
|
||||
internal CommandException (ErrorCode error_code, string error_message) : base ("Debuggee returned error code " + error_code + (error_message == null || error_message.Length == 0 ? "." : " - " + error_message + ".")) {
|
||||
ErrorCode = error_code;
|
||||
ErrorMessage = error_message;
|
||||
}
|
||||
|
||||
public ErrorCode ErrorCode {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string ErrorMessage {
|
||||
get; internal set;
|
||||
}
|
||||
}
|
||||
|
||||
public class VMNotSuspendedException : InvalidOperationException
|
||||
|
||||
@@ -613,6 +613,11 @@ public class Tests : TestsBase, ITest2
|
||||
pointers2 ();
|
||||
return 0;
|
||||
}
|
||||
if (args.Length >0 && args [0] == "ss_multi_thread") {
|
||||
ss_multi_thread ();
|
||||
return 0;
|
||||
}
|
||||
test_invalid_argument_assembly_get_type ();
|
||||
return 3;
|
||||
}
|
||||
|
||||
@@ -641,6 +646,10 @@ public class Tests : TestsBase, ITest2
|
||||
LocalReflectClass.RunMe ();
|
||||
}
|
||||
|
||||
public static void test_invalid_argument_assembly_get_type () {
|
||||
|
||||
}
|
||||
|
||||
public static void breakpoints () {
|
||||
/* Call these early so it is JITted by the time a breakpoint is placed on it */
|
||||
bp3 ();
|
||||
@@ -861,6 +870,24 @@ public class Tests : TestsBase, ITest2
|
||||
n.Buffer2 = new char4('a', 'b', 'c', 'd');
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_multi_thread () {
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
var t = new Thread(mt_ss);
|
||||
t.Name = "Thread_" + i;
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
static void mt_ss()
|
||||
{
|
||||
int a = 12;
|
||||
int b = 13;
|
||||
int c = 13;
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void test_new_exception_filter () {
|
||||
test_new_exception_filter1();
|
||||
|
||||
@@ -470,7 +470,6 @@ public class DebuggerTests
|
||||
|
||||
var pdbFromMemory = assemblyMirror.GetPdbBlob ();
|
||||
if (!File.Exists (pdbPath)) {
|
||||
Assert.IsFalse (assemblyMirror.HasPdb);
|
||||
Assert.IsTrue (assemblyMirror.HasFetchedPdb);
|
||||
continue;
|
||||
}
|
||||
@@ -5198,8 +5197,101 @@ public class DebuggerTests
|
||||
Assert.IsInstanceOfType (typeof (ArgumentException), ex);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InvalidArgumentAssemblyGetType () {
|
||||
Event e = run_until ("test_invalid_argument_assembly_get_type");
|
||||
var assembly = entry_point.DeclaringType.Assembly;
|
||||
try {
|
||||
var type = assembly.GetType ("System.Collections.Generic.Dictionary<double, float>.Main");
|
||||
}
|
||||
catch (CommandException ex) {
|
||||
Assert.AreEqual(ex.ErrorMessage, "Unexpected assembly-qualified type \"System.Collections.Generic.Dictionary<double, float>.Main\" was provided");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CheckSuspendPolicySentWhenLaunchSuspendYes () {
|
||||
vm.Exit (0);
|
||||
var port = GetFreePort ();
|
||||
|
||||
// Launch the app using server=y,suspend=y
|
||||
var pi = CreateStartInfo (dtest_app_path, "attach", $"--debugger-agent=transport=dt_socket,address=127.0.0.1:{port},server=y,suspend=y");
|
||||
pi.UseShellExecute = false;
|
||||
var process = Diag.Process.Start (pi);
|
||||
|
||||
string failMessage = null;
|
||||
try {
|
||||
vm = ConnectToPort (port);
|
||||
|
||||
vm.EnableEvents (EventType.AssemblyLoad, EventType.ThreadStart);
|
||||
var es = vm.GetNextEventSet ();
|
||||
Assert.AreEqual (es.SuspendPolicy, SuspendPolicy.All);
|
||||
Assert.AreEqual (EventType.VMStart, es[0].EventType);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
failMessage = ex.Message;
|
||||
}
|
||||
finally {
|
||||
vm.Exit (0);
|
||||
vm = null;
|
||||
}
|
||||
if (failMessage != null)
|
||||
Assert.Fail (failMessage);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InvokeSingleStepMultiThread () {
|
||||
vm.Detach ();
|
||||
Start (dtest_app_path, "ss_multi_thread");
|
||||
MethodMirror m = entry_point.DeclaringType.GetMethod ("mt_ss");
|
||||
int firstLineFound = m.Locations [0].LineNumber + 1;
|
||||
int line_first_counter = 5;
|
||||
int line_second_counter = 5;
|
||||
int line_third_counter = 3;
|
||||
Event e = run_until ("ss_multi_thread");
|
||||
EventRequest req = create_step (e);
|
||||
req.Disable ();
|
||||
ReusableBreakpoint breakpoint = new ReusableBreakpoint (this, "mt_ss");
|
||||
breakpoint.Continue ();
|
||||
e = breakpoint.lastEvent;
|
||||
req = create_step (e);
|
||||
while (line_first_counter > 0 || line_second_counter > 0 || line_third_counter > 0) {
|
||||
var thread = e.Thread;
|
||||
var l = thread.GetFrames ()[0].Location;
|
||||
var frame = thread.GetFrames()[0];
|
||||
|
||||
if (l.LineNumber == firstLineFound)
|
||||
line_first_counter--;
|
||||
if (l.LineNumber == firstLineFound + 1)
|
||||
line_second_counter--;
|
||||
if (l.LineNumber == firstLineFound + 2)
|
||||
line_third_counter--;
|
||||
|
||||
if (req.GetId() != breakpoint.req.GetId())
|
||||
req.Disable ();
|
||||
|
||||
req = create_step (e);
|
||||
((StepEventRequest)req).Size = StepSize.Line;
|
||||
try {
|
||||
if ((e.Thread.GetFrames ()[0].Location.LineNumber == firstLineFound + 1 && (e.Thread.Name.Equals("Thread_0") || e.Thread.Name.Equals("Thread_1"))) || l.LineNumber == firstLineFound + 2) {
|
||||
vm.Resume ();
|
||||
e = GetNextEvent ();
|
||||
}
|
||||
else
|
||||
e = step_over_or_breakpoint ();
|
||||
req = e.Request;
|
||||
}
|
||||
catch (Exception z){
|
||||
//expected vmdeath
|
||||
break;
|
||||
}
|
||||
}
|
||||
Assert.AreEqual(0, line_first_counter);
|
||||
Assert.AreEqual(0, line_second_counter);
|
||||
Assert.AreEqual(0, line_third_counter);
|
||||
vm = null;
|
||||
}
|
||||
|
||||
#endif
|
||||
} // class DebuggerTests
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace System.Net.Http
|
||||
{
|
||||
partial class HttpClientHandler : HttpMessageHandler
|
||||
{
|
||||
static IMonoHttpClientHandler CreateDefaultHandler ()
|
||||
{
|
||||
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
|
||||
if (envvar?.StartsWith("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
|
||||
{
|
||||
Type monoWrhType = Type.GetType (envvar, false);
|
||||
if (monoWrhType != null)
|
||||
return (IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType);
|
||||
}
|
||||
|
||||
// Ignore other types of handlers here (e.g. AndroidHttpHandler) to keep the old behavior
|
||||
// and always create SocketsHttpHandler for code like this if MonoWebRequestHandler was not specified:
|
||||
//
|
||||
// var handler = new HttpClientHandler { Credentials = ... };
|
||||
// var httpClient = new HttpClient (handler);
|
||||
//
|
||||
// AndroidHttpHandler is used only when we use the parameterless ctor of HttpClient
|
||||
return new SocketsHttpHandler ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace System.Net.Http
|
||||
TimeSpan? timeout;
|
||||
bool disposed;
|
||||
|
||||
internal MonoWebRequestHandler ()
|
||||
public MonoWebRequestHandler ()
|
||||
{
|
||||
allowAutoRedirect = true;
|
||||
maxAutomaticRedirections = 50;
|
||||
|
||||
@@ -1328,7 +1328,7 @@
|
||||
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamContent.cs" />
|
||||
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamToStreamCopy.cs" />
|
||||
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StringContent.cs" />
|
||||
<Compile Include="HttpClientHandler.SocketsHandler.cs" />
|
||||
<Compile Include="HttpClientHandler.SocketsHandler.Android.cs" />
|
||||
<Compile Include="HttpClientHandler.cs" />
|
||||
<Compile Include="HttpRequestMessage.Mono.cs" />
|
||||
<Compile Include="IMonoHttpClientHandler.cs" />
|
||||
|
||||
@@ -8,27 +8,34 @@ namespace System.Net.Http {
|
||||
|
||||
static HttpMessageHandler CreateDefaultHandler ()
|
||||
{
|
||||
Type type = Type.GetType("Android.Runtime.AndroidEnvironment, Mono.Android");
|
||||
if (type == null)
|
||||
return GetFallback ("Invalid Mono.Android assembly? Cannot find Android.Runtime.AndroidEnvironment");
|
||||
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
|
||||
|
||||
MethodInfo method = type.GetMethod ("GetHttpMessageHandler", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (method == null)
|
||||
return GetFallback ("Your Xamarin.Android version does not support obtaining of the custom HttpClientHandler");
|
||||
if (string.IsNullOrEmpty (envvar))
|
||||
return new HttpClientHandler ();
|
||||
|
||||
object ret = method.Invoke (null, null);
|
||||
if (ret == null)
|
||||
return GetFallback ("Xamarin.Android returned no custom HttpClientHandler");
|
||||
if (envvar?.StartsWith ("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
|
||||
{
|
||||
Type monoWrhType = Type.GetType (envvar, false);
|
||||
if (monoWrhType != null)
|
||||
return new HttpClientHandler ((IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType));
|
||||
|
||||
var handler = ret as HttpMessageHandler;
|
||||
if (handler == null)
|
||||
return GetFallback ($"{ret?.GetType()} is not a valid HttpMessageHandler");
|
||||
return handler;
|
||||
}
|
||||
return new HttpClientHandler ();
|
||||
}
|
||||
|
||||
Type handlerType = Type.GetType (envvar, false);
|
||||
if (handlerType == null && !envvar.Contains (", "))
|
||||
{
|
||||
// if assembly was not specified - look for it in Mono.Android too
|
||||
// (e.g. AndroidHttpHandler is there)
|
||||
handlerType = Type.GetType (envvar + ", Mono.Android", false);
|
||||
}
|
||||
|
||||
if (handlerType == null)
|
||||
return new HttpClientHandler ();
|
||||
|
||||
if (Activator.CreateInstance (handlerType) is HttpMessageHandler msgHandler)
|
||||
return msgHandler;
|
||||
|
||||
static HttpMessageHandler GetFallback (string message)
|
||||
{
|
||||
Console.WriteLine (message + ". Defaulting to System.Net.Http.HttpClientHandler");
|
||||
return new HttpClientHandler ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
HttpClient.DefaultHandler.cs
|
||||
HttpClientHandler.SocketsHandler.cs
|
||||
@@ -1,2 +1,3 @@
|
||||
#include socketshandler.sources
|
||||
System.Net.Http/HttpClient.android.cs
|
||||
HttpClientHandler.SocketsHandler.Android.cs
|
||||
+3
-1
@@ -423,8 +423,10 @@ namespace System.Runtime.Serialization.Json
|
||||
XmlDictionaryString namespaceLocal = null;
|
||||
if (nameLocal != null && nameLocal is string)
|
||||
writer.WriteStartElement ((string) name, null);
|
||||
else
|
||||
else if (name is XmlDictionaryString)
|
||||
writer.WriteStartElement ((XmlDictionaryString) name, null);
|
||||
else
|
||||
writer.WriteStartElement (name.ToString(), null);
|
||||
}
|
||||
|
||||
void WriteEndElement ()
|
||||
|
||||
@@ -429,13 +429,9 @@ namespace System.Xml.Serialization
|
||||
}
|
||||
}
|
||||
|
||||
static Encoding DefaultEncoding = Encoding.Default;
|
||||
|
||||
public void Serialize (Stream stream, object o)
|
||||
{
|
||||
XmlTextWriter xmlWriter = new XmlTextWriter (stream, DefaultEncoding);
|
||||
xmlWriter.Formatting = Formatting.Indented;
|
||||
Serialize (xmlWriter, o, null);
|
||||
Serialize (stream, o, null);
|
||||
}
|
||||
|
||||
public void Serialize (TextWriter textWriter, object o)
|
||||
@@ -452,7 +448,7 @@ namespace System.Xml.Serialization
|
||||
|
||||
public void Serialize (Stream stream, object o, XmlSerializerNamespaces namespaces)
|
||||
{
|
||||
XmlTextWriter xmlWriter = new XmlTextWriter (stream, DefaultEncoding);
|
||||
XmlTextWriter xmlWriter = new XmlTextWriter (stream, Encoding.UTF8);
|
||||
xmlWriter.Formatting = Formatting.Indented;
|
||||
Serialize (xmlWriter, o, namespaces);
|
||||
}
|
||||
|
||||
@@ -2676,6 +2676,19 @@ namespace MonoTests.System.XmlSerialization
|
||||
Assert.AreEqual ("<:GenComplexStructOfInt32String http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:something>123</><:simpleclass><:something>456</></><:simplestruct><:something>789</></><:listclass><:somelist><:int>100</><:int>200</></></><:arrayclass><:arr><:int>11</><:int>22</><:int>33</></></><:twoclass><:something1>10</><:something2>Ten</></><:derivedclass><:something1>two</><:something2>2</><:another1>1</><:another2>one</></><:derived2><:something1>4</><:something2>four</><:another1>3</><:another2>three</></><:nestedouter><:outer>5</></><:nestedinner><:inner>six</><:something>6</></></>", WriterText);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSerializeStreamPreserveUTFChars () {
|
||||
string foo = "BÄR";
|
||||
XmlSerializer serializer = new XmlSerializer (typeof (string));
|
||||
|
||||
MemoryStream stream = new MemoryStream ();
|
||||
|
||||
serializer.Serialize (stream, foo);
|
||||
stream.Position = 0;
|
||||
foo = (string) serializer.Deserialize (stream);
|
||||
Assert.AreEqual("BÄR", foo);
|
||||
}
|
||||
|
||||
[Test] // bug #80759
|
||||
public void HasNullableField ()
|
||||
{
|
||||
|
||||
@@ -488,6 +488,26 @@ namespace System.Net.Security
|
||||
return Impl.WriteAsync (buffer, offset, count, cancellationToken);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
return TaskToApm.Begin (Impl.ReadAsync (buffer, offset, count), callback, state);
|
||||
}
|
||||
|
||||
public override int EndRead (IAsyncResult asyncResult)
|
||||
{
|
||||
return TaskToApm.End<int> (asyncResult);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
return TaskToApm.Begin (Impl.WriteAsync (buffer, offset, count), callback, state);
|
||||
}
|
||||
|
||||
public override void EndWrite (IAsyncResult asyncResult)
|
||||
{
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
#else // !SECURITY_DEP
|
||||
const string EXCEPTION_MESSAGE = "System.Net.Security.SslStream is not supported on the current platform.";
|
||||
|
||||
|
||||
@@ -237,8 +237,12 @@ namespace System.Net {
|
||||
}
|
||||
|
||||
if (ProcessInput (ms)) {
|
||||
if (!context.HaveError)
|
||||
context.Request.FinishInitialization ();
|
||||
if (!context.HaveError) {
|
||||
if (!context.Request.FinishInitialization()) {
|
||||
Close (true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.HaveError) {
|
||||
SendError ();
|
||||
|
||||
@@ -192,12 +192,12 @@ namespace System.Net {
|
||||
return false;
|
||||
}
|
||||
|
||||
internal void FinishInitialization ()
|
||||
internal bool FinishInitialization ()
|
||||
{
|
||||
string host = UserHostName;
|
||||
if (version > HttpVersion.Version10 && (host == null || host.Length == 0)) {
|
||||
context.ErrorMessage = "Invalid host name";
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
string path;
|
||||
@@ -223,7 +223,7 @@ namespace System.Net {
|
||||
|
||||
if (!Uri.TryCreate (base_uri + path, UriKind.Absolute, out url)){
|
||||
context.ErrorMessage = WebUtility.HtmlEncode ("Invalid url: " + base_uri + path);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
CreateQueryString (url.Query);
|
||||
@@ -239,7 +239,7 @@ namespace System.Net {
|
||||
// 'identity' is not valid!
|
||||
if (t_encoding != null && !is_chunked) {
|
||||
context.Connection.SendError (null, 501);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace System.Net {
|
||||
if (String.Compare (method, "POST", StringComparison.OrdinalIgnoreCase) == 0 ||
|
||||
String.Compare (method, "PUT", StringComparison.OrdinalIgnoreCase) == 0) {
|
||||
context.Connection.SendError (null, 411);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,6 +255,8 @@ namespace System.Net {
|
||||
ResponseStream output = context.Connection.GetResponseStream ();
|
||||
output.InternalWrite (_100continue, 0, _100continue.Length);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
internal static string Unquote (String str) {
|
||||
|
||||
@@ -630,28 +630,28 @@
|
||||
<method signature="System.Void .ctor(System.String)" />
|
||||
</type>
|
||||
|
||||
<type fullname="System.Reflection.Emit.AssemblyBuilder" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ConstructorBuilder" preserve="fields" required="false" feature="sre"/>
|
||||
<type fullname="System.Reflection.Emit.DynamicMethod" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.AssemblyBuilder" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ConstructorBuilder" preserve="fields" feature="sre"/>
|
||||
<type fullname="System.Reflection.Emit.DynamicMethod" preserve="fields" feature="sre" />
|
||||
<!-- mono_dynamic_image_register_token -->
|
||||
<type fullname="System.Reflection.Emit.EnumBuilder" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.EventBuilder" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.FieldBuilder" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.EnumBuilder" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.EventBuilder" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.FieldBuilder" preserve="fields" feature="sre" />
|
||||
<type
|
||||
fullname="System.Reflection.Emit.GenericTypeParameterBuilder" preserve="fields" required="false" feature="sre" />
|
||||
fullname="System.Reflection.Emit.GenericTypeParameterBuilder" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ILExceptionBlock" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ILExceptionInfo" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ILGenerator" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.LocalBuilder" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ModuleBuilder" preserve="fields" required="false" feature="sre">
|
||||
<type fullname="System.Reflection.Emit.ILGenerator" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.LocalBuilder" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ModuleBuilder" preserve="fields" feature="sre">
|
||||
</type>
|
||||
<type fullname="System.Reflection.Emit.MonoResource" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ParameterBuilder" preserve="nothing" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.PropertyBuilder" preserve="nothing" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.SignatureHelper" preserve="nothing" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.TypeBuilder" preserve="fields" required="false" feature="sre">
|
||||
<type fullname="System.Reflection.Emit.MonoResource" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ParameterBuilder" preserve="nothing" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.PropertyBuilder" preserve="nothing" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.SignatureHelper" preserve="nothing" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.TypeBuilder" preserve="fields" feature="sre">
|
||||
<method name="SetCharSet" feature="sre" />
|
||||
<!-- reflection.c mono_reflection_call_is_assignable_to () -->
|
||||
<method name="IsAssignableTo" feature="sre" />
|
||||
@@ -660,12 +660,12 @@
|
||||
<method name="DefineCustom" feature="sre" />
|
||||
<method name="DefineLPArrayInternal" feature="sre" />
|
||||
</type>
|
||||
<type fullname="System.Reflection.Emit.ArrayType" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ByRefType" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.PointerType" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.FieldOnTypeBuilderInst" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.MethodOnTypeBuilderInst" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ConstructorOnTypeBuilderInst" preserve="fields" required="false" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ArrayType" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ByRefType" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.PointerType" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.FieldOnTypeBuilderInst" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.MethodOnTypeBuilderInst" preserve="fields" feature="sre" />
|
||||
<type fullname="System.Reflection.Emit.ConstructorOnTypeBuilderInst" preserve="fields" feature="sre" />
|
||||
|
||||
<!-- exception.c: mono_get_exception_runtime_wrapped () -->
|
||||
<type fullname="System.Runtime.CompilerServices.RuntimeWrappedException">
|
||||
|
||||
@@ -6,7 +6,7 @@ export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
|
||||
LIBRARY = corlib.dll
|
||||
LIBRARY_NAME = mscorlib.dll
|
||||
|
||||
LIB_MCS_FLAGS = $(REFERENCE_SOURCES_FLAGS) $(RESOURCE_FILES:%=-resource:%)
|
||||
LIB_MCS_FLAGS = $(REFERENCE_SOURCES_FLAGS) $(RESOURCE_FILES:%=-resource:%) $(UNICODECHARINFO:%=-resource:%)
|
||||
|
||||
USE_XTEST_REMOTE_EXECUTOR = YES
|
||||
LIBRARY_WARN_AS_ERROR = yes
|
||||
@@ -95,7 +95,6 @@ else
|
||||
endif
|
||||
|
||||
RESOURCE_FILES = \
|
||||
$(UNICODECHARINFO) \
|
||||
$(MANAGED_COLLATOR_RESOURCES_FILES) \
|
||||
LinkerDescriptor/mscorlib.xml
|
||||
|
||||
@@ -207,6 +206,7 @@ EXTRA_DISTFILES = \
|
||||
$(RESOURCE_FILES) \
|
||||
$(TEST_RESOURCE_FILES) \
|
||||
$(TEST_RESOURCES:.resources=.resx) \
|
||||
resources/charinfo.nlp \
|
||||
LinkerDescriptor/mscorlib_test.xml
|
||||
|
||||
TEST_RESOURCE_FILES = \
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -255,6 +256,43 @@ namespace Mono {
|
||||
}
|
||||
}
|
||||
|
||||
static string get_breadcrumb_value (string file_prefix, string directory_str, bool clear)
|
||||
{
|
||||
var allfiles = Directory.GetFiles (directory_str, $"{file_prefix}_*" );
|
||||
if (allfiles.Length == 0)
|
||||
return string.Empty;
|
||||
|
||||
if (allfiles.Length > 1) {
|
||||
// it's impossible to tell which breadcrumb is the last one (let's not trust filesystem timestamps)
|
||||
// delete the multiple files so at least next crash can make sense
|
||||
try {
|
||||
Array.ForEach (allfiles, f => File.Delete (f) );
|
||||
} catch (Exception) { }
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
if (clear)
|
||||
File.Delete (allfiles [0]);
|
||||
|
||||
var filename = Path.GetFileName (allfiles [0]);
|
||||
return filename.Substring (file_prefix.Length + 1);
|
||||
}
|
||||
|
||||
static long CheckCrashReportHash (string directory_str, bool clear)
|
||||
{
|
||||
var value = get_breadcrumb_value ("crash_hash", directory_str, clear);
|
||||
if (value == string.Empty)
|
||||
return 0;
|
||||
else
|
||||
return Convert.ToInt64 (value, 16);
|
||||
}
|
||||
|
||||
static string CheckCrashReportReason (string directory_str, bool clear)
|
||||
{
|
||||
return get_breadcrumb_value ("crash_reason", directory_str, clear);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern void AnnotateMicrosoftTelemetry_internal (IntPtr key, IntPtr val);
|
||||
|
||||
|
||||
@@ -186,7 +186,11 @@ namespace System
|
||||
{
|
||||
try {
|
||||
// TODO: Should use __ConsoleStream from reference sources
|
||||
return new FileStream (handle, access, false, bufferSize, false, true);
|
||||
var stream = new FileStream (handle, access, false, bufferSize, false, true);
|
||||
// Don't run the finalizer on the underlying stream so that System.WriteLine can be
|
||||
// called inside a finalizer during shutdown or domain unload.
|
||||
GC.SuppressFinalize (stream);
|
||||
return stream;
|
||||
} catch (IOException) {
|
||||
return Stream.Null;
|
||||
}
|
||||
|
||||
@@ -612,7 +612,8 @@ namespace System {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
} catch (FileNotFoundException) {
|
||||
}
|
||||
|
||||
return Path.Combine (home_dir, fallback);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.ExceptionServices;
|
||||
|
||||
namespace Internal.Runtime.Augments {
|
||||
partial class RuntimeAugments {
|
||||
@@ -7,7 +8,8 @@ namespace Internal.Runtime.Augments {
|
||||
|
||||
public static void ReportUnhandledException (Exception exception)
|
||||
{
|
||||
throw exception;
|
||||
var edi = ExceptionDispatchInfo.Capture (exception);
|
||||
edi.Throw ();
|
||||
}
|
||||
|
||||
internal static ReflectionExecutionDomainCallbacks Callbacks => s_reflectionExecutionDomainCallbacks;
|
||||
@@ -19,4 +21,4 @@ namespace Internal.Runtime.Augments {
|
||||
return new MissingMetadataException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ endif
|
||||
|
||||
LINKER_OUTPUT := illink-output-$(PROFILE_DIRECTORY)
|
||||
PROFILE_PATH = $(topdir)/class/lib/$(PROFILE_DIRECTORY)
|
||||
LINKER = MONO_PATH=$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe -c link -out $(LINKER_OUTPUT) -b true -d $(PROFILE_PATH)
|
||||
LINKER = MONO_PATH=$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe -c link -o $(LINKER_OUTPUT) -b true -d $(PROFILE_PATH)
|
||||
LINKER_DEFAULT = $(LINKER) -l none $(LINKER_PROFILE_OPTIONS)
|
||||
TEST_EXEC = MONO_PATH=$(LINKER_OUTPUT) $(RUNTIME) $(RUNTIME_FLAGS) --debug -O=-aot
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
App,mscorlib.dll,System.dll,System.Core.dll,System.Xml.dll,I18N.CJK.dll,I18N.MidEast.dll,I18N.Other.dll,I18N.Rare.dll,I18N.West.dll,I18N.dll,Microsoft.CSharp.dll,System.ComponentModel.Composition.dll,System.ComponentModel.DataAnnotations.dll,System.Data.DataSetExtensions.dll,System.Data.Services.Client.dll,System.Data.dll,System.IO.Compression.FileSystem.dll,System.IO.Compression.dll,System.IdentityModel.dll,System.Json.dll,System.Net.Http.WinHttpHandler.dll,System.Net.Http.dll,System.Net.dll,System.Numerics.Vectors.dll,System.Numerics.dll,System.Reflection.Context.dll,System.Runtime.CompilerServices.Unsafe.dll,System.Runtime.Serialization.dll,System.Security.dll,System.ServiceModel.Internals.dll,System.ServiceModel.Web.dll,System.ServiceModel.dll,System.Transactions.dll,System.Web.Services.dll,System.Windows.dll,System.Xml.Linq.dll,System.Xml.Serialization.dll
|
||||
Newtonsoft.Json.Test/bin/iPhoneSimulator/Release/Newtonsoft.Json.Test.exe,1817088,720384,369152,420864,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35840,0,0,0,0,0,0,0,0,0,0,30720,0
|
||||
System.Core/test-plinq-01.exe,941056,13824,60928,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
System.Net.Http/test-handler-01.exe,1389568,86016,8192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10240,0,0,25600,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
System.Net.Http/test-handler-01.exe,1390080,86016,8192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10240,0,0,25600,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
System/test-security.exe,1382912,64000,8192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25600,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
System/test-typeconverter.exe,1033216,80384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-array.exe,874496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-calendar-01.exe,874496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-calendar-02.exe,874496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-crypto-01.exe,874496,0,4608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-crypto-01.exe,875008,0,4608,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-exception-01.exe,874496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-locale-01.exe,878080,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-methodimpl-01.exe,874496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
App,mscorlib.dll,System.dll,System.Core.dll,System.Xml.dll,I18N.CJK.dll,I18N.MidEast.dll,I18N.Other.dll,I18N.Rare.dll,I18N.West.dll,I18N.dll,Microsoft.CSharp.dll,System.ComponentModel.Composition.dll,System.ComponentModel.DataAnnotations.dll,System.Data.DataSetExtensions.dll,System.Data.dll,System.IO.Compression.FileSystem.dll,System.IO.Compression.dll,System.Net.Http.dll,System.Numerics.Vectors.dll,System.Numerics.dll,System.Runtime.CompilerServices.Unsafe.dll,System.Runtime.Serialization.dll,System.Security.dll,System.ServiceModel.Internals.dll,System.Transactions.dll,System.Xml.Linq.dll
|
||||
BlazingPizza.Client/bin/Release/netstandard2.0/BlazingPizza.Client.dll,1120256,67072,286208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,3072,0,0,0,0,0
|
||||
HelloWorld/bin/Release/netstandard2.0/dist/_framework/_bin/HelloWorld.dll,1107968,67072,284672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,0,0,0,0,0,0
|
||||
Microsoft.AspNetCore.Blazor.E2EPerformance/bin/Release/netstandard2.0/Microsoft.AspNetCore.Blazor.E2EPerformance.dll,1154048,68608,286208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,0,0,0,0,0,0
|
||||
Newtonsoft/bin/Release/netstandard2.0/dist/_framework/_bin/Newtonsoft.dll,1107968,67072,284672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,0,0,0,0,0,0
|
||||
BlazingPizza.Client/bin/Release/netstandard2.0/BlazingPizza.Client.dll,1121280,67072,286208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,3072,0,0,0,0,0
|
||||
HelloWorld/bin/Release/netstandard2.0/dist/_framework/_bin/HelloWorld.dll,1108480,67072,284672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,0,0,0,0,0,0
|
||||
Microsoft.AspNetCore.Blazor.E2EPerformance/bin/Release/netstandard2.0/Microsoft.AspNetCore.Blazor.E2EPerformance.dll,1154560,68608,286208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,0,0,0,0,0,0
|
||||
Newtonsoft/bin/Release/netstandard2.0/dist/_framework/_bin/Newtonsoft.dll,1108992,67072,284672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,0,0,0,0,0,0,0
|
||||
System.Core/test-plinq-01.exe,535040,12288,60928,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
System.Net.Http/test-handler-01.exe,712704,38400,7168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6656,0,0,0,0,0,0,0,0
|
||||
System/test-security.exe,1037312,60416,26624,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25600,0,0,0,0,0,0
|
||||
System.Net.Http/test-handler-01.exe,713216,38400,7168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6656,0,0,0,0,0,0,0,0
|
||||
System/test-security.exe,1037824,60416,26624,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25600,0,0,0,0,0,0
|
||||
System/test-typeconverter.exe,648192,78848,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-array.exe,451584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-calendar-01.exe,451584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
@@ -15,7 +15,7 @@ mscorlib/test-exception-01.exe,451584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
mscorlib/test-locale-01.exe,459776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-methodimpl-01.exe,451584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-reflection-01.exe,451584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-reflection-02.exe,463360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-reflection-02.exe,487936,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-reflection-03.exe,599040,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-reflection-04.exe,463360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
mscorlib/test-string-01.exe,451584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
|
||||
|
@@ -130,13 +130,11 @@ libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\"
|
||||
#
|
||||
# Support is a separate library because it is not valid C++.
|
||||
#
|
||||
if !ENABLE_NETCORE
|
||||
support_libraries = libmonoruntime-support.la
|
||||
|
||||
libmonoruntime_support_la_SOURCES = support.c
|
||||
libmonoruntime_support_la_LDFLAGS = $(Z_LIBS)
|
||||
libmonoruntime_support_la_CFLAGS = $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @ZLIB_CFLAGS@
|
||||
endif
|
||||
|
||||
#
|
||||
# This library contains the icall tables if the runtime was configured with --disable-icall-tables
|
||||
|
||||
+106
-106
@@ -2537,6 +2537,11 @@ apply_override (MonoClass *klass, MonoClass *override_class, MonoMethod **vtable
|
||||
}
|
||||
|
||||
dslot += mono_class_interface_offset (klass, decl->klass);
|
||||
|
||||
//check if the override comes from an interface and the overrided method is from a class, if this is the case it shouldn't be changed
|
||||
if (vtable [dslot] && vtable [dslot]->klass && MONO_CLASS_IS_INTERFACE_INTERNAL (override->klass) && !MONO_CLASS_IS_INTERFACE_INTERNAL (vtable [dslot]->klass))
|
||||
return TRUE;
|
||||
|
||||
vtable [dslot] = override;
|
||||
if (!MONO_CLASS_IS_INTERFACE_INTERNAL (override->klass)) {
|
||||
/*
|
||||
@@ -2856,6 +2861,102 @@ print_vtable_layout_result (MonoClass *klass, MonoMethod **vtable, int cur_slot)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* LOCKING: this is supposed to be called with the loader lock held.
|
||||
*/
|
||||
static int
|
||||
setup_class_vtsize (MonoClass *klass, GList *in_setup, int *cur_slot, int *stelemref_slot, MonoError *error)
|
||||
{
|
||||
GPtrArray *ifaces = NULL;
|
||||
int i, max_vtsize = 0;
|
||||
ifaces = mono_class_get_implemented_interfaces (klass, error);
|
||||
if (!is_ok (error)) {
|
||||
char *name = mono_type_get_full_name (klass);
|
||||
mono_class_set_type_load_failure (klass, "Could not resolve %s interfaces due to %s", name, mono_error_get_message (error));
|
||||
g_free (name);
|
||||
mono_error_cleanup (error);
|
||||
return -1;
|
||||
} else if (ifaces) {
|
||||
for (i = 0; i < ifaces->len; i++) {
|
||||
MonoClass *ic = (MonoClass *)g_ptr_array_index (ifaces, i);
|
||||
max_vtsize += mono_class_get_method_count (ic);
|
||||
}
|
||||
g_ptr_array_free (ifaces, TRUE);
|
||||
ifaces = NULL;
|
||||
}
|
||||
|
||||
if (klass->parent) {
|
||||
mono_class_init_internal (klass->parent);
|
||||
mono_class_setup_vtable_full (klass->parent, in_setup);
|
||||
|
||||
if (mono_class_set_type_load_failure_causedby_class (klass, klass->parent, "Parent class failed to load"))
|
||||
return -1;
|
||||
|
||||
max_vtsize += klass->parent->vtable_size;
|
||||
*cur_slot = klass->parent->vtable_size;
|
||||
}
|
||||
|
||||
max_vtsize += mono_class_get_method_count (klass);
|
||||
|
||||
/*Array have a slot for stelemref*/
|
||||
if (mono_class_need_stelemref_method (klass)) {
|
||||
*stelemref_slot = *cur_slot;
|
||||
++max_vtsize;
|
||||
++*cur_slot;
|
||||
}
|
||||
return max_vtsize;
|
||||
}
|
||||
|
||||
/*
|
||||
* LOCKING: this is supposed to be called with the loader lock held.
|
||||
*/
|
||||
static void
|
||||
mono_class_setup_vtable_ginst (MonoClass *klass, GList *in_setup)
|
||||
{
|
||||
ERROR_DECL (error);
|
||||
int i;
|
||||
MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
|
||||
MonoMethod **tmp;
|
||||
|
||||
mono_class_setup_vtable_full (gklass, in_setup);
|
||||
if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Could not load generic definition"))
|
||||
return;
|
||||
|
||||
tmp = (MonoMethod **)mono_class_alloc0 (klass, sizeof (gpointer) * gklass->vtable_size);
|
||||
klass->vtable_size = gklass->vtable_size;
|
||||
for (i = 0; i < gklass->vtable_size; ++i)
|
||||
if (gklass->vtable [i]) {
|
||||
MonoMethod *inflated = mono_class_inflate_generic_method_full_checked (gklass->vtable [i], klass, mono_class_get_context (klass), error);
|
||||
if (!is_ok (error)) {
|
||||
char *name = mono_type_get_full_name (klass);
|
||||
mono_class_set_type_load_failure (klass, "VTable setup of type %s failed due to: %s", name, mono_error_get_message (error));
|
||||
mono_error_cleanup (error);
|
||||
g_free (name);
|
||||
return;
|
||||
}
|
||||
tmp [i] = inflated;
|
||||
tmp [i]->slot = gklass->vtable [i]->slot;
|
||||
}
|
||||
mono_memory_barrier ();
|
||||
klass->vtable = tmp;
|
||||
|
||||
mono_loader_lock ();
|
||||
klass->has_dim_conflicts = gklass->has_dim_conflicts;
|
||||
mono_loader_unlock ();
|
||||
|
||||
/* Have to set method->slot for abstract virtual methods */
|
||||
if (klass->methods && gklass->methods) {
|
||||
int mcount = mono_class_get_method_count (klass);
|
||||
for (i = 0; i < mcount; ++i)
|
||||
if (klass->methods [i]->slot == -1)
|
||||
klass->methods [i]->slot = gklass->methods [i]->slot;
|
||||
}
|
||||
|
||||
if (mono_print_vtable)
|
||||
print_vtable_layout_result (klass, klass->vtable, gklass->vtable_size);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* LOCKING: this is supposed to be called with the loader lock held.
|
||||
*/
|
||||
@@ -2866,7 +2967,6 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
|
||||
MonoClass *k, *ic;
|
||||
MonoMethod **vtable = NULL;
|
||||
int i, max_vtsize = 0, cur_slot = 0;
|
||||
GPtrArray *ifaces = NULL;
|
||||
GHashTable *override_map = NULL;
|
||||
GHashTable *override_class_map = NULL;
|
||||
GHashTable *conflict_map = NULL;
|
||||
@@ -2883,44 +2983,10 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
|
||||
if (overrides && !verify_class_overrides (klass, overrides, onum))
|
||||
return;
|
||||
|
||||
ifaces = mono_class_get_implemented_interfaces (klass, error);
|
||||
if (!is_ok (error)) {
|
||||
char *name = mono_type_get_full_name (klass);
|
||||
mono_class_set_type_load_failure (klass, "Could not resolve %s interfaces due to %s", name, mono_error_get_message (error));
|
||||
g_free (name);
|
||||
mono_error_cleanup (error);
|
||||
max_vtsize = setup_class_vtsize (klass, in_setup, &cur_slot, &stelemref_slot, error);
|
||||
if (max_vtsize == -1)
|
||||
return;
|
||||
} else if (ifaces) {
|
||||
for (i = 0; i < ifaces->len; i++) {
|
||||
MonoClass *ic = (MonoClass *)g_ptr_array_index (ifaces, i);
|
||||
max_vtsize += mono_class_get_method_count (ic);
|
||||
}
|
||||
g_ptr_array_free (ifaces, TRUE);
|
||||
ifaces = NULL;
|
||||
}
|
||||
|
||||
if (klass->parent) {
|
||||
mono_class_init_internal (klass->parent);
|
||||
mono_class_setup_vtable_full (klass->parent, in_setup);
|
||||
|
||||
if (mono_class_set_type_load_failure_causedby_class (klass, klass->parent, "Parent class failed to load"))
|
||||
return;
|
||||
|
||||
max_vtsize += klass->parent->vtable_size;
|
||||
cur_slot = klass->parent->vtable_size;
|
||||
}
|
||||
|
||||
max_vtsize += mono_class_get_method_count (klass);
|
||||
|
||||
/*Array have a slot for stelemref*/
|
||||
if (mono_class_need_stelemref_method (klass)) {
|
||||
stelemref_slot = cur_slot;
|
||||
++max_vtsize;
|
||||
++cur_slot;
|
||||
}
|
||||
|
||||
/* printf ("METAINIT %s.%s\n", klass->name_space, klass->name); */
|
||||
|
||||
cur_slot = setup_interface_offsets (klass, cur_slot, TRUE);
|
||||
if (cur_slot == -1) /*setup_interface_offsets fails the type.*/
|
||||
return;
|
||||
@@ -2929,80 +2995,14 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
|
||||
|
||||
/* Optimized version for generic instances */
|
||||
if (mono_class_is_ginst (klass)) {
|
||||
ERROR_DECL (error);
|
||||
MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
|
||||
MonoMethod **tmp;
|
||||
|
||||
mono_class_setup_vtable_full (gklass, in_setup);
|
||||
if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Could not load generic definition"))
|
||||
return;
|
||||
|
||||
tmp = (MonoMethod **)mono_class_alloc0 (klass, sizeof (gpointer) * gklass->vtable_size);
|
||||
klass->vtable_size = gklass->vtable_size;
|
||||
for (i = 0; i < gklass->vtable_size; ++i)
|
||||
if (gklass->vtable [i]) {
|
||||
MonoMethod *inflated = mono_class_inflate_generic_method_full_checked (gklass->vtable [i], klass, mono_class_get_context (klass), error);
|
||||
goto_if_nok (error, fail);
|
||||
tmp [i] = inflated;
|
||||
tmp [i]->slot = gklass->vtable [i]->slot;
|
||||
}
|
||||
mono_memory_barrier ();
|
||||
klass->vtable = tmp;
|
||||
|
||||
mono_loader_lock ();
|
||||
klass->has_dim_conflicts = gklass->has_dim_conflicts;
|
||||
mono_loader_unlock ();
|
||||
|
||||
/* Have to set method->slot for abstract virtual methods */
|
||||
if (klass->methods && gklass->methods) {
|
||||
int mcount = mono_class_get_method_count (klass);
|
||||
for (i = 0; i < mcount; ++i)
|
||||
if (klass->methods [i]->slot == -1)
|
||||
klass->methods [i]->slot = gklass->methods [i]->slot;
|
||||
}
|
||||
|
||||
if (mono_print_vtable)
|
||||
print_vtable_layout_result (klass, klass->vtable, gklass->vtable_size);
|
||||
|
||||
mono_class_setup_vtable_ginst (klass, in_setup);
|
||||
return;
|
||||
}
|
||||
|
||||
vtable = (MonoMethod **)g_malloc0 (sizeof (gpointer) * max_vtsize);
|
||||
|
||||
if (klass->parent && klass->parent->vtable_size) {
|
||||
MonoClass *parent = klass->parent;
|
||||
int i;
|
||||
|
||||
memcpy (vtable, parent->vtable, sizeof (gpointer) * parent->vtable_size);
|
||||
|
||||
// Also inherit parent interface vtables, just as a starting point.
|
||||
// This is needed otherwise bug-77127.exe fails when the property methods
|
||||
// have different names in the iterface and the class, because for child
|
||||
// classes the ".override" information is not used anymore.
|
||||
for (i = 0; i < parent->interface_offsets_count; i++) {
|
||||
MonoClass *parent_interface = parent->interfaces_packed [i];
|
||||
int interface_offset = mono_class_interface_offset (klass, parent_interface);
|
||||
/*FIXME this is now dead code as this condition will never hold true.
|
||||
Since interface offsets are inherited then the offset of an interface implemented
|
||||
by a parent will never be the out of it's vtable boundary.
|
||||
*/
|
||||
if (interface_offset >= parent->vtable_size) {
|
||||
int parent_interface_offset = mono_class_interface_offset (parent, parent_interface);
|
||||
int j;
|
||||
|
||||
mono_class_setup_methods (parent_interface); /*FIXME Just kill this whole chunk of dead code*/
|
||||
TRACE_INTERFACE_VTABLE (printf (" +++ Inheriting interface %s.%s\n", parent_interface->name_space, parent_interface->name));
|
||||
int mcount = mono_class_get_method_count (parent_interface);
|
||||
for (j = 0; j < mcount && !mono_class_has_failure (klass); j++) {
|
||||
vtable [interface_offset + j] = parent->vtable [parent_interface_offset + j];
|
||||
TRACE_INTERFACE_VTABLE (printf (" --- Inheriting: [%03d][(%03d)+(%03d)] => [%03d][(%03d)+(%03d)]\n",
|
||||
parent_interface_offset + j, parent_interface_offset, j,
|
||||
interface_offset + j, interface_offset, j));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (klass->parent && klass->parent->vtable_size)
|
||||
memcpy (vtable, klass->parent->vtable, sizeof (gpointer) * klass->parent->vtable_size);
|
||||
|
||||
/*Array have a slot for stelemref*/
|
||||
if (mono_class_need_stelemref_method (klass)) {
|
||||
|
||||
@@ -46,13 +46,6 @@ typedef enum {
|
||||
MONO_WRAPPER_NUM
|
||||
} MonoWrapperType;
|
||||
|
||||
typedef enum {
|
||||
MONO_TYPE_NAME_FORMAT_IL,
|
||||
MONO_TYPE_NAME_FORMAT_REFLECTION,
|
||||
MONO_TYPE_NAME_FORMAT_FULL_NAME,
|
||||
MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
|
||||
} MonoTypeNameFormat;
|
||||
|
||||
typedef enum {
|
||||
MONO_REMOTING_TARGET_UNKNOWN,
|
||||
MONO_REMOTING_TARGET_APPDOMAIN,
|
||||
@@ -1150,9 +1143,6 @@ mono_class_get_exception_for_failure (MonoClass *klass);
|
||||
char*
|
||||
mono_identifier_escape_type_name_chars (const char* identifier);
|
||||
|
||||
char*
|
||||
mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format);
|
||||
|
||||
char*
|
||||
mono_type_get_full_name (MonoClass *klass);
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@ typedef struct _MonoClassField MonoClassField;
|
||||
typedef struct _MonoProperty MonoProperty;
|
||||
typedef struct _MonoEvent MonoEvent;
|
||||
|
||||
typedef enum {
|
||||
MONO_TYPE_NAME_FORMAT_IL,
|
||||
MONO_TYPE_NAME_FORMAT_REFLECTION,
|
||||
MONO_TYPE_NAME_FORMAT_FULL_NAME,
|
||||
MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
|
||||
} MonoTypeNameFormat;
|
||||
|
||||
MONO_API MONO_RT_EXTERNAL_ONLY
|
||||
MonoClass *
|
||||
mono_class_get (MonoImage *image, uint32_t type_token);
|
||||
@@ -130,6 +137,9 @@ MONO_API MONO_RT_EXTERNAL_ONLY
|
||||
void*
|
||||
mono_ldtoken (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context);
|
||||
|
||||
MONO_API char *
|
||||
mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format);
|
||||
|
||||
MONO_API char*
|
||||
mono_type_get_name (MonoType *type);
|
||||
|
||||
|
||||
@@ -1606,7 +1606,7 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ig
|
||||
guint32 cols [MONO_CUSTOM_ATTR_SIZE];
|
||||
MonoTableInfo *ca;
|
||||
MonoCustomAttrInfo *ainfo;
|
||||
GList *tmp, *list = NULL;
|
||||
GArray *attr_array;
|
||||
const char *data;
|
||||
MonoCustomAttrEntry* attr;
|
||||
|
||||
@@ -1618,20 +1618,24 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ig
|
||||
if (!i)
|
||||
return NULL;
|
||||
i --;
|
||||
// initial size chosen arbitrarily, but default is 16 which is rather small
|
||||
attr_array = g_array_sized_new (TRUE, TRUE, sizeof (guint32), 128);
|
||||
while (i < ca->rows) {
|
||||
if (mono_metadata_decode_row_col (ca, i, MONO_CUSTOM_ATTR_PARENT) != idx)
|
||||
break;
|
||||
list = g_list_prepend (list, GUINT_TO_POINTER (i));
|
||||
attr_array = g_array_append_val (attr_array, i);
|
||||
++i;
|
||||
}
|
||||
len = g_list_length (list);
|
||||
if (!len)
|
||||
len = attr_array->len;
|
||||
if (!len) {
|
||||
g_array_free (attr_array, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
ainfo = (MonoCustomAttrInfo *)g_malloc0 (MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * len);
|
||||
ainfo->num_attrs = len;
|
||||
ainfo->image = image;
|
||||
for (i = len, tmp = list; i != 0; --i, tmp = tmp->next) {
|
||||
mono_metadata_decode_row (ca, GPOINTER_TO_UINT (tmp->data), cols, MONO_CUSTOM_ATTR_SIZE);
|
||||
for (i = 0; i < len; ++i) {
|
||||
mono_metadata_decode_row (ca, g_array_index (attr_array, guint32, i), cols, MONO_CUSTOM_ATTR_SIZE);
|
||||
mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> MONO_CUSTOM_ATTR_TYPE_BITS;
|
||||
switch (cols [MONO_CUSTOM_ATTR_TYPE] & MONO_CUSTOM_ATTR_TYPE_MASK) {
|
||||
case MONO_CUSTOM_ATTR_TYPE_METHODDEF:
|
||||
@@ -1644,7 +1648,7 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ig
|
||||
g_error ("Unknown table for custom attr type %08x", cols [MONO_CUSTOM_ATTR_TYPE]);
|
||||
break;
|
||||
}
|
||||
attr = &ainfo->attrs [i - 1];
|
||||
attr = &ainfo->attrs [i];
|
||||
attr->ctor = mono_get_method_checked (image, mtoken, NULL, NULL, error);
|
||||
if (!attr->ctor) {
|
||||
g_warning ("Can't find custom attr constructor image: %s mtoken: 0x%08x due to: %s", image->name, mtoken, mono_error_get_message (error));
|
||||
@@ -1652,14 +1656,14 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ig
|
||||
mono_error_cleanup (error);
|
||||
error_init (error);
|
||||
} else {
|
||||
g_list_free (list);
|
||||
g_array_free (attr_array, TRUE);
|
||||
g_free (ainfo);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mono_verifier_verify_cattr_blob (image, cols [MONO_CUSTOM_ATTR_VALUE], error)) {
|
||||
g_list_free (list);
|
||||
g_array_free (attr_array, TRUE);
|
||||
g_free (ainfo);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1667,7 +1671,7 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ig
|
||||
attr->data_size = mono_metadata_decode_value (data, &data);
|
||||
attr->data = (guchar*)data;
|
||||
}
|
||||
g_list_free (list);
|
||||
g_array_free (attr_array, TRUE);
|
||||
|
||||
return ainfo;
|
||||
}
|
||||
|
||||
@@ -172,8 +172,7 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Temporarily disabled to unblock Roslyn
|
||||
#if HOST_WIN32 //|| HAVE_SYS_ZLIB
|
||||
#if HOST_WIN32 || HAVE_SYS_ZLIB
|
||||
if (ppdb_data) {
|
||||
/* Embedded PPDB data */
|
||||
/* ppdb_size is the uncompressed size */
|
||||
@@ -436,7 +435,8 @@ mono_ppdb_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)
|
||||
}
|
||||
|
||||
location = g_new0 (MonoDebugSourceLocation, 1);
|
||||
location->source_file = docname;
|
||||
if (docname && docname [0])
|
||||
location->source_file = docname;
|
||||
location->row = start_line;
|
||||
location->column = start_col;
|
||||
location->il_offset = iloffset;
|
||||
|
||||
@@ -680,9 +680,6 @@ mono_runtime_install_appctx_properties (void);
|
||||
gboolean
|
||||
mono_domain_set_fast (MonoDomain *domain, gboolean force);
|
||||
|
||||
void
|
||||
mono_domain_ensure_entry_assembly (MonoDomain *domain, MonoAssembly *assembly);
|
||||
|
||||
MonoAssemblyLoadContext *
|
||||
mono_domain_default_alc (MonoDomain *domain);
|
||||
|
||||
|
||||
+24
-33
@@ -1023,32 +1023,7 @@ mono_domain_foreach (MonoDomainFunc func, gpointer user_data)
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
}
|
||||
|
||||
void
|
||||
mono_domain_ensure_entry_assembly (MonoDomain *domain, MonoAssembly *assembly)
|
||||
{
|
||||
if (!domain->entry_assembly && assembly) {
|
||||
gchar *str;
|
||||
ERROR_DECL (error);
|
||||
|
||||
domain->entry_assembly = assembly;
|
||||
/* Domains created from another domain already have application_base and configuration_file set */
|
||||
if (domain->setup->application_base == NULL) {
|
||||
MonoString *basedir = mono_string_new_checked (domain, assembly->basedir, error);
|
||||
mono_error_assert_ok (error);
|
||||
MONO_OBJECT_SETREF_INTERNAL (domain->setup, application_base, basedir);
|
||||
}
|
||||
|
||||
if (domain->setup->configuration_file == NULL) {
|
||||
str = g_strconcat (assembly->image->name, ".config", (const char*)NULL);
|
||||
MonoString *config_file = mono_string_new_checked (domain, str, error);
|
||||
mono_error_assert_ok (error);
|
||||
MONO_OBJECT_SETREF_INTERNAL (domain->setup, configuration_file, config_file);
|
||||
g_free (str);
|
||||
mono_domain_set_options_from_config (domain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: maybe we should integrate this with mono_assembly_open? */
|
||||
/**
|
||||
* mono_domain_assembly_open:
|
||||
* \param domain the application domain
|
||||
@@ -1065,15 +1040,37 @@ mono_domain_assembly_open (MonoDomain *domain, const char *name)
|
||||
}
|
||||
|
||||
// Uses the domain on legacy mono and the ALC on current
|
||||
// Intended only for loading the main assembly
|
||||
MonoAssembly *
|
||||
mono_domain_assembly_open_internal (MonoDomain *domain, MonoAssemblyLoadContext *alc, const char *name)
|
||||
{
|
||||
MonoDomain *current;
|
||||
MonoAssembly *ass;
|
||||
GSList *tmp;
|
||||
|
||||
MONO_REQ_GC_UNSAFE_MODE;
|
||||
|
||||
#ifdef ENABLE_NETCORE
|
||||
mono_alc_assemblies_lock (alc);
|
||||
for (tmp = alc->loaded_assemblies; tmp; tmp = tmp->next) {
|
||||
ass = (MonoAssembly *)tmp->data;
|
||||
if (strcmp (name, ass->aname.name) == 0) {
|
||||
mono_alc_assemblies_unlock (alc);
|
||||
return ass;
|
||||
}
|
||||
}
|
||||
mono_alc_assemblies_unlock (alc);
|
||||
#else
|
||||
mono_domain_assemblies_lock (domain);
|
||||
for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) {
|
||||
ass = (MonoAssembly *)tmp->data;
|
||||
if (strcmp (name, ass->aname.name) == 0) {
|
||||
mono_domain_assemblies_unlock (domain);
|
||||
return ass;
|
||||
}
|
||||
}
|
||||
mono_domain_assemblies_unlock (domain);
|
||||
#endif
|
||||
|
||||
MonoAssemblyOpenRequest req;
|
||||
mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, alc);
|
||||
if (domain != mono_domain_get ()) {
|
||||
@@ -1086,12 +1083,6 @@ mono_domain_assembly_open_internal (MonoDomain *domain, MonoAssemblyLoadContext
|
||||
ass = mono_assembly_request_open (name, &req, NULL);
|
||||
}
|
||||
|
||||
// On netcore, this is necessary because we check the AppContext.BaseDirectory property as part of the assembly lookup algorithm
|
||||
// AppContext.BaseDirectory can sometimes fall back to checking the location of the entry_assembly, which should be non-null
|
||||
#ifdef ENABLE_NETCORE
|
||||
mono_domain_ensure_entry_assembly (domain, ass);
|
||||
#endif
|
||||
|
||||
return ass;
|
||||
}
|
||||
|
||||
|
||||
@@ -6480,7 +6480,7 @@ ves_icall_Mono_Runtime_ExceptionToState (MonoExceptionHandle exc_handle, guint64
|
||||
// FIXME: Push handles down into mini/mini-exceptions.c
|
||||
MonoException *exc = MONO_HANDLE_RAW (exc_handle);
|
||||
MonoThreadSummary out;
|
||||
mono_summarize_timeline_start ();
|
||||
mono_summarize_timeline_start ("ExceptionToState");
|
||||
mono_summarize_timeline_phase_log (MonoSummarySuspendHandshake);
|
||||
mono_summarize_timeline_phase_log (MonoSummaryUnmanagedStacks);
|
||||
mono_get_eh_callbacks ()->mono_summarize_exception (exc, &out);
|
||||
@@ -6643,7 +6643,7 @@ ves_icall_Mono_Runtime_DumpStateTotal (guint64 *portable_hash, guint64 *unportab
|
||||
|
||||
mono_get_runtime_callbacks ()->install_state_summarizer ();
|
||||
|
||||
mono_summarize_timeline_start ();
|
||||
mono_summarize_timeline_start ("DumpStateTotal");
|
||||
|
||||
gboolean success = mono_threads_summarize (ctx, &out, &hashes, TRUE, FALSE, scratch, MONO_MAX_SUMMARY_LEN_ICALL);
|
||||
mono_summarize_timeline_phase_log (MonoSummaryCleanup);
|
||||
@@ -6823,7 +6823,7 @@ get_generic_inst_from_array_handle (MonoArrayHandle type_args)
|
||||
int size = MONO_SIZEOF_GENERIC_INST + type_argc * sizeof (MonoType *);
|
||||
|
||||
MonoGenericInst *ginst = (MonoGenericInst *)g_alloca (size);
|
||||
memset (ginst, 0, MONO_SIZEOF_GENERIC_INST);
|
||||
memset (ginst, 0, sizeof (MonoGenericInst));
|
||||
ginst->type_argc = type_argc;
|
||||
for (int i = 0; i < type_argc; i++) {
|
||||
MONO_HANDLE_ARRAY_GETVAL (ginst->type_argv[i], type_args, MonoType*, i);
|
||||
@@ -7745,7 +7745,12 @@ ves_icall_System_Environment_FailFast (MonoStringHandle message, MonoExceptionHa
|
||||
} else {
|
||||
char *msg = mono_string_handle_to_utf8 (message, error);
|
||||
g_warning ("CLR: Managed code called FailFast, saying \"%s\"", msg);
|
||||
#ifndef DISABLE_CRASH_REPORTING
|
||||
char *old_msg = mono_crash_save_failfast_msg (msg);
|
||||
g_free (old_msg);
|
||||
#else
|
||||
g_free (msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!MONO_HANDLE_IS_NULL (exception)) {
|
||||
|
||||
@@ -2450,10 +2450,6 @@ mono_image_close_except_pools (MonoImage *image)
|
||||
|
||||
mono_wrapper_caches_free (&image->wrapper_caches);
|
||||
|
||||
for (i = 0; i < image->gshared_types_len; ++i)
|
||||
free_hash (image->gshared_types [i]);
|
||||
g_free (image->gshared_types);
|
||||
|
||||
/* The ownership of signatures is not well defined */
|
||||
g_hash_table_destroy (image->memberref_signatures);
|
||||
g_hash_table_destroy (image->method_signatures);
|
||||
|
||||
@@ -567,11 +567,6 @@ struct _MonoImage {
|
||||
GHashTable *pinvoke_scopes;
|
||||
#endif
|
||||
|
||||
/* Indexed by MonoGenericParam pointers */
|
||||
GHashTable **gshared_types;
|
||||
/* The length of the above array */
|
||||
int gshared_types_len;
|
||||
|
||||
/* The loader used to load this image */
|
||||
MonoImageLoader *loader;
|
||||
|
||||
@@ -613,6 +608,11 @@ typedef struct {
|
||||
|
||||
GHashTable *aggregate_modifiers_cache;
|
||||
|
||||
/* Indexed by MonoGenericParam pointers */
|
||||
GHashTable **gshared_types;
|
||||
/* The length of the above array */
|
||||
int gshared_types_len;
|
||||
|
||||
mono_mutex_t lock;
|
||||
|
||||
/*
|
||||
@@ -897,6 +897,12 @@ mono_image_set_strdup (MonoImageSet *set, const char *s);
|
||||
MonoImageSet *
|
||||
mono_metadata_get_image_set_for_aggregate_modifiers (MonoAggregateModContainer *amods);
|
||||
|
||||
MonoImageSet *
|
||||
mono_metadata_get_image_set_for_type (MonoType *type);
|
||||
|
||||
MonoImageSet *
|
||||
mono_metadata_merge_image_sets (MonoImageSet *set1, MonoImageSet *set2);
|
||||
|
||||
#define mono_image_set_new0(image,type,size) ((type *) mono_image_set_alloc0 (image, sizeof (type)* (size)))
|
||||
|
||||
gboolean
|
||||
|
||||
@@ -2796,6 +2796,12 @@ delete_image_set (MonoImageSet *set)
|
||||
|
||||
g_hash_table_destroy (set->aggregate_modifiers_cache);
|
||||
|
||||
for (i = 0; i < set->gshared_types_len; ++i) {
|
||||
if (set->gshared_types [i])
|
||||
g_hash_table_destroy (set->gshared_types [i]);
|
||||
}
|
||||
g_free (set->gshared_types);
|
||||
|
||||
mono_wrapper_caches_free (&set->wrapper_caches);
|
||||
|
||||
image_sets_lock ();
|
||||
@@ -3312,19 +3318,25 @@ mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericConte
|
||||
}
|
||||
|
||||
MonoImageSet *
|
||||
mono_metadata_get_image_set_for_class (MonoClass *klass)
|
||||
mono_metadata_get_image_set_for_type (MonoType *type)
|
||||
{
|
||||
MonoImageSet *set;
|
||||
CollectData image_set_data;
|
||||
|
||||
collect_data_init (&image_set_data);
|
||||
collect_type_images (m_class_get_byval_arg (klass), &image_set_data);
|
||||
collect_type_images (type, &image_set_data);
|
||||
set = get_image_set (image_set_data.images, image_set_data.nimages);
|
||||
collect_data_free (&image_set_data);
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
MonoImageSet *
|
||||
mono_metadata_get_image_set_for_class (MonoClass *klass)
|
||||
{
|
||||
return mono_metadata_get_image_set_for_type (m_class_get_byval_arg (klass));
|
||||
}
|
||||
|
||||
MonoImageSet *
|
||||
mono_metadata_get_image_set_for_method (MonoMethodInflated *method)
|
||||
{
|
||||
@@ -3352,6 +3364,29 @@ mono_metadata_get_image_set_for_aggregate_modifiers (MonoAggregateModContainer *
|
||||
return set;
|
||||
}
|
||||
|
||||
MonoImageSet *
|
||||
mono_metadata_merge_image_sets (MonoImageSet *set1, MonoImageSet *set2)
|
||||
{
|
||||
MonoImage **images = g_newa (MonoImage*, set1->nimages + set2->nimages);
|
||||
|
||||
/* Add images from set1 */
|
||||
memcpy (images, set1->images, sizeof (MonoImage*) * set1->nimages);
|
||||
|
||||
int nimages = set1->nimages;
|
||||
// FIXME: Quaratic
|
||||
/* Add images from set2 */
|
||||
for (int i = 0; i < set2->nimages; ++i) {
|
||||
int j;
|
||||
for (j = 0; j < set1->nimages; ++j) {
|
||||
if (set2->images [i] == set1->images [j])
|
||||
break;
|
||||
}
|
||||
if (j == set1->nimages)
|
||||
images [nimages ++] = set2->images [i];
|
||||
}
|
||||
return get_image_set (images, nimages);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
type_is_gtd (MonoType *type)
|
||||
{
|
||||
@@ -3386,7 +3421,7 @@ mono_metadata_get_generic_inst (int type_argc, MonoType **type_argv)
|
||||
is_open = (i < type_argc);
|
||||
|
||||
ginst = (MonoGenericInst *)g_alloca (size);
|
||||
memset (ginst, 0, MONO_SIZEOF_GENERIC_INST);
|
||||
memset (ginst, 0, sizeof (MonoGenericInst));
|
||||
ginst->is_open = is_open;
|
||||
ginst->type_argc = type_argc;
|
||||
memcpy (ginst->type_argv, type_argv, type_argc * sizeof (MonoType *));
|
||||
|
||||
+34
-9
@@ -5118,8 +5118,29 @@ prepare_thread_to_exec_main (MonoDomain *domain, MonoMethod *method)
|
||||
MonoCustomAttrInfo* cinfo;
|
||||
gboolean has_stathread_attribute;
|
||||
|
||||
if (!domain->entry_assembly)
|
||||
mono_domain_ensure_entry_assembly (domain, m_class_get_image (method->klass)->assembly);
|
||||
if (!domain->entry_assembly) {
|
||||
gchar *str;
|
||||
ERROR_DECL (error);
|
||||
MonoAssembly *assembly;
|
||||
|
||||
assembly = m_class_get_image (method->klass)->assembly;
|
||||
domain->entry_assembly = assembly;
|
||||
/* Domains created from another domain already have application_base and configuration_file set */
|
||||
if (domain->setup->application_base == NULL) {
|
||||
MonoString *basedir = mono_string_new_checked (domain, assembly->basedir, error);
|
||||
mono_error_assert_ok (error);
|
||||
MONO_OBJECT_SETREF_INTERNAL (domain->setup, application_base, basedir);
|
||||
}
|
||||
|
||||
if (domain->setup->configuration_file == NULL) {
|
||||
str = g_strconcat (assembly->image->name, ".config", (const char*)NULL);
|
||||
MonoString *config_file = mono_string_new_checked (domain, str, error);
|
||||
mono_error_assert_ok (error);
|
||||
MONO_OBJECT_SETREF_INTERNAL (domain->setup, configuration_file, config_file);
|
||||
g_free (str);
|
||||
mono_domain_set_options_from_config (domain);
|
||||
}
|
||||
}
|
||||
|
||||
ERROR_DECL (cattr_error);
|
||||
cinfo = mono_custom_attrs_from_method_checked (method, cattr_error);
|
||||
@@ -6603,13 +6624,12 @@ mono_string_empty_handle (MonoDomain *domain)
|
||||
MonoString *
|
||||
mono_string_new_utf16 (MonoDomain *domain, const mono_unichar2 *text, gint32 len)
|
||||
{
|
||||
MONO_REQ_GC_UNSAFE_MODE;
|
||||
|
||||
ERROR_DECL (error);
|
||||
MonoString *res = NULL;
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
ERROR_DECL (error);
|
||||
res = mono_string_new_utf16_checked (domain, text, len, error);
|
||||
mono_error_cleanup (error);
|
||||
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -6706,10 +6726,12 @@ mono_string_new_utf32 (MonoDomain *domain, const mono_unichar4 *text, gint32 len
|
||||
MonoString *
|
||||
mono_string_new_size (MonoDomain *domain, gint32 len)
|
||||
{
|
||||
MonoString *str;
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
ERROR_DECL (error);
|
||||
MonoString *str = mono_string_new_size_checked (domain, len, error);
|
||||
str = mono_string_new_size_checked (domain, len, error);
|
||||
mono_error_cleanup (error);
|
||||
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -7542,9 +7564,12 @@ mono_string_intern (MonoString *str_raw)
|
||||
MonoString*
|
||||
mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 idx)
|
||||
{
|
||||
MonoString *result;
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
ERROR_DECL (error);
|
||||
MonoString *result = mono_ldstr_checked (domain, image, idx, error);
|
||||
result = mono_ldstr_checked (domain, image, idx, error);
|
||||
mono_error_cleanup (error);
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1958,7 +1958,7 @@ _mono_reflection_get_type_from_info (MonoAssemblyLoadContext *alc, MonoTypeNameP
|
||||
MonoAssemblyByNameRequest req;
|
||||
mono_assembly_request_prepare_byname (&req, MONO_ASMCTX_DEFAULT, alc);
|
||||
req.requesting_assembly = NULL;
|
||||
req.basedir = image->assembly->basedir;
|
||||
req.basedir = image ? image->assembly->basedir : NULL;
|
||||
assembly = mono_assembly_request_byname (&info->assembly, &req, NULL);
|
||||
if (!assembly)
|
||||
return NULL;
|
||||
|
||||
@@ -2639,7 +2639,7 @@ mono_gc_get_allocated_bytes_for_current_thread (void)
|
||||
info = mono_thread_info_current ();
|
||||
|
||||
/*There are some more allocated bytes in the current tlab that have not been recorded yet */
|
||||
return info->total_bytes_allocated + info->tlab_next - info->tlab_start;
|
||||
return info->total_bytes_allocated + (ptrdiff_t)(info->tlab_next - info->tlab_start);
|
||||
}
|
||||
|
||||
guint64
|
||||
@@ -3018,6 +3018,13 @@ sgen_client_handle_gc_debug (const char *opt)
|
||||
mono_log_finalizers = TRUE;
|
||||
} else if (!strcmp (opt, "no-managed-allocator")) {
|
||||
sgen_set_use_managed_allocator (FALSE);
|
||||
} else if (!strcmp (opt, "managed-allocator")) {
|
||||
/*
|
||||
* This option can be used to override the disabling of the managed allocator by
|
||||
* the nursery canaries option. This can be used when knowing for sure that no
|
||||
* aot code will be used by the application.
|
||||
*/
|
||||
sgen_set_use_managed_allocator (TRUE);
|
||||
} else if (!sgen_bridge_handle_gc_debug (opt)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -6514,6 +6514,9 @@ summarizer_state_term (SummarizerGlobalState *state, gchar **out, gchar *mem, si
|
||||
mono_get_eh_callbacks ()->mono_summarize_managed_stack (threads [i]);
|
||||
}
|
||||
|
||||
/* The value of the breadcrumb should match the "StackHash" value written by `mono_merp_write_fingerprint_payload` */
|
||||
mono_create_crash_hash_breadcrumb (controlling);
|
||||
|
||||
MonoStateWriter writer;
|
||||
memset (&writer, 0, sizeof (writer));
|
||||
|
||||
|
||||
@@ -4925,6 +4925,10 @@ mono_method_verify (MonoMethod *method, int level)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Disable for now
|
||||
if (TRUE)
|
||||
return NULL;
|
||||
|
||||
memset (&ctx, 0, sizeof (VerifyContext));
|
||||
|
||||
//FIXME use mono_method_get_signature_full
|
||||
|
||||
@@ -175,6 +175,11 @@ mono_w32process_get_modules (pid_t pid)
|
||||
return g_slist_reverse (ret);
|
||||
}
|
||||
|
||||
void
|
||||
mono_w32process_platform_init_once (void)
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
MONO_EMPTY_SOURCE_FILE (w32process_unix_bsd);
|
||||
|
||||
@@ -360,4 +360,9 @@ mono_w32process_get_modules (pid_t pid)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
mono_w32process_platform_init_once (void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -57,6 +57,11 @@ mono_w32process_get_modules (pid_t pid)
|
||||
return g_slist_reverse (ret);
|
||||
}
|
||||
|
||||
void
|
||||
mono_w32process_platform_init_once (void)
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
MONO_EMPTY_SOURCE_FILE (w32process_unix_haiku);
|
||||
|
||||
@@ -40,6 +40,9 @@ mono_w32process_get_name (pid_t pid);
|
||||
GSList*
|
||||
mono_w32process_get_modules (pid_t pid);
|
||||
|
||||
void
|
||||
mono_w32process_platform_init_once (void);
|
||||
|
||||
static void G_GNUC_UNUSED
|
||||
mono_w32process_module_free (MonoW32ProcessModule *module)
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <sys/utsname.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include <mach-o/getsect.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
/* sys/resource.h (for rusage) is required when using osx 10.3 (but not 10.4) */
|
||||
#ifdef __APPLE__
|
||||
@@ -117,58 +118,128 @@ mono_w32process_get_path (pid_t pid)
|
||||
#endif
|
||||
}
|
||||
|
||||
GSList*
|
||||
struct mono_dyld_image_info
|
||||
{
|
||||
const void *header_addr;
|
||||
const void *data_section_start;
|
||||
const void *data_section_end;
|
||||
const char *name;
|
||||
guint64 order;
|
||||
};
|
||||
|
||||
static guint64 dyld_order = 0;
|
||||
static GHashTable *images;
|
||||
static mono_mutex_t images_mutex;
|
||||
|
||||
static int
|
||||
sort_modules_by_load_order (gconstpointer a, gconstpointer b)
|
||||
{
|
||||
MonoW32ProcessModule *ma = (MonoW32ProcessModule *) a;
|
||||
MonoW32ProcessModule *mb = (MonoW32ProcessModule *) b;
|
||||
return ma->inode == mb->inode ? 0 : ma->inode < mb->inode ? -1 : 1;
|
||||
}
|
||||
|
||||
GSList *
|
||||
mono_w32process_get_modules (pid_t pid)
|
||||
{
|
||||
GSList *ret = NULL;
|
||||
MonoW32ProcessModule *mod;
|
||||
guint32 count;
|
||||
int i = 0;
|
||||
|
||||
MONO_ENTER_GC_SAFE;
|
||||
if (pid != getpid ())
|
||||
return NULL;
|
||||
goto done;
|
||||
|
||||
count = _dyld_image_count ();
|
||||
for (i = 0; i < count; i++) {
|
||||
#if SIZEOF_VOID_P == 8
|
||||
const struct mach_header_64 *hdr;
|
||||
const struct section_64 *sec;
|
||||
#else
|
||||
const struct mach_header *hdr;
|
||||
const struct section *sec;
|
||||
#endif
|
||||
const char *name;
|
||||
GHashTableIter it;
|
||||
g_hash_table_iter_init (&it, images);
|
||||
|
||||
name = _dyld_get_image_name (i);
|
||||
#if SIZEOF_VOID_P == 8
|
||||
hdr = (const struct mach_header_64*)_dyld_get_image_header (i);
|
||||
sec = getsectbynamefromheader_64 (hdr, SEG_DATA, SECT_DATA);
|
||||
#else
|
||||
hdr = _dyld_get_image_header (i);
|
||||
sec = getsectbynamefromheader (hdr, SEG_DATA, SECT_DATA);
|
||||
#endif
|
||||
gpointer val;
|
||||
|
||||
/* Some dynlibs do not have data sections on osx (#533893) */
|
||||
if (sec == 0)
|
||||
continue;
|
||||
|
||||
mod = g_new0 (MonoW32ProcessModule, 1);
|
||||
mod->address_start = GINT_TO_POINTER (sec->addr);
|
||||
mod->address_end = GINT_TO_POINTER (sec->addr+sec->size);
|
||||
mono_os_mutex_lock (&images_mutex);
|
||||
while (g_hash_table_iter_next (&it, NULL, &val)) {
|
||||
struct mono_dyld_image_info *info = (struct mono_dyld_image_info *) val;
|
||||
MonoW32ProcessModule *mod = g_new0 (MonoW32ProcessModule, 1);
|
||||
mod->address_start = GINT_TO_POINTER (info->data_section_start);
|
||||
mod->address_end = GINT_TO_POINTER (info->data_section_end);
|
||||
mod->perms = g_strdup ("r--p");
|
||||
mod->address_offset = 0;
|
||||
mod->device = makedev (0, 0);
|
||||
mod->inode = i;
|
||||
mod->filename = g_strdup (name);
|
||||
|
||||
if (g_slist_find_custom (ret, mod, mono_w32process_module_equals) == NULL) {
|
||||
ret = g_slist_prepend (ret, mod);
|
||||
} else {
|
||||
mono_w32process_module_free (mod);
|
||||
}
|
||||
mod->device = 0;
|
||||
mod->inode = info->order;
|
||||
mod->filename = g_strdup (info->name);
|
||||
ret = g_slist_prepend (ret, mod);
|
||||
}
|
||||
mono_os_mutex_unlock (&images_mutex);
|
||||
ret = g_slist_sort (ret, &sort_modules_by_load_order);
|
||||
done:
|
||||
MONO_EXIT_GC_SAFE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return g_slist_reverse (ret);
|
||||
static void
|
||||
mono_dyld_image_info_free (void *info)
|
||||
{
|
||||
struct mono_dyld_image_info *dinfo = (struct mono_dyld_image_info *) info;
|
||||
g_free ((void *) dinfo->name);
|
||||
g_free (dinfo);
|
||||
}
|
||||
|
||||
static void
|
||||
image_added (const struct mach_header *hdr32, intptr_t vmaddr_slide)
|
||||
{
|
||||
#if SIZEOF_VOID_P == 8
|
||||
const struct mach_header_64 *hdr64 = (const struct mach_header_64 *)hdr32;
|
||||
const struct section_64 *sec = getsectbynamefromheader_64 (hdr64, SEG_DATA, SECT_DATA);
|
||||
#else
|
||||
const struct section *sec = getsectbynamefromheader (hdr32, SEG_DATA, SECT_DATA);
|
||||
#endif
|
||||
Dl_info dlinfo;
|
||||
if (!dladdr (hdr32, &dlinfo)) return;
|
||||
if (sec == NULL) return;
|
||||
|
||||
mono_os_mutex_lock (&images_mutex);
|
||||
gpointer found = g_hash_table_lookup (images, (gpointer) hdr32);
|
||||
mono_os_mutex_unlock (&images_mutex);
|
||||
|
||||
if (found == NULL) {
|
||||
struct mono_dyld_image_info *info = g_new0 (struct mono_dyld_image_info, 1);
|
||||
info->header_addr = hdr32;
|
||||
info->data_section_start = GINT_TO_POINTER (sec->addr);
|
||||
info->data_section_end = GINT_TO_POINTER (sec->addr + sec->size);
|
||||
info->name = g_strdup (dlinfo.dli_fname);
|
||||
info->order = dyld_order;
|
||||
++dyld_order;
|
||||
|
||||
mono_os_mutex_lock (&images_mutex);
|
||||
g_hash_table_insert (images, (gpointer) hdr32, info);
|
||||
mono_os_mutex_unlock (&images_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
image_removed (const struct mach_header *hdr32, intptr_t vmaddr_slide)
|
||||
{
|
||||
mono_os_mutex_lock (&images_mutex);
|
||||
g_hash_table_remove (images, hdr32);
|
||||
mono_os_mutex_unlock (&images_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
mono_w32process_platform_init_once (void)
|
||||
{
|
||||
mono_os_mutex_init (&images_mutex);
|
||||
images = g_hash_table_new_full (NULL, NULL, NULL, &mono_dyld_image_info_free);
|
||||
|
||||
/* Ensure that the functions used within the lock-protected region in
|
||||
* mono_w32process_get_modules have been loaded, in case these symbols
|
||||
* are lazily bound. g_new0 and g_strdup will be called by
|
||||
* _dyld_register_func_for_add_image when it calls image_added with the
|
||||
* current list of all loaded dynamic libraries
|
||||
*/
|
||||
GSList *dummy = g_slist_prepend (NULL, NULL);
|
||||
g_slist_free (dummy);
|
||||
GHashTableIter it;
|
||||
g_hash_table_iter_init (&it, images);
|
||||
g_hash_table_iter_next (&it, NULL, NULL);
|
||||
|
||||
_dyld_register_func_for_add_image (&image_added);
|
||||
_dyld_register_func_for_remove_image (&image_removed);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
#include <mono/utils/mono-io-portability.h>
|
||||
#include <mono/utils/w32api.h>
|
||||
#include <mono/utils/mono-errno.h>
|
||||
#include <mono/utils/mono-once.h>
|
||||
#include <mono/utils/mono-error-internals.h>
|
||||
#include <mono/utils/mono-threads-coop.h>
|
||||
#include "object-internals.h"
|
||||
@@ -594,6 +595,8 @@ process_set_name (MonoW32HandleProcess *process_handle)
|
||||
}
|
||||
}
|
||||
|
||||
static mono_once_t init_state = MONO_ONCE_INIT;
|
||||
|
||||
void
|
||||
mono_w32process_init (void)
|
||||
{
|
||||
@@ -615,6 +618,7 @@ mono_w32process_init (void)
|
||||
g_assert (current_process != INVALID_HANDLE_VALUE);
|
||||
|
||||
mono_coop_mutex_init (&processes_mutex);
|
||||
mono_once (&init_state, &mono_w32process_platform_init_once);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -826,7 +826,7 @@ unaligned.exe: unaligned.cs TestDriver.dll MemoryIntrinsics.dll
|
||||
%.exe: %.cs TestDriver.dll
|
||||
$(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
|
||||
|
||||
%.exe: %.il TestDriver.dll
|
||||
%.exe: %.il
|
||||
$(ILASM) -output=$@ $<
|
||||
|
||||
TestDriver.dll: $(srcdir)/TestDriver.cs $(srcdir)/TestHelpers.cs
|
||||
|
||||
@@ -3386,12 +3386,14 @@ get_shared_ginst_ref (MonoAotCompile *acfg, MonoGenericInst *ginst)
|
||||
guint32 offset = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->ginst_blob_hash, ginst));
|
||||
if (!offset) {
|
||||
guint8 *buf2, *p2;
|
||||
int len;
|
||||
|
||||
buf2 = (guint8 *)g_malloc (1024);
|
||||
len = 1024 + (ginst->type_argc * 32);
|
||||
buf2 = (guint8 *)g_malloc (len);
|
||||
p2 = buf2;
|
||||
|
||||
encode_ginst (acfg, ginst, p2, &p2);
|
||||
g_assert (p2 - buf2 < 1024);
|
||||
g_assert (p2 - buf2 < len);
|
||||
|
||||
offset = add_to_blob (acfg, buf2, p2 - buf2);
|
||||
g_free (buf2);
|
||||
|
||||
+40
-15
@@ -220,7 +220,7 @@ static gsize aot_code_high_addr = 0;
|
||||
static gint32 async_jit_info_size;
|
||||
|
||||
#ifdef MONOTOUCH
|
||||
#define USE_PAGE_TRAMPOLINES (mono_defaults.corlib->aot_module->use_page_trampolines)
|
||||
#define USE_PAGE_TRAMPOLINES (mscorlib_aot_module->use_page_trampolines)
|
||||
#else
|
||||
#define USE_PAGE_TRAMPOLINES 0
|
||||
#endif
|
||||
@@ -2079,6 +2079,32 @@ init_amodule_got (MonoAotModule *amodule, gboolean preinit)
|
||||
mono_loader_unlock ();
|
||||
}
|
||||
|
||||
#ifdef MONOTOUCH
|
||||
// Follow branch islands on ARM iOS machines.
|
||||
static inline guint8 *
|
||||
method_address_resolve (guint8 *code_addr) {
|
||||
#if defined(TARGET_ARM)
|
||||
// Skip branches to thumb destinations; the convention used is that the
|
||||
// lowest bit is set if the destination is thumb. See
|
||||
// get_call_table_entry.
|
||||
if (((uintptr_t) code_addr) & 0x1)
|
||||
return code_addr;
|
||||
#endif
|
||||
for (;;) {
|
||||
// `mono_arch_get_call_target` takes the IP after the branch
|
||||
// instruction, not before. Add 4 bytes to compensate.
|
||||
guint8 *next = mono_arch_get_call_target (code_addr + 4);
|
||||
if (next == NULL) return code_addr;
|
||||
code_addr = next;
|
||||
}
|
||||
}
|
||||
#else
|
||||
static inline guint8 *
|
||||
method_address_resolve (guint8 *code_addr) {
|
||||
return code_addr;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer user_data, MonoError *error)
|
||||
{
|
||||
@@ -2379,6 +2405,8 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
|
||||
g_assert (addr);
|
||||
if (addr == amodule->info.method_addresses)
|
||||
addr = NULL;
|
||||
else
|
||||
addr = method_address_resolve ((guint8 *) addr);
|
||||
}
|
||||
if (addr == NULL)
|
||||
amodule->methods [i] = GINT_TO_POINTER (-1);
|
||||
@@ -2426,10 +2454,6 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
|
||||
|
||||
init_amodule_got (amodule, TRUE);
|
||||
|
||||
if (info->flags & MONO_AOT_FILE_FLAG_WITH_LLVM)
|
||||
/* Directly called methods might make calls through the PLT */
|
||||
init_plt (amodule);
|
||||
|
||||
if (amodule->jit_code_start)
|
||||
mono_jit_info_add_aot_module (assembly->image, amodule->jit_code_start, amodule->jit_code_end);
|
||||
if (amodule->llvm_code_start)
|
||||
@@ -2444,6 +2468,10 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
|
||||
/*g_warning ("using page trampolines: %d", amodule->use_page_trampolines);*/
|
||||
}
|
||||
|
||||
if (info->flags & MONO_AOT_FILE_FLAG_WITH_LLVM)
|
||||
/* Directly called methods might make calls through the PLT */
|
||||
init_plt (amodule);
|
||||
|
||||
/*
|
||||
* Register the plt region as a single trampoline so we can unwind from this code
|
||||
*/
|
||||
@@ -5537,13 +5565,12 @@ read_page_trampoline_uwinfo (MonoTrampInfo *info, int tramp_type, gboolean is_ge
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
read_unwind_info (mono_defaults.corlib->aot_module, info, symbol_name);
|
||||
read_unwind_info (mscorlib_aot_module, info, symbol_name);
|
||||
}
|
||||
|
||||
static unsigned char*
|
||||
get_new_trampoline_from_page (int tramp_type)
|
||||
{
|
||||
MonoAotModule *amodule;
|
||||
MonoImage *image;
|
||||
TrampolinePage *page;
|
||||
int count;
|
||||
@@ -5565,13 +5592,11 @@ get_new_trampoline_from_page (int tramp_type)
|
||||
return code;
|
||||
}
|
||||
mono_aot_page_unlock ();
|
||||
/* the trampoline template page is in the mscorlib module */
|
||||
image = mono_defaults.corlib;
|
||||
g_assert (image);
|
||||
|
||||
psize = MONO_AOT_TRAMP_PAGE_SIZE;
|
||||
|
||||
amodule = image->aot_module;
|
||||
/* the trampoline template page is in the mscorlib module */
|
||||
MonoAotModule *amodule = mscorlib_aot_module;
|
||||
g_assert (amodule);
|
||||
|
||||
if (tramp_type == MONO_AOT_TRAMP_SPECIFIC)
|
||||
@@ -5795,7 +5820,7 @@ no_specific_trampoline (void)
|
||||
* Return a specific trampoline from the AOT file.
|
||||
*/
|
||||
gpointer
|
||||
mono_aot_create_specific_trampoline (MonoImage *image, gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len)
|
||||
mono_aot_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len)
|
||||
{
|
||||
MonoAotModule *amodule;
|
||||
guint32 got_offset, tramp_size;
|
||||
@@ -6024,7 +6049,7 @@ mono_aot_get_lazy_fetch_trampoline (guint32 slot)
|
||||
{
|
||||
char *symbol;
|
||||
gpointer code;
|
||||
MonoAotModule *amodule = mono_defaults.corlib->aot_module;
|
||||
MonoAotModule *amodule = mscorlib_aot_module;
|
||||
guint32 index = MONO_RGCTX_SLOT_INDEX (slot);
|
||||
static int count = 0;
|
||||
|
||||
@@ -6046,7 +6071,7 @@ mono_aot_get_lazy_fetch_trampoline (guint32 slot)
|
||||
}
|
||||
|
||||
symbol = mono_get_rgctx_fetch_trampoline_name (slot);
|
||||
code = load_function (mono_defaults.corlib->aot_module, symbol);
|
||||
code = load_function (amodule, symbol);
|
||||
g_free (symbol);
|
||||
/* The caller expects an ftnptr */
|
||||
return mono_create_ftnptr (mono_domain_get (), code);
|
||||
@@ -6360,7 +6385,7 @@ mono_aot_get_plt_info_offset (host_mgreg_t *regs, guint8 *code)
|
||||
}
|
||||
|
||||
gpointer
|
||||
mono_aot_create_specific_trampoline (MonoImage *image, gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len)
|
||||
mono_aot_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len)
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
|
||||
@@ -247,7 +247,7 @@ MonoJitInfo* mono_aot_find_jit_info (MonoDomain *domain, MonoImage *imag
|
||||
gpointer mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code, MonoError *error);
|
||||
void mono_aot_patch_plt_entry (guint8 *code, guint8 *plt_entry, gpointer *got, host_mgreg_t *regs, guint8 *addr);
|
||||
gpointer mono_aot_get_method_from_vt_slot (MonoDomain *domain, MonoVTable *vtable, int slot, MonoError *error);
|
||||
gpointer mono_aot_create_specific_trampoline (MonoImage *image, gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len);
|
||||
gpointer mono_aot_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len);
|
||||
gpointer mono_aot_get_trampoline (const char *name);
|
||||
gpointer mono_aot_get_trampoline_full (const char *name, MonoTrampInfo **out_tinfo);
|
||||
gpointer mono_aot_get_unbox_trampoline (MonoMethod *method, gpointer addr);
|
||||
|
||||
+77
-18
@@ -226,6 +226,8 @@ struct _DebuggerTlsData {
|
||||
* Number of times this thread has been resumed using resume_thread ().
|
||||
*/
|
||||
guint32 resume_count;
|
||||
guint32 resume_count_internal;
|
||||
guint32 suspend_count;
|
||||
|
||||
MonoInternalThread *thread;
|
||||
intptr_t thread_id;
|
||||
@@ -292,7 +294,7 @@ typedef struct {
|
||||
#define HEADER_LENGTH 11
|
||||
|
||||
#define MAJOR_VERSION 2
|
||||
#define MINOR_VERSION 54
|
||||
#define MINOR_VERSION 57
|
||||
|
||||
typedef enum {
|
||||
CMD_SET_VM = 1,
|
||||
@@ -726,7 +728,7 @@ static void invalidate_frames (DebuggerTlsData *tls);
|
||||
|
||||
/* Callbacks used by debugger-engine */
|
||||
static MonoContext* tls_get_restore_state (void *the_tls);
|
||||
static gboolean try_process_suspend (void *tls, MonoContext *ctx);
|
||||
static gboolean try_process_suspend (void *tls, MonoContext *ctx, gboolean from_breakpoint);
|
||||
static gboolean begin_breakpoint_processing (void *tls, MonoContext *ctx, MonoJitInfo *ji, gboolean from_signal);
|
||||
static void begin_single_step_processing (MonoContext *ctx, gboolean from_signal);
|
||||
static void ss_discard_frame_context (void *the_tls);
|
||||
@@ -2715,6 +2717,8 @@ reset_native_thread_suspend_state (gpointer key, gpointer value, gpointer user_d
|
||||
tls->async_state.valid = FALSE;
|
||||
invalidate_frames (tls);
|
||||
}
|
||||
tls->resume_count_internal++;
|
||||
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -2823,19 +2827,24 @@ process_suspend (DebuggerTlsData *tls, MonoContext *ctx)
|
||||
|
||||
/* Conditionally call process_suspend depending oh the current state */
|
||||
static gboolean
|
||||
try_process_suspend (void *the_tls, MonoContext *ctx)
|
||||
try_process_suspend (void *the_tls, MonoContext *ctx, gboolean from_breakpoint)
|
||||
{
|
||||
DebuggerTlsData *tls = (DebuggerTlsData*)the_tls;
|
||||
|
||||
if (suspend_count > 0) {
|
||||
/* if there is a suspend pending that is not executed yes */
|
||||
if (suspend_count > 0) {
|
||||
/* Fastpath during invokes, see in process_suspend () */
|
||||
if (suspend_count - tls->resume_count == 0)
|
||||
/* if there is a suspend pending but this thread is already resumed, we shouldn't suspend it again and the breakpoint/ss can run */
|
||||
if (suspend_count - tls->resume_count == 0)
|
||||
return FALSE;
|
||||
if (tls->invoke)
|
||||
/* if there is in a invoke the breakpoint/step should be executed even with the suspend pending */
|
||||
if (tls->invoke)
|
||||
return FALSE;
|
||||
/* with the multithreaded single step check if there is a suspend_count pending in the current thread and not in the vm */
|
||||
if (from_breakpoint && tls->suspend_count <= tls->resume_count_internal)
|
||||
return FALSE;
|
||||
process_suspend (tls, ctx);
|
||||
return TRUE;
|
||||
}
|
||||
} /* if there isn't any suspend pending, the breakpoint/ss will be executed and will suspend then vm when the event is sent */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2945,6 +2954,8 @@ resume_thread (MonoInternalThread *thread)
|
||||
DEBUG_PRINTF (1, "[sdb] Resuming thread %p...\n", (gpointer)(gssize)thread->tid);
|
||||
|
||||
tls->resume_count += suspend_count;
|
||||
tls->resume_count_internal += tls->suspend_count;
|
||||
tls->suspend_count = 0;
|
||||
|
||||
/*
|
||||
* Signal suspend_count without decreasing suspend_count, the threads will wake up
|
||||
@@ -3901,7 +3912,10 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (event == EVENT_KIND_VM_START)
|
||||
suspend_policy = agent_config.suspend ? SUSPEND_POLICY_ALL : SUSPEND_POLICY_NONE;
|
||||
|
||||
nevents = g_slist_length (events);
|
||||
buffer_init (&buf, 128);
|
||||
buffer_add_byte (&buf, suspend_policy);
|
||||
@@ -4012,7 +4026,6 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx
|
||||
}
|
||||
|
||||
if (event == EVENT_KIND_VM_START) {
|
||||
suspend_policy = agent_config.suspend ? SUSPEND_POLICY_ALL : SUSPEND_POLICY_NONE;
|
||||
if (!agent_config.defer) {
|
||||
ERROR_DECL (error);
|
||||
start_debugger_thread (error);
|
||||
@@ -4035,6 +4048,8 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx
|
||||
* returns.
|
||||
*/
|
||||
save_thread_context (ctx);
|
||||
DebuggerTlsData *tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, mono_thread_internal_current ());
|
||||
tls->suspend_count++;
|
||||
suspend_vm ();
|
||||
|
||||
if (keepalive_obj)
|
||||
@@ -4337,6 +4352,9 @@ send_types_for_domain (MonoDomain *domain, void *user_data)
|
||||
MonoDomain* old_domain;
|
||||
AgentDomainInfo *info = NULL;
|
||||
|
||||
if (mono_domain_is_unloading (domain))
|
||||
return;
|
||||
|
||||
info = get_agent_domain_info (domain);
|
||||
g_assert (info);
|
||||
|
||||
@@ -4357,6 +4375,9 @@ send_assemblies_for_domain (MonoDomain *domain, void *user_data)
|
||||
GSList *tmp;
|
||||
MonoDomain* old_domain;
|
||||
|
||||
if (mono_domain_is_unloading (domain))
|
||||
return;
|
||||
|
||||
old_domain = mono_domain_get ();
|
||||
|
||||
mono_domain_set_fast (domain, TRUE);
|
||||
@@ -4962,7 +4983,6 @@ debugger_agent_breakpoint_from_context (MonoContext *ctx)
|
||||
if (MONO_CONTEXT_GET_IP (ctx) == orig_ip - 1)
|
||||
MONO_CONTEXT_SET_IP (ctx, orig_ip);
|
||||
}
|
||||
|
||||
static void
|
||||
ss_args_destroy (SingleStepArgs *ss_args)
|
||||
{
|
||||
@@ -4973,7 +4993,9 @@ ss_args_destroy (SingleStepArgs *ss_args)
|
||||
static int
|
||||
handle_multiple_ss_requests (void)
|
||||
{
|
||||
return DE_ERR_NOT_IMPLEMENTED;
|
||||
if (!CHECK_PROTOCOL_VERSION (2, 57))
|
||||
return DE_ERR_NOT_IMPLEMENTED;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -5125,6 +5147,7 @@ ss_clear_for_assembly (SingleStepReq *req, MonoAssembly *assembly)
|
||||
static void
|
||||
mono_debugger_agent_send_crash (char *json_dump, MonoStackHash *hashes, int pause)
|
||||
{
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
#ifndef DISABLE_CRASH_REPORTING
|
||||
int suspend_policy;
|
||||
GSList *events;
|
||||
@@ -5167,6 +5190,7 @@ mono_debugger_agent_send_crash (char *json_dump, MonoStackHash *hashes, int paus
|
||||
// Don't die before it is sent.
|
||||
sleep (4);
|
||||
#endif
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6235,7 +6259,7 @@ clear_event_request (int req_id, int etype)
|
||||
if (req->event_kind == EVENT_KIND_BREAKPOINT)
|
||||
mono_de_clear_breakpoint ((MonoBreakpoint *)req->info);
|
||||
if (req->event_kind == EVENT_KIND_STEP) {
|
||||
mono_de_cancel_ss ();
|
||||
mono_de_cancel_ss ((SingleStepReq *)req->info);
|
||||
}
|
||||
if (req->event_kind == EVENT_KIND_METHOD_ENTRY)
|
||||
mono_de_clear_breakpoint ((MonoBreakpoint *)req->info);
|
||||
@@ -6516,7 +6540,10 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
|
||||
else {
|
||||
ERROR_DECL (error);
|
||||
this_arg = mono_object_new_checked (domain, m->klass, error);
|
||||
mono_error_assert_ok (error);
|
||||
if (!is_ok (error)) {
|
||||
mono_error_cleanup (error);
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
@@ -6840,6 +6867,10 @@ get_types (gpointer key, gpointer value, gpointer user_data)
|
||||
MonoType *t;
|
||||
GSList *tmp;
|
||||
MonoDomain *domain = (MonoDomain*)key;
|
||||
|
||||
if (mono_domain_is_unloading (domain))
|
||||
return;
|
||||
|
||||
MonoAssemblyLoadContext *alc = mono_domain_default_alc (domain);
|
||||
GetTypesArgs *ud = (GetTypesArgs*)user_data;
|
||||
|
||||
@@ -6879,6 +6910,9 @@ get_types_for_source_file (gpointer key, gpointer value, gpointer user_data)
|
||||
GetTypesForSourceFileArgs *ud = (GetTypesForSourceFileArgs*)user_data;
|
||||
MonoDomain *domain = (MonoDomain*)key;
|
||||
|
||||
if (mono_domain_is_unloading (domain))
|
||||
return;
|
||||
|
||||
AgentDomainInfo *info = (AgentDomainInfo *)domain_jit_info (domain)->agent_info;
|
||||
|
||||
/* Update 'source_file_to_class' cache */
|
||||
@@ -6937,6 +6971,12 @@ get_types_for_source_file (gpointer key, gpointer value, gpointer user_data)
|
||||
}
|
||||
}
|
||||
|
||||
static void add_error_string (Buffer *buf, const char *str)
|
||||
{
|
||||
if (CHECK_PROTOCOL_VERSION (2, 56))
|
||||
buffer_add_string (buf, str);
|
||||
}
|
||||
|
||||
static ErrorCode
|
||||
vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
|
||||
{
|
||||
@@ -7241,6 +7281,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
|
||||
ignore_case = decode_byte (p, &p, end);
|
||||
|
||||
if (!mono_reflection_parse_type_checked (name, &info, error)) {
|
||||
add_error_string (buf, mono_error_get_message (error));
|
||||
mono_error_cleanup (error);
|
||||
g_free (name);
|
||||
mono_reflection_free_type_info (&info);
|
||||
@@ -7729,6 +7770,8 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
|
||||
case CMD_ASSEMBLY_GET_TYPE: {
|
||||
ERROR_DECL (error);
|
||||
char *s = decode_string (p, &p, end);
|
||||
char* original_s = g_strdup_printf ("\"%s\"", s);
|
||||
|
||||
gboolean ignorecase = decode_byte (p, &p, end);
|
||||
MonoTypeNameParse info;
|
||||
MonoType *t;
|
||||
@@ -7744,20 +7787,33 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
|
||||
mono_error_cleanup (error);
|
||||
t = NULL;
|
||||
} else {
|
||||
if (info.assembly.name)
|
||||
NOT_IMPLEMENTED;
|
||||
if (info.assembly.name) {
|
||||
mono_reflection_free_type_info (&info);
|
||||
g_free (s);
|
||||
mono_domain_set_fast (d, TRUE);
|
||||
char* error_msg = g_strdup_printf ("Unexpected assembly-qualified type %s was provided", original_s);
|
||||
add_error_string (buf, error_msg);
|
||||
g_free (error_msg);
|
||||
g_free (original_s);
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
t = mono_reflection_get_type_checked (alc, ass->image, ass->image, &info, ignorecase, TRUE, &type_resolve, error);
|
||||
if (!is_ok (error)) {
|
||||
mono_error_cleanup (error); /* FIXME don't swallow the error */
|
||||
mono_reflection_free_type_info (&info);
|
||||
g_free (s);
|
||||
mono_domain_set_fast (d, TRUE);
|
||||
char* error_msg = g_strdup_printf ("Invalid type name %s", original_s);
|
||||
add_error_string (buf, error_msg);
|
||||
g_free (error_msg);
|
||||
g_free (original_s);
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
}
|
||||
buffer_add_typeid (buf, domain, t ? mono_class_from_mono_type_internal (t) : NULL);
|
||||
mono_reflection_free_type_info (&info);
|
||||
g_free (s);
|
||||
|
||||
g_free (original_s);
|
||||
mono_domain_set_fast (d, TRUE);
|
||||
|
||||
break;
|
||||
@@ -7814,6 +7870,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
|
||||
error_init (error);
|
||||
MonoClass* mono_class = mono_class_get_checked (ass->image, token, error);
|
||||
if (!is_ok (error)) {
|
||||
add_error_string (buf, mono_error_get_message (error));
|
||||
mono_error_cleanup (error);
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7830,6 +7887,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
|
||||
error_init (error);
|
||||
MonoMethod* mono_method = mono_get_method_checked (ass->image, token, NULL, NULL, error);
|
||||
if (!is_ok (error)) {
|
||||
add_error_string (buf, mono_error_get_message (error));
|
||||
mono_error_cleanup (error);
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -8682,6 +8740,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
|
||||
|
||||
header = mono_method_get_header_checked (method, error);
|
||||
if (!header) {
|
||||
add_error_string (buf, mono_error_get_message (error));
|
||||
mono_error_cleanup (error); /* FIXME don't swallow the error */
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -9513,7 +9572,7 @@ string_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
|
||||
if (!is_ok (error)) {
|
||||
if (s)
|
||||
g_free (s);
|
||||
|
||||
add_error_string (buf, mono_error_get_message (error));
|
||||
return ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
buffer_add_string (buf, s);
|
||||
|
||||
+61
-27
@@ -378,6 +378,9 @@ collect_domain_bp (gpointer key, gpointer value, gpointer user_data)
|
||||
CollectDomainData *ud = (CollectDomainData*)user_data;
|
||||
MonoMethod *m;
|
||||
|
||||
if (mono_domain_is_unloading (domain))
|
||||
return;
|
||||
|
||||
mono_domain_lock (domain);
|
||||
g_hash_table_iter_init (&iter, domain_jit_info (domain)->seq_points);
|
||||
while (g_hash_table_iter_next (&iter, (void**)&m, (void**)&seq_points)) {
|
||||
@@ -591,8 +594,26 @@ mono_de_clear_breakpoints_for_domain (MonoDomain *domain)
|
||||
/* Number of single stepping operations in progress */
|
||||
static int ss_count;
|
||||
|
||||
/* The single step request instance */
|
||||
static SingleStepReq *the_ss_req;
|
||||
/* The single step request instances */
|
||||
static GPtrArray *the_ss_reqs;
|
||||
|
||||
static void
|
||||
ss_req_init (void)
|
||||
{
|
||||
the_ss_reqs = g_ptr_array_new ();
|
||||
}
|
||||
|
||||
static void
|
||||
ss_req_cleanup (void)
|
||||
{
|
||||
dbg_lock ();
|
||||
|
||||
g_ptr_array_free (the_ss_reqs, TRUE);
|
||||
|
||||
the_ss_reqs = NULL;
|
||||
|
||||
dbg_unlock ();
|
||||
}
|
||||
|
||||
/*
|
||||
* mono_de_start_single_stepping:
|
||||
@@ -717,18 +738,28 @@ ss_destroy (SingleStepReq *req)
|
||||
}
|
||||
|
||||
static SingleStepReq*
|
||||
ss_req_acquire (void)
|
||||
ss_req_acquire (MonoInternalThread *thread)
|
||||
{
|
||||
SingleStepReq *req;
|
||||
|
||||
SingleStepReq *req = NULL;
|
||||
dbg_lock ();
|
||||
req = the_ss_req;
|
||||
if (req)
|
||||
req->refcount ++;
|
||||
int i;
|
||||
for (i = 0; i < the_ss_reqs->len; ++i) {
|
||||
SingleStepReq *current_req = (SingleStepReq *)g_ptr_array_index (the_ss_reqs, i);
|
||||
if (current_req->thread == thread) {
|
||||
current_req->refcount ++;
|
||||
req = current_req;
|
||||
}
|
||||
}
|
||||
dbg_unlock ();
|
||||
return req;
|
||||
}
|
||||
|
||||
static int
|
||||
ss_req_count ()
|
||||
{
|
||||
return the_ss_reqs->len;
|
||||
}
|
||||
|
||||
static void
|
||||
mono_de_ss_req_release (SingleStepReq *req)
|
||||
{
|
||||
@@ -739,24 +770,31 @@ mono_de_ss_req_release (SingleStepReq *req)
|
||||
req->refcount --;
|
||||
if (req->refcount == 0)
|
||||
free = TRUE;
|
||||
dbg_unlock ();
|
||||
if (free) {
|
||||
if (req == the_ss_req)
|
||||
the_ss_req = NULL;
|
||||
g_ptr_array_remove (the_ss_reqs, req);
|
||||
ss_destroy (req);
|
||||
}
|
||||
dbg_unlock ();
|
||||
}
|
||||
|
||||
void
|
||||
mono_de_cancel_ss (SingleStepReq *req)
|
||||
{
|
||||
if (the_ss_reqs) {
|
||||
mono_de_ss_req_release (req);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mono_de_cancel_ss (void)
|
||||
mono_de_cancel_all_ss ()
|
||||
{
|
||||
if (the_ss_req) {
|
||||
mono_de_ss_req_release (the_ss_req);
|
||||
the_ss_req = NULL;
|
||||
int i;
|
||||
for (i = 0; i < the_ss_reqs->len; ++i) {
|
||||
SingleStepReq *current_req = (SingleStepReq *)g_ptr_array_index (the_ss_reqs, i);
|
||||
mono_de_ss_req_release (current_req);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mono_de_process_single_step (void *tls, gboolean from_signal)
|
||||
{
|
||||
@@ -774,21 +812,17 @@ mono_de_process_single_step (void *tls, gboolean from_signal)
|
||||
/* Skip the instruction causing the single step */
|
||||
rt_callbacks.begin_single_step_processing (ctx, from_signal);
|
||||
|
||||
if (rt_callbacks.try_process_suspend (tls, ctx))
|
||||
if (rt_callbacks.try_process_suspend (tls, ctx, FALSE))
|
||||
return;
|
||||
|
||||
/*
|
||||
* This can run concurrently with a clear_event_request () call, so needs locking/reference counts.
|
||||
*/
|
||||
ss_req = ss_req_acquire ();
|
||||
ss_req = ss_req_acquire (mono_thread_internal_current ());
|
||||
|
||||
if (!ss_req)
|
||||
// FIXME: A suspend race
|
||||
return;
|
||||
|
||||
if (mono_thread_internal_current () != ss_req->thread)
|
||||
goto exit;
|
||||
|
||||
ip = (guint8 *)MONO_CONTEXT_GET_IP (ctx);
|
||||
|
||||
ji = get_top_method_ji (ip, &domain, (gpointer*)&ip);
|
||||
@@ -1022,7 +1056,7 @@ mono_de_process_breakpoint (void *void_tls, gboolean from_signal)
|
||||
SeqPoint sp;
|
||||
gboolean found_sp;
|
||||
|
||||
if (rt_callbacks.try_process_suspend (tls, ctx))
|
||||
if (rt_callbacks.try_process_suspend (tls, ctx, TRUE))
|
||||
return;
|
||||
|
||||
ip = (guint8 *)MONO_CONTEXT_GET_IP (ctx);
|
||||
@@ -1488,7 +1522,7 @@ mono_de_ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, S
|
||||
return err;
|
||||
|
||||
// FIXME: Multiple requests
|
||||
if (the_ss_req) {
|
||||
if (ss_req_count () > 1) {
|
||||
err = rt_callbacks.handle_multiple_ss_requests ();
|
||||
|
||||
if (err == DE_ERR_NOT_IMPLEMENTED) {
|
||||
@@ -1519,8 +1553,7 @@ mono_de_ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, S
|
||||
err = rt_callbacks.ss_create_init_args (ss_req, &args);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
the_ss_req = ss_req;
|
||||
g_ptr_array_add (the_ss_reqs, ss_req);
|
||||
|
||||
mono_de_ss_start (ss_req, &args);
|
||||
|
||||
@@ -1552,7 +1585,7 @@ mono_de_init (DebuggerEngineCallbacks *cbs)
|
||||
|
||||
domains_init ();
|
||||
breakpoints_init ();
|
||||
|
||||
ss_req_init ();
|
||||
mono_debugger_log_init ();
|
||||
}
|
||||
|
||||
@@ -1561,6 +1594,7 @@ mono_de_cleanup (void)
|
||||
{
|
||||
breakpoints_cleanup ();
|
||||
domains_cleanup ();
|
||||
ss_req_cleanup ();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -232,7 +232,7 @@ mono_debugger_get_thread_state (DebuggerTlsData *ref);
|
||||
|
||||
typedef struct {
|
||||
MonoContext *(*tls_get_restore_state) (void *tls);
|
||||
gboolean (*try_process_suspend) (void *tls, MonoContext *ctx);
|
||||
gboolean (*try_process_suspend) (void *tls, MonoContext *ctx, gboolean from_breakpoint);
|
||||
gboolean (*begin_breakpoint_processing) (void *tls, MonoContext *ctx, MonoJitInfo *ji, gboolean from_signal);
|
||||
void (*begin_single_step_processing) (MonoContext *ctx, gboolean from_signal);
|
||||
|
||||
@@ -284,6 +284,7 @@ void mono_de_stop_single_stepping (void);
|
||||
void mono_de_process_breakpoint (void *tls, gboolean from_signal);
|
||||
void mono_de_process_single_step (void *tls, gboolean from_signal);
|
||||
DbgEngineErrorCode mono_de_ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilter filter, EventRequest *req);
|
||||
void mono_de_cancel_ss (void);
|
||||
void mono_de_cancel_ss (SingleStepReq *req);
|
||||
void mono_de_cancel_all_ss (void);
|
||||
|
||||
#endif
|
||||
@@ -200,7 +200,6 @@ static gboolean
|
||||
parse_debug_options (const char* p)
|
||||
{
|
||||
MonoDebugOptions *opt = mini_get_debug_options ();
|
||||
opt->enabled = TRUE;
|
||||
|
||||
do {
|
||||
if (!*p) {
|
||||
@@ -217,11 +216,6 @@ parse_debug_options (const char* p)
|
||||
} else if (!strncmp (p, "gdb", 3)) {
|
||||
opt->gdb = TRUE;
|
||||
p += 3;
|
||||
#ifdef ENABLE_NETCORE
|
||||
} else if (!strncmp (p, "ignore", 6)) {
|
||||
opt->enabled = FALSE;
|
||||
p += 6;
|
||||
#endif
|
||||
} else {
|
||||
fprintf (stderr, "Invalid debug option `%s', use --help-debug for details\n", p);
|
||||
return FALSE;
|
||||
@@ -1611,12 +1605,7 @@ mini_usage (void)
|
||||
"\n"
|
||||
"Development:\n"
|
||||
" --aot[=<options>] Compiles the assembly to native code\n"
|
||||
#ifdef ENABLE_NETCORE
|
||||
" --debug=ignore Disable debugging support (on by default)\n"
|
||||
" --debug=[<options>] Disable debugging support or enable debugging extras, use --help-debug for details\n"
|
||||
#else
|
||||
" --debug[=<options>] Enable debugging support, use --help-debug for details\n"
|
||||
#endif
|
||||
" --debugger-agent=options Enable the debugger agent\n"
|
||||
" --profile[=profiler] Runs in profiling mode with the specified profiler module\n"
|
||||
" --trace[=EXPR] Enable tracing, use --help-trace for details\n"
|
||||
@@ -1675,17 +1664,10 @@ mini_debug_usage (void)
|
||||
{
|
||||
fprintf (stdout,
|
||||
"Debugging options:\n"
|
||||
#ifdef ENABLE_NETCORE
|
||||
" --debug[=OPTIONS] Disable debugging support or enable debugging extras, optional OPTIONS is a comma\n"
|
||||
#else
|
||||
" --debug[=OPTIONS] Enable debugging support, optional OPTIONS is a comma\n"
|
||||
#endif
|
||||
" separated list of options\n"
|
||||
"\n"
|
||||
"OPTIONS is composed of:\n"
|
||||
#ifdef ENABLE_NETCORE
|
||||
" ignore Disable debugging support (on by default).\n"
|
||||
#endif
|
||||
" casts Enable more detailed InvalidCastException messages.\n"
|
||||
" mdb-optimizations Disable some JIT optimizations which are normally\n"
|
||||
" disabled when running inside the debugger.\n"
|
||||
@@ -2143,10 +2125,6 @@ mono_main (int argc, char* argv[])
|
||||
|
||||
opt = mono_parse_default_optimizations (NULL);
|
||||
|
||||
#ifdef ENABLE_NETCORE
|
||||
enable_debugging = TRUE;
|
||||
#endif
|
||||
|
||||
for (i = 1; i < argc; ++i) {
|
||||
if (argv [i] [0] != '-')
|
||||
break;
|
||||
@@ -2382,13 +2360,6 @@ mono_main (int argc, char* argv[])
|
||||
enable_debugging = TRUE;
|
||||
if (!parse_debug_options (argv [i] + 8))
|
||||
return 1;
|
||||
#ifdef ENABLE_NETCORE
|
||||
MonoDebugOptions *opt = mini_get_debug_options ();
|
||||
|
||||
if (!opt->enabled) {
|
||||
enable_debugging = FALSE;
|
||||
}
|
||||
#endif
|
||||
} else if (strncmp (argv [i], "--debugger-agent=", 17) == 0) {
|
||||
MonoDebugOptions *opt = mini_get_debug_options ();
|
||||
|
||||
|
||||
@@ -181,6 +181,12 @@ emit_int32 (MonoDwarfWriter *w, int value)
|
||||
mono_img_writer_emit_int32 (w->w, value);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_symbol (MonoDwarfWriter *w, const char *symbol)
|
||||
{
|
||||
mono_img_writer_emit_symbol (w->w, symbol);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_symbol_diff (MonoDwarfWriter *w, const char *end, const char* start, int offset)
|
||||
{
|
||||
@@ -799,6 +805,7 @@ mono_dwarf_writer_emit_base_info (MonoDwarfWriter *w, const char *cu_name, GSLis
|
||||
w->cie_program = base_unwind_program;
|
||||
|
||||
emit_section_change (w, ".debug_abbrev", 0);
|
||||
emit_label (w, ".Ldebug_abbrev_start");
|
||||
emit_dwarf_abbrev (w, ABBREV_COMPILE_UNIT, DW_TAG_compile_unit, TRUE,
|
||||
compile_unit_attr, G_N_ELEMENTS (compile_unit_attr));
|
||||
emit_dwarf_abbrev (w, ABBREV_SUBPROGRAM, DW_TAG_subprogram, TRUE,
|
||||
@@ -842,7 +849,11 @@ mono_dwarf_writer_emit_base_info (MonoDwarfWriter *w, const char *cu_name, GSLis
|
||||
emit_symbol_diff (w, ".Ldebug_info_end", ".Ldebug_info_begin", 0); /* length */
|
||||
emit_label (w, ".Ldebug_info_begin");
|
||||
emit_int16 (w, 0x2); /* DWARF version 2 */
|
||||
#if !defined(TARGET_MACH)
|
||||
emit_symbol (w, ".Ldebug_abbrev_start"); /* .debug_abbrev offset */
|
||||
#else
|
||||
emit_int32 (w, 0); /* .debug_abbrev offset */
|
||||
#endif
|
||||
emit_byte (w, sizeof (target_mgreg_t)); /* address size */
|
||||
|
||||
/* Compilation unit */
|
||||
|
||||
@@ -66,7 +66,7 @@ static LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
|
||||
#endif
|
||||
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL, NULL);
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
@@ -876,7 +876,7 @@ altstack_handle_and_restore (MonoContext *ctx, MonoObject *obj, guint32 flags)
|
||||
|
||||
if (!ji || (!stack_ovf && !nullref)) {
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), ctx, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), ctx, NULL, NULL);
|
||||
// if couldn't dump or if mono_handle_native_crash returns, abort
|
||||
abort ();
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
|
||||
}
|
||||
if (!ji)
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), (MonoContext*)sigctx, siginfo);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), (MonoContext*)sigctx, siginfo, sigctx);
|
||||
/* setup a call frame on the real stack so that control is returned there
|
||||
* and exception handling can continue.
|
||||
* The frame looks like:
|
||||
|
||||
@@ -67,7 +67,7 @@ static LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
|
||||
}
|
||||
#endif
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL, NULL);
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
@@ -1140,7 +1140,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
|
||||
MonoContext mctx;
|
||||
mono_sigctx_to_monoctx (sigctx, &mctx);
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, siginfo);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, siginfo, sigctx);
|
||||
else
|
||||
abort ();
|
||||
}
|
||||
|
||||
@@ -3557,4 +3557,29 @@ L3:
|
||||
IL_0024: ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T createinstance_intrins_primitive<.ctor T>() cil managed noinlining
|
||||
{
|
||||
.maxstack 8
|
||||
call !!0 [mscorlib]System.Activator::CreateInstance<!!0>()
|
||||
ret
|
||||
}
|
||||
|
||||
.method public static int32 test_0_createinstance_intrins_primitive () cil managed
|
||||
{
|
||||
.maxstack 8
|
||||
call !!0 Tests::createinstance_intrins_primitive<bool>()
|
||||
ldc.i4.0
|
||||
beq L1
|
||||
ldc.i4.1
|
||||
ret
|
||||
L1:
|
||||
call !!0 Tests::createinstance_intrins_primitive<int64>()
|
||||
ldc.i8 0
|
||||
beq L2
|
||||
ldc.i4.2
|
||||
ret
|
||||
L2:
|
||||
ldc.i4.0
|
||||
ret
|
||||
}
|
||||
}
|
||||
@@ -410,11 +410,14 @@ create_reloc (MonoImageWriter *acfg, const char *end, const char* start, int off
|
||||
BinReloc *reloc;
|
||||
reloc = (BinReloc *)mono_mempool_alloc0 (acfg->mempool, sizeof (BinReloc));
|
||||
reloc->val1 = mono_mempool_strdup (acfg->mempool, end);
|
||||
if (strcmp (start, ".") == 0) {
|
||||
reloc->val2_section = acfg->cur_section;
|
||||
reloc->val2_offset = acfg->cur_section->cur_offset;
|
||||
} else {
|
||||
reloc->val2 = mono_mempool_strdup (acfg->mempool, start);
|
||||
if (start)
|
||||
{
|
||||
if (strcmp (start, ".") == 0) {
|
||||
reloc->val2_section = acfg->cur_section;
|
||||
reloc->val2_offset = acfg->cur_section->cur_offset;
|
||||
} else {
|
||||
reloc->val2 = mono_mempool_strdup (acfg->mempool, start);
|
||||
}
|
||||
}
|
||||
reloc->offset = offset;
|
||||
reloc->section = acfg->cur_section;
|
||||
@@ -424,6 +427,13 @@ create_reloc (MonoImageWriter *acfg, const char *end, const char* start, int off
|
||||
return reloc;
|
||||
}
|
||||
|
||||
static void
|
||||
bin_writer_emit_symbol (MonoImageWriter *acfg, const char *symbol)
|
||||
{
|
||||
create_reloc (acfg, symbol, NULL, 0);
|
||||
acfg->cur_section->cur_offset += 4;
|
||||
}
|
||||
|
||||
static void
|
||||
bin_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
|
||||
{
|
||||
@@ -1924,6 +1934,23 @@ asm_writer_emit_int32 (MonoImageWriter *acfg, int value)
|
||||
fprintf (acfg->fp, "%d", value);
|
||||
}
|
||||
|
||||
static void
|
||||
asm_writer_emit_symbol (MonoImageWriter *acfg, const char *symbol)
|
||||
{
|
||||
if (acfg->mode != EMIT_LONG) {
|
||||
acfg->mode = EMIT_LONG;
|
||||
acfg->col_count = 0;
|
||||
}
|
||||
|
||||
symbol = get_label (symbol);
|
||||
|
||||
if ((acfg->col_count++ % 8) == 0)
|
||||
fprintf (acfg->fp, "\n\t%s ", AS_INT32_DIRECTIVE);
|
||||
else
|
||||
fprintf (acfg->fp, ",");
|
||||
fprintf (acfg->fp, "%s", symbol);
|
||||
}
|
||||
|
||||
static void
|
||||
asm_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
|
||||
{
|
||||
@@ -2213,6 +2240,19 @@ mono_img_writer_emit_int32 (MonoImageWriter *acfg, int value)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
mono_img_writer_emit_symbol (MonoImageWriter *acfg, const char *symbol)
|
||||
{
|
||||
#ifdef USE_BIN_WRITER
|
||||
if (acfg->use_bin_writer)
|
||||
bin_writer_emit_symbol (acfg, symbol);
|
||||
else
|
||||
asm_writer_emit_symbol (acfg, symbol);
|
||||
#else
|
||||
asm_writer_emit_symbol (acfg, symbol);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
mono_img_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
|
||||
{
|
||||
|
||||
@@ -98,6 +98,8 @@ void mono_img_writer_emit_int16 (MonoImageWriter *w, int value);
|
||||
|
||||
void mono_img_writer_emit_int32 (MonoImageWriter *w, int value);
|
||||
|
||||
void mono_img_writer_emit_symbol (MonoImageWriter *w, const char *symbol);
|
||||
|
||||
void mono_img_writer_emit_symbol_diff (MonoImageWriter *w, const char *end, const char* start, int offset);
|
||||
|
||||
void mono_img_writer_emit_zero_bytes (MonoImageWriter *w, int num);
|
||||
|
||||
@@ -184,7 +184,7 @@ struct _StackFragment {
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
StackFragment *first, *current;
|
||||
StackFragment *first, *last, *current;
|
||||
/* For GC sync */
|
||||
int inited;
|
||||
} FrameStack;
|
||||
@@ -200,7 +200,6 @@ typedef struct {
|
||||
const unsigned short *ip;
|
||||
GSList *finally_ips;
|
||||
FrameClauseArgs *clause_args;
|
||||
gboolean is_void : 1;
|
||||
} InterpState;
|
||||
|
||||
struct _InterpFrame {
|
||||
|
||||
+59
-71
@@ -121,7 +121,7 @@ frame_stack_init (FrameStack *stack, int size)
|
||||
StackFragment *frag;
|
||||
|
||||
frag = stack_frag_new (size);
|
||||
stack->first = stack->current = frag;
|
||||
stack->first = stack->last = stack->current = frag;
|
||||
mono_compiler_barrier ();
|
||||
stack->inited = 1;
|
||||
}
|
||||
@@ -137,21 +137,12 @@ add_frag (FrameStack *stack, int size)
|
||||
frag_size = size + sizeof (StackFragment);
|
||||
new_frag = stack_frag_new (frag_size);
|
||||
mono_compiler_barrier ();
|
||||
stack->current->next = new_frag;
|
||||
stack->last->next = new_frag;
|
||||
stack->last = new_frag;
|
||||
stack->current = new_frag;
|
||||
return new_frag;
|
||||
}
|
||||
|
||||
static void
|
||||
free_frag (StackFragment *frag)
|
||||
{
|
||||
while (frag) {
|
||||
StackFragment *next = frag->next;
|
||||
g_free (frag);
|
||||
frag = next;
|
||||
}
|
||||
}
|
||||
|
||||
static MONO_ALWAYS_INLINE gpointer
|
||||
frame_stack_alloc_ovf (FrameStack *stack, int size, StackFragment **out_frag)
|
||||
{
|
||||
@@ -162,12 +153,6 @@ frame_stack_alloc_ovf (FrameStack *stack, int size, StackFragment **out_frag)
|
||||
current = stack->current = current->next;
|
||||
current->pos = (guint8*)¤t->data;
|
||||
} else {
|
||||
StackFragment *tmp = current->next;
|
||||
/* avoid linking to be freed fragments, so the GC can't trip over it */
|
||||
current->next = NULL;
|
||||
mono_compiler_barrier ();
|
||||
free_frag (tmp);
|
||||
|
||||
current = add_frag (stack, size);
|
||||
}
|
||||
g_assert (current->pos + size <= current->end);
|
||||
@@ -216,7 +201,12 @@ frame_stack_free (FrameStack *stack)
|
||||
{
|
||||
stack->inited = 0;
|
||||
mono_compiler_barrier ();
|
||||
free_frag (stack->first);
|
||||
StackFragment *frag = stack->first;
|
||||
while (frag) {
|
||||
StackFragment *next = frag->next;
|
||||
g_free (frag);
|
||||
frag = next;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -301,6 +291,14 @@ static gboolean interp_init_done = FALSE;
|
||||
|
||||
static void interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args, MonoError *error);
|
||||
|
||||
static MONO_NEVER_INLINE void
|
||||
interp_exec_method_call_vararg (InterpFrame *frame, ThreadContext *context, MonoError *error)
|
||||
// This function makes WebAsssembly stacks clearer, so you can see which recursion
|
||||
// is occuring, in the absence of line numbers in the debugger.
|
||||
{
|
||||
interp_exec_method_full (frame, context, NULL, error);
|
||||
}
|
||||
|
||||
static MONO_NEVER_INLINE void
|
||||
interp_exec_method_newobj_fast (InterpFrame *frame, ThreadContext *context, MonoError *error)
|
||||
// This function makes WebAsssembly stacks clearer, so you can see which recursion
|
||||
@@ -1637,6 +1635,9 @@ interp_init_delegate (MonoDelegate *del, MonoError *error)
|
||||
if (del->interp_method) {
|
||||
/* Delegate created by a call to ves_icall_mono_delegate_ctor_interp () */
|
||||
del->method = ((InterpMethod *)del->interp_method)->method;
|
||||
} if (del->method_ptr && !del->method) {
|
||||
/* Delegate created from methodInfo.MethodHandle.GetFunctionPointer() */
|
||||
del->interp_method = (InterpMethod *)del->method_ptr;
|
||||
} else if (del->method) {
|
||||
/* Delegate created dynamically */
|
||||
del->interp_method = mono_interp_get_imethod (del->object.vtable->domain, del->method, error);
|
||||
@@ -3247,8 +3248,6 @@ mono_interp_newobj_vt (
|
||||
memset (&valuetype_this, 0, sizeof (stackval));
|
||||
sp->data.p = &valuetype_this;
|
||||
|
||||
// FIXME remove recursion
|
||||
//
|
||||
// FIXME It is unfortunate to outline a recursive case as it
|
||||
// increases its stack usage. We do this however as it conserves
|
||||
// stack for all the other recursive cases.
|
||||
@@ -3484,7 +3483,6 @@ method_entry (ThreadContext *context, InterpFrame *frame, gboolean *out_tracing,
|
||||
frame->state.ip = ip; \
|
||||
frame->state.sp = sp; \
|
||||
frame->state.vt_sp = vt_sp; \
|
||||
frame->state.is_void = is_void; \
|
||||
frame->state.finally_ips = finally_ips; \
|
||||
frame->state.clause_args = clause_args; \
|
||||
} while (0)
|
||||
@@ -3493,10 +3491,9 @@ method_entry (ThreadContext *context, InterpFrame *frame, gboolean *out_tracing,
|
||||
#define LOAD_INTERP_STATE(frame) do { \
|
||||
ip = frame->state.ip; \
|
||||
sp = frame->state.sp; \
|
||||
is_void = frame->state.is_void; \
|
||||
vt_sp = frame->state.vt_sp; \
|
||||
finally_ips = frame->state.finally_ips; \
|
||||
clause_args = frame->state.clause_args; \
|
||||
clause_args = frame->state.clause_args; \
|
||||
locals = (unsigned char *)frame->stack + frame->imethod->stack_size + frame->imethod->vt_stack_size; \
|
||||
frame->state.ip = NULL; \
|
||||
} while (0)
|
||||
@@ -3519,10 +3516,6 @@ method_entry (ThreadContext *context, InterpFrame *frame, gboolean *out_tracing,
|
||||
static MONO_NEVER_INLINE void
|
||||
interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args, MonoError *error)
|
||||
{
|
||||
InterpMethod *cmethod;
|
||||
gboolean is_void;
|
||||
stackval *retval;
|
||||
|
||||
/* Interpreter main loop state (InterpState) */
|
||||
const guint16 *ip = NULL;
|
||||
stackval *sp;
|
||||
@@ -3775,7 +3768,6 @@ main_loop:
|
||||
MonoMethodSignature *csignature;
|
||||
InterpMethod *imethod;
|
||||
stackval *retval;
|
||||
// FIXME This assumes a grow-down stack.
|
||||
gpointer native_stack_addr = frame->native_stack_addr ? (gpointer)((guint8*)frame->native_stack_addr - 1) : (gpointer)&retval;
|
||||
|
||||
frame->ip = ip;
|
||||
@@ -3790,8 +3782,10 @@ main_loop:
|
||||
mono_interp_error_cleanup (error); /* FIXME: don't swallow the error */
|
||||
}
|
||||
|
||||
is_void = csignature->ret->type == MONO_TYPE_VOID;
|
||||
retval = is_void ? NULL : sp;
|
||||
if (csignature->ret->type != MONO_TYPE_VOID)
|
||||
retval = sp;
|
||||
else
|
||||
retval = NULL;
|
||||
|
||||
sp->data.p = vt_sp;
|
||||
/* decrement by the actual number of args */
|
||||
@@ -3811,12 +3805,11 @@ main_loop:
|
||||
/* Non-recursive call */
|
||||
SAVE_INTERP_STATE (frame);
|
||||
|
||||
child_frame = alloc_frame (context, native_stack_addr, frame, imethod, sp, retval);
|
||||
|
||||
if (G_UNLIKELY (!imethod->transformed)) {
|
||||
MonoException *ex;
|
||||
gboolean tracing;
|
||||
|
||||
child_frame = alloc_frame (context, native_stack_addr, frame, imethod, sp, retval);
|
||||
method_entry (context, child_frame, &tracing, &ex);
|
||||
if (G_UNLIKELY (ex)) {
|
||||
frame = child_frame;
|
||||
@@ -3825,6 +3818,7 @@ main_loop:
|
||||
EXCEPTION_CHECKPOINT;
|
||||
}
|
||||
} else {
|
||||
child_frame = alloc_frame (context, native_stack_addr, frame, imethod, sp, retval);
|
||||
alloc_stack_data (context, child_frame, imethod->alloca_size);
|
||||
#if DEBUG_INTERP
|
||||
debug_enter (child_frame, &tracing);
|
||||
@@ -3892,7 +3886,7 @@ main_loop:
|
||||
stackval *retval;
|
||||
MonoObject *this_arg;
|
||||
InterpMethod *imethod;
|
||||
is_void = *ip == MINT_VCALLVIRT_FAST;
|
||||
gboolean is_void = *ip == MINT_VCALLVIRT_FAST;
|
||||
int slot;
|
||||
|
||||
frame->ip = ip;
|
||||
@@ -3934,13 +3928,11 @@ main_loop:
|
||||
if (code_type == IMETHOD_CODE_INTERP) {
|
||||
SAVE_INTERP_STATE (frame);
|
||||
|
||||
// FIXME &retval looks wrong
|
||||
child_frame = alloc_frame (context, &retval, frame, imethod, sp, retval);
|
||||
|
||||
if (G_UNLIKELY (!imethod->transformed)) {
|
||||
MonoException *ex;
|
||||
gboolean tracing;
|
||||
|
||||
child_frame = alloc_frame (context, &retval, frame, imethod, sp, retval);
|
||||
method_entry (context, child_frame, &tracing, &ex);
|
||||
if (G_UNLIKELY (ex)) {
|
||||
frame = child_frame;
|
||||
@@ -3949,6 +3941,7 @@ main_loop:
|
||||
EXCEPTION_CHECKPOINT;
|
||||
}
|
||||
} else {
|
||||
child_frame = alloc_frame (context, &retval, frame, imethod, sp, retval);
|
||||
alloc_stack_data (context, child_frame, imethod->alloca_size);
|
||||
}
|
||||
|
||||
@@ -3972,43 +3965,48 @@ main_loop:
|
||||
MINT_IN_BREAK;
|
||||
}
|
||||
MINT_IN_CASE(MINT_CALL_VARARG) {
|
||||
stackval *retval;
|
||||
int num_varargs = 0;
|
||||
MonoMethodSignature *csig;
|
||||
|
||||
cmethod = (InterpMethod*)frame->imethod->data_items [ip [1]];
|
||||
|
||||
/* The real signature for vararg calls */
|
||||
csig = (MonoMethodSignature*) frame->imethod->data_items [ip [2]];
|
||||
|
||||
frame->ip = ip;
|
||||
|
||||
// Retval must be set unconditionally due to MINT_ARGLIST.
|
||||
// is_void further guides exit_frame.
|
||||
retval = sp;
|
||||
is_void = csig->ret->type == MONO_TYPE_VOID;
|
||||
|
||||
child_frame = alloc_frame (context, &retval, frame, (InterpMethod*)frame->imethod->data_items [ip [1]], NULL, retval);
|
||||
/* The real signature for vararg calls */
|
||||
csig = (MonoMethodSignature*) frame->imethod->data_items [ip [2]];
|
||||
/* Push all vararg arguments from normal sp to vt_sp together with the signature */
|
||||
num_varargs = csig->param_count - csig->sentinelpos;
|
||||
vt_sp = copy_varargs_vtstack (csig, sp, vt_sp);
|
||||
|
||||
ip += 3;
|
||||
sp->data.p = vt_sp;
|
||||
child_frame->retval = sp;
|
||||
|
||||
/* decrement by the actual number of args */
|
||||
// FIXME This seems excessive: frame and csig param_count.
|
||||
sp -= cmethod->param_count + cmethod->hasthis + csig->param_count - csig->sentinelpos;
|
||||
sp -= child_frame->imethod->param_count + child_frame->imethod->hasthis + num_varargs;
|
||||
|
||||
goto call;
|
||||
child_frame->stack_args = sp;
|
||||
interp_exec_method_call_vararg (child_frame, context, error);
|
||||
CHECK_RESUME_STATE (context);
|
||||
if (csig->ret->type != MONO_TYPE_VOID) {
|
||||
*sp = *retval;
|
||||
sp++;
|
||||
}
|
||||
MINT_IN_BREAK;
|
||||
}
|
||||
MINT_IN_CASE(MINT_VCALL)
|
||||
MINT_IN_CASE(MINT_CALL)
|
||||
MINT_IN_CASE(MINT_CALLVIRT)
|
||||
MINT_IN_CASE(MINT_VCALLVIRT) {
|
||||
// FIXME CALLVIRT opcodes are not used on netcore. We should kill them.
|
||||
// FIXME braces from here until call: label.
|
||||
is_void = *ip == MINT_VCALL || *ip == MINT_VCALLVIRT;
|
||||
gboolean is_virtual;
|
||||
is_virtual = *ip == MINT_CALLVIRT || *ip == MINT_VCALLVIRT;
|
||||
stackval *retval;
|
||||
gboolean is_void = *ip == MINT_VCALL || *ip == MINT_VCALLVIRT;
|
||||
gboolean is_virtual = *ip == MINT_CALLVIRT || *ip == MINT_VCALLVIRT;
|
||||
gpointer native_stack_addr = frame->native_stack_addr ? (gpointer)((guint8*)frame->native_stack_addr - 1) : (gpointer)&retval;
|
||||
InterpMethod *imethod;
|
||||
|
||||
cmethod = (InterpMethod*)frame->imethod->data_items [ip [1]];
|
||||
imethod = (InterpMethod*)frame->imethod->data_items [ip [1]];
|
||||
sp->data.p = vt_sp;
|
||||
retval = is_void ? NULL : sp;
|
||||
|
||||
@@ -4018,8 +4016,8 @@ main_loop:
|
||||
if (is_virtual) {
|
||||
MonoObject *this_arg = (MonoObject*)sp->data.p;
|
||||
|
||||
cmethod = get_virtual_method (cmethod, this_arg->vtable);
|
||||
if (m_class_is_valuetype (this_arg->vtable->klass) && m_class_is_valuetype (cmethod->method->klass)) {
|
||||
imethod = get_virtual_method (imethod, this_arg->vtable);
|
||||
if (m_class_is_valuetype (this_arg->vtable->klass) && m_class_is_valuetype (imethod->method->klass)) {
|
||||
/* unbox */
|
||||
gpointer unboxed = mono_object_unbox_internal (this_arg);
|
||||
sp [0].data.p = unboxed;
|
||||
@@ -4032,9 +4030,6 @@ main_loop:
|
||||
#else
|
||||
ip += 3;
|
||||
#endif
|
||||
call:;
|
||||
// FIXME This assumes a grow-down stack.
|
||||
gpointer native_stack_addr = frame->native_stack_addr ? (gpointer)((guint8*)frame->native_stack_addr - 1) : (gpointer)&retval;
|
||||
|
||||
/*
|
||||
* Make a non-recursive call by loading the new interpreter state based on child frame,
|
||||
@@ -4042,14 +4037,12 @@ call:;
|
||||
*/
|
||||
SAVE_INTERP_STATE (frame);
|
||||
|
||||
child_frame = alloc_frame (context, native_stack_addr, frame, cmethod, sp, retval);
|
||||
|
||||
if (G_UNLIKELY (!cmethod->transformed)) {
|
||||
if (G_UNLIKELY (!imethod->transformed)) {
|
||||
MonoException *ex;
|
||||
gboolean tracing;
|
||||
|
||||
child_frame = alloc_frame (context, native_stack_addr, frame, imethod, sp, retval);
|
||||
method_entry (context, child_frame, &tracing, &ex);
|
||||
|
||||
if (G_UNLIKELY (ex)) {
|
||||
frame = child_frame;
|
||||
frame->ip = NULL;
|
||||
@@ -4057,7 +4050,8 @@ call:;
|
||||
EXCEPTION_CHECKPOINT;
|
||||
}
|
||||
} else {
|
||||
alloc_stack_data (context, child_frame, cmethod->alloca_size);
|
||||
child_frame = alloc_frame (context, native_stack_addr, frame, imethod, sp, retval);
|
||||
alloc_stack_data (context, child_frame, imethod->alloca_size);
|
||||
#if DEBUG_INTERP
|
||||
debug_enter (child_frame, &tracing);
|
||||
#endif
|
||||
@@ -5153,10 +5147,7 @@ call:;
|
||||
frame->ip = ip;
|
||||
|
||||
child_frame = alloc_frame (context, &vtable, frame, ctor_method, sp, NULL);
|
||||
|
||||
// FIXME Remove recursion.
|
||||
interp_exec_method_newobj_fast (child_frame, context, error);
|
||||
|
||||
CHECK_RESUME_STATE (context);
|
||||
sp [0].data.o = o;
|
||||
sp++;
|
||||
@@ -5187,7 +5178,6 @@ call:;
|
||||
sp->data.p = vt_sp;
|
||||
ip += 4;
|
||||
|
||||
// FIXME remove recursion
|
||||
interp_exec_method_newobj_vtst_fast (child_frame, context, error);
|
||||
|
||||
CHECK_RESUME_STATE (context);
|
||||
@@ -5195,7 +5185,6 @@ call:;
|
||||
|
||||
} else {
|
||||
ip += 3;
|
||||
// FIXME remove recursion
|
||||
mono_interp_newobj_vt (child_frame, context, error);
|
||||
CHECK_RESUME_STATE (context);
|
||||
}
|
||||
@@ -5225,7 +5214,6 @@ call:;
|
||||
|
||||
child_frame->stack_args = sp;
|
||||
|
||||
// FIXME remove recursion
|
||||
MonoException* const exc = mono_interp_newobj (child_frame, context, error, vt_sp);
|
||||
if (exc)
|
||||
THROW_EX (exc, ip);
|
||||
@@ -7180,7 +7168,7 @@ exit_frame:
|
||||
|
||||
CHECK_RESUME_STATE (context);
|
||||
|
||||
if (retval && !is_void) {
|
||||
if (retval) {
|
||||
*sp = *retval;
|
||||
sp ++;
|
||||
}
|
||||
|
||||
+13
-6
@@ -1867,13 +1867,20 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
|
||||
method_context->method_inst->type_argc == 1 &&
|
||||
cmethod->is_inflated &&
|
||||
!mini_method_check_context_used (cfg, cmethod)) {
|
||||
MonoClass *arg0 = mono_class_from_mono_type_internal (method_context->method_inst->type_argv [0]);
|
||||
MonoType *t = method_context->method_inst->type_argv [0];
|
||||
MonoClass *arg0 = mono_class_from_mono_type_internal (t);
|
||||
if (m_class_is_valuetype (arg0) && !mono_class_has_default_constructor (arg0, FALSE)) {
|
||||
MONO_INST_NEW (cfg, ins, MONO_CLASS_IS_SIMD (cfg, arg0) ? OP_XZERO : OP_VZERO);
|
||||
ins->dreg = mono_alloc_dreg (cfg, STACK_VTYPE);
|
||||
ins->type = STACK_VTYPE;
|
||||
ins->klass = arg0;
|
||||
MONO_ADD_INS (cfg->cbb, ins);
|
||||
if (m_class_is_primitive (arg0)) {
|
||||
int dreg = alloc_dreg (cfg, mini_type_to_stack_type (cfg, t));
|
||||
mini_emit_init_rvar (cfg, dreg, t);
|
||||
ins = cfg->cbb->last_ins;
|
||||
} else {
|
||||
MONO_INST_NEW (cfg, ins, MONO_CLASS_IS_SIMD (cfg, arg0) ? OP_XZERO : OP_VZERO);
|
||||
ins->dreg = mono_alloc_dreg (cfg, STACK_VTYPE);
|
||||
ins->type = STACK_VTYPE;
|
||||
ins->klass = arg0;
|
||||
MONO_ADD_INS (cfg->cbb, ins);
|
||||
}
|
||||
return ins;
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -1399,10 +1399,10 @@ type_from_stack_type (MonoInst *ins) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static G_GNUC_UNUSED int
|
||||
type_to_stack_type (MonoCompile *cfg, MonoType *t)
|
||||
MonoStackType
|
||||
mini_type_to_stack_type (MonoCompile *cfg, MonoType *t)
|
||||
{
|
||||
t = mono_type_get_underlying_type (t);
|
||||
t = mini_type_get_underlying_type (t);
|
||||
switch (t->type) {
|
||||
case MONO_TYPE_I1:
|
||||
case MONO_TYPE_U1:
|
||||
@@ -1426,7 +1426,7 @@ type_to_stack_type (MonoCompile *cfg, MonoType *t)
|
||||
case MONO_TYPE_U8:
|
||||
return STACK_I8;
|
||||
case MONO_TYPE_R4:
|
||||
return cfg->r4_stack_type;
|
||||
return (MonoStackType)cfg->r4_stack_type;
|
||||
case MONO_TYPE_R8:
|
||||
return STACK_R8;
|
||||
case MONO_TYPE_VALUETYPE:
|
||||
@@ -1442,7 +1442,7 @@ type_to_stack_type (MonoCompile *cfg, MonoType *t)
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
return -1;
|
||||
return (MonoStackType)-1;
|
||||
}
|
||||
|
||||
static MonoClass*
|
||||
@@ -2175,7 +2175,7 @@ direct_icalls_enabled (MonoCompile *cfg, MonoMethod *method)
|
||||
if (cfg->gen_sdb_seq_points || cfg->disable_direct_icalls)
|
||||
return FALSE;
|
||||
|
||||
if (method && cfg->compile_aot && mono_aot_direct_icalls_enabled_for_method (cfg, method))
|
||||
if (method && mono_aot_direct_icalls_enabled_for_method (cfg, method))
|
||||
return TRUE;
|
||||
|
||||
/* LLVM on amd64 can't handle calls to non-32 bit addresses */
|
||||
@@ -4370,8 +4370,8 @@ check_inline_caller_method_name_limit (MonoMethod *caller_method)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
emit_init_rvar (MonoCompile *cfg, int dreg, MonoType *rtype)
|
||||
void
|
||||
mini_emit_init_rvar (MonoCompile *cfg, int dreg, MonoType *rtype)
|
||||
{
|
||||
static double r8_0 = 0.0;
|
||||
static float r4_0 = 0.0;
|
||||
@@ -4433,7 +4433,7 @@ emit_dummy_init_rvar (MonoCompile *cfg, int dreg, MonoType *rtype)
|
||||
} else if (((t == MONO_TYPE_VAR) || (t == MONO_TYPE_MVAR)) && mini_type_var_is_vt (rtype)) {
|
||||
MONO_EMIT_NEW_DUMMY_INIT (cfg, dreg, OP_DUMMY_VZERO);
|
||||
} else {
|
||||
emit_init_rvar (cfg, dreg, rtype);
|
||||
mini_emit_init_rvar (cfg, dreg, rtype);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4445,11 +4445,11 @@ emit_init_local (MonoCompile *cfg, int local, MonoType *type, gboolean init)
|
||||
if (COMPILE_SOFT_FLOAT (cfg)) {
|
||||
MonoInst *store;
|
||||
int reg = alloc_dreg (cfg, (MonoStackType)var->type);
|
||||
emit_init_rvar (cfg, reg, type);
|
||||
mini_emit_init_rvar (cfg, reg, type);
|
||||
EMIT_NEW_LOCSTORE (cfg, store, local, cfg->cbb->last_ins);
|
||||
} else {
|
||||
if (init)
|
||||
emit_init_rvar (cfg, var->dreg, type);
|
||||
mini_emit_init_rvar (cfg, var->dreg, type);
|
||||
else
|
||||
emit_dummy_init_rvar (cfg, var->dreg, type);
|
||||
}
|
||||
@@ -4639,7 +4639,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
|
||||
if (bb->last_ins && bb->last_ins->opcode == OP_NOT_REACHED) {
|
||||
cfg->cbb = bb;
|
||||
|
||||
emit_init_rvar (cfg, rvar->dreg, fsig->ret);
|
||||
mini_emit_init_rvar (cfg, rvar->dreg, fsig->ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4653,7 +4653,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
|
||||
* set, so set it to a dummy value.
|
||||
*/
|
||||
if (!ret_var_set)
|
||||
emit_init_rvar (cfg, rvar->dreg, fsig->ret);
|
||||
mini_emit_init_rvar (cfg, rvar->dreg, fsig->ret);
|
||||
|
||||
EMIT_NEW_TEMPLOAD (cfg, ins, rvar->inst_c0);
|
||||
*sp++ = ins;
|
||||
@@ -8738,7 +8738,7 @@ calli_end:
|
||||
} else {
|
||||
if (m_class_is_valuetype (cmethod->klass)) {
|
||||
iargs [0] = mono_compile_create_var (cfg, m_class_get_byval_arg (cmethod->klass), OP_LOCAL);
|
||||
emit_init_rvar (cfg, iargs [0]->dreg, m_class_get_byval_arg (cmethod->klass));
|
||||
mini_emit_init_rvar (cfg, iargs [0]->dreg, m_class_get_byval_arg (cmethod->klass));
|
||||
EMIT_NEW_TEMPLOADA (cfg, *sp, iargs [0]->inst_c0);
|
||||
|
||||
alloc = NULL;
|
||||
|
||||
+18
-19
@@ -1786,6 +1786,9 @@ mono_summarize_unmanaged_stack (MonoThreadSummary *out)
|
||||
|
||||
if (out->unmanaged_frames [i].str_descr [0] != '\0')
|
||||
out->unmanaged_frames [i].unmanaged_data.has_name = TRUE;
|
||||
|
||||
out->hashes.offset_free_hash = summarize_offset_free_hash (out->hashes.offset_free_hash, frame);
|
||||
out->hashes.offset_rich_hash = summarize_offset_rich_hash (out->hashes.offset_rich_hash, frame);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3363,7 +3366,6 @@ print_stack_frame_to_string (StackFrameInfo *frame, MonoContext *ctx, gpointer d
|
||||
}
|
||||
|
||||
#ifndef MONO_CROSS_COMPILE
|
||||
static gboolean handle_crash_loop = FALSE;
|
||||
|
||||
/*
|
||||
* mono_handle_native_crash:
|
||||
@@ -3372,30 +3374,30 @@ static gboolean handle_crash_loop = FALSE;
|
||||
* printing diagnostic information and aborting.
|
||||
*/
|
||||
void
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info)
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, void *context)
|
||||
{
|
||||
MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
|
||||
|
||||
if (handle_crash_loop)
|
||||
return;
|
||||
|
||||
#ifdef MONO_ARCH_USE_SIGACTION
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = SIG_DFL;
|
||||
sigemptyset (&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
|
||||
/* Remove our SIGABRT handler */
|
||||
/* Mono has crashed - remove our handlers except SIGTERM, which is used by crash reporting */
|
||||
/* TODO: Combine with mono_runtime_cleanup_handlers (but with an option to not de-allocate anything) */
|
||||
if (mini_debug_options.handle_sigint) {
|
||||
g_assert (sigaction (SIGINT, &sa, NULL) != -1);
|
||||
}
|
||||
|
||||
g_assert (sigaction (SIGABRT, &sa, NULL) != -1);
|
||||
|
||||
/* On some systems we get a SIGILL when calling abort (), because it might
|
||||
* fail to raise SIGABRT */
|
||||
g_assert (sigaction (SIGFPE, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGSYS, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGSEGV, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGQUIT, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGBUS, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGILL, &sa, NULL) != -1);
|
||||
|
||||
/* Remove SIGCHLD, it uses the finalizer thread */
|
||||
g_assert (sigaction (SIGCHLD, &sa, NULL) != -1);
|
||||
|
||||
/* Remove SIGQUIT, we are already dumping threads */
|
||||
g_assert (sigaction (SIGQUIT, &sa, NULL) != -1);
|
||||
|
||||
#endif
|
||||
@@ -3408,11 +3410,8 @@ mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLE
|
||||
}
|
||||
}
|
||||
|
||||
/* prevent infinite loops in crash handling */
|
||||
handle_crash_loop = TRUE;
|
||||
|
||||
/*
|
||||
* A SIGSEGV indicates something went very wrong so we can no longer depend
|
||||
* A crash indicates something went very wrong so we can no longer depend
|
||||
* on anything working. So try to print out lots of diagnostics, starting
|
||||
* with ones which have a greater chance of working.
|
||||
*/
|
||||
@@ -3438,13 +3437,13 @@ mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLE
|
||||
g_async_safe_printf ("=================================================================\n");
|
||||
}
|
||||
|
||||
mono_post_native_crash_handler (signal, mctx, info, mono_do_crash_chaining);
|
||||
mono_post_native_crash_handler (signal, mctx, info, mono_do_crash_chaining, context);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info)
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, void *context)
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -1169,6 +1169,8 @@ get_wrapper_shared_vtype (MonoType *t)
|
||||
if ((mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT)
|
||||
return NULL;
|
||||
mono_class_setup_fields (klass);
|
||||
if (mono_class_has_failure (klass))
|
||||
return NULL;
|
||||
|
||||
int num_fields = mono_class_get_field_count (klass);
|
||||
MonoClassField *klass_fields = m_class_get_fields (klass);
|
||||
@@ -2261,7 +2263,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
|
||||
if (mono_class_field_is_special_static (field)) {
|
||||
gpointer addr;
|
||||
|
||||
mono_class_vtable_checked (domain, klass, error);
|
||||
mono_class_vtable_checked (domain, field->parent, error);
|
||||
mono_error_assert_ok (error);
|
||||
|
||||
/* Return the TLS offset */
|
||||
@@ -3894,12 +3896,15 @@ shared_gparam_equal (gconstpointer ka, gconstpointer kb)
|
||||
MonoType*
|
||||
mini_get_shared_gparam (MonoType *t, MonoType *constraint)
|
||||
{
|
||||
MonoImageSet *set;
|
||||
MonoGenericParam *par = t->data.generic_param;
|
||||
MonoGSharedGenericParam *copy, key;
|
||||
MonoType *res;
|
||||
MonoImage *image = NULL;
|
||||
char *name;
|
||||
|
||||
set = mono_metadata_merge_image_sets (mono_metadata_get_image_set_for_type (t), mono_metadata_get_image_set_for_type (constraint));
|
||||
|
||||
memset (&key, 0, sizeof (key));
|
||||
key.parent = par;
|
||||
key.param.gshared_constraint = constraint;
|
||||
@@ -3911,23 +3916,24 @@ mini_get_shared_gparam (MonoType *t, MonoType *constraint)
|
||||
* Need a cache to ensure the newly created gparam
|
||||
* is unique wrt T/CONSTRAINT.
|
||||
*/
|
||||
mono_image_lock (image);
|
||||
if (!image->gshared_types) {
|
||||
image->gshared_types_len = MONO_TYPE_INTERNAL;
|
||||
image->gshared_types = g_new0 (GHashTable*, image->gshared_types_len);
|
||||
mono_image_set_lock (set);
|
||||
if (!set->gshared_types) {
|
||||
set->gshared_types_len = MONO_TYPE_INTERNAL;
|
||||
set->gshared_types = g_new0 (GHashTable*, set->gshared_types_len);
|
||||
}
|
||||
if (!image->gshared_types [constraint->type])
|
||||
image->gshared_types [constraint->type] = g_hash_table_new (shared_gparam_hash, shared_gparam_equal);
|
||||
res = (MonoType *)g_hash_table_lookup (image->gshared_types [constraint->type], &key);
|
||||
mono_image_unlock (image);
|
||||
if (!set->gshared_types [constraint->type])
|
||||
set->gshared_types [constraint->type] = g_hash_table_new (shared_gparam_hash, shared_gparam_equal);
|
||||
res = (MonoType *)g_hash_table_lookup (set->gshared_types [constraint->type], &key);
|
||||
mono_image_set_unlock (set);
|
||||
if (res)
|
||||
return res;
|
||||
copy = (MonoGSharedGenericParam *)mono_image_alloc0 (image, sizeof (MonoGSharedGenericParam));
|
||||
copy = (MonoGSharedGenericParam *)mono_image_set_alloc0 (set, sizeof (MonoGSharedGenericParam));
|
||||
memcpy (©->param, par, sizeof (MonoGenericParamFull));
|
||||
copy->param.info.pklass = NULL;
|
||||
constraint = mono_metadata_type_dup (image, constraint);
|
||||
// FIXME:
|
||||
constraint = mono_metadata_type_dup (NULL, constraint);
|
||||
name = get_shared_gparam_name (constraint->type, ((MonoGenericParamFull*)copy)->info.name);
|
||||
copy->param.info.name = mono_image_strdup (image, name);
|
||||
copy->param.info.name = mono_image_set_strdup (set, name);
|
||||
g_free (name);
|
||||
|
||||
copy->param.owner = par->owner;
|
||||
@@ -3938,12 +3944,10 @@ mini_get_shared_gparam (MonoType *t, MonoType *constraint)
|
||||
res = mono_metadata_type_dup (NULL, t);
|
||||
res->data.generic_param = (MonoGenericParam*)copy;
|
||||
|
||||
if (image) {
|
||||
mono_image_lock (image);
|
||||
/* Duplicates are ok */
|
||||
g_hash_table_insert (image->gshared_types [constraint->type], copy, res);
|
||||
mono_image_unlock (image);
|
||||
}
|
||||
mono_image_set_lock (set);
|
||||
/* Duplicates are ok */
|
||||
g_hash_table_insert (set->gshared_types [constraint->type], copy, res);
|
||||
mono_image_set_unlock (set);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
+4
-10
@@ -645,12 +645,6 @@ primitive_type_to_llvm_type (MonoTypeEnum type)
|
||||
}
|
||||
}
|
||||
|
||||
static MonoTypeEnum
|
||||
inst_c1_type (const MonoInst *ins)
|
||||
{
|
||||
return (MonoTypeEnum)ins->inst_c1;
|
||||
}
|
||||
|
||||
/*
|
||||
* type_to_llvm_type:
|
||||
*
|
||||
@@ -7594,7 +7588,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
|
||||
}
|
||||
|
||||
case OP_SSE_LOADU: {
|
||||
LLVMValueRef dst_ptr = convert (ctx, lhs, LLVMPointerType (primitive_type_to_llvm_type (inst_c1_type (ins)), 0));
|
||||
LLVMValueRef dst_ptr = convert (ctx, lhs, LLVMPointerType (primitive_type_to_llvm_type (ins->inst_c1), 0));
|
||||
LLVMValueRef dst_vec = LLVMBuildBitCast (builder, dst_ptr, LLVMPointerType (type_to_simd_type (ins->inst_c1), 0), "");
|
||||
values [ins->dreg] = mono_llvm_build_aligned_load (builder, dst_vec, "", FALSE, ins->inst_c0); // inst_c0 is alignment
|
||||
break;
|
||||
@@ -7713,7 +7707,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
|
||||
case OP_CREATE_SCALAR_UNSAFE: {
|
||||
values [ins->dreg] = LLVMBuildInsertElement (builder,
|
||||
LLVMGetUndef (simd_class_to_llvm_type (ctx, ins->klass)),
|
||||
convert (ctx, lhs, primitive_type_to_llvm_type (inst_c1_type (ins))),
|
||||
convert (ctx, lhs, primitive_type_to_llvm_type (ins->inst_c1)),
|
||||
LLVMConstInt (LLVMInt32Type (), 0, FALSE), "");
|
||||
break;
|
||||
}
|
||||
@@ -7751,7 +7745,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
|
||||
// other overloads are implemented with `insertelement`
|
||||
values [ins->dreg] = LLVMBuildInsertElement (builder,
|
||||
values [ins->sreg1],
|
||||
convert (ctx, values [ins->sreg2], primitive_type_to_llvm_type (inst_c1_type (ins))),
|
||||
convert (ctx, values [ins->sreg2], primitive_type_to_llvm_type (ins->inst_c1)),
|
||||
convert (ctx, values [ins->sreg3], LLVMInt8Type ()), dname);
|
||||
}
|
||||
break;
|
||||
@@ -10721,7 +10715,7 @@ mono_llvm_emit_aot_module (const char *filename, const char *cu_name)
|
||||
* result to 0 (indicating success). */
|
||||
LLVMWriteBitcodeToFile (module->lmodule, filename);
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
{
|
||||
char *verifier_err;
|
||||
|
||||
|
||||
+11
-7
@@ -231,7 +231,7 @@ MONO_SIG_HANDLER_FUNC (static, sigabrt_signal_handler)
|
||||
return;
|
||||
mono_sigctx_to_monoctx (ctx, &mctx);
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, info);
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, info, ctx);
|
||||
else
|
||||
abort ();
|
||||
}
|
||||
@@ -253,7 +253,7 @@ MONO_SIG_HANDLER_FUNC (static, sigterm_signal_handler)
|
||||
// running. Returns FALSE on unrecoverable error.
|
||||
if (mono_dump_start ()) {
|
||||
// Process was killed from outside since crash reporting wasn't running yet.
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, NULL, ctx);
|
||||
} else {
|
||||
// Crash reporting already running and we got a second SIGTERM from as part of thread-summarizing
|
||||
if (!mono_threads_summarize_execute (&mctx, &output, &hashes, FALSE, NULL, 0))
|
||||
@@ -456,8 +456,6 @@ mono_runtime_posix_install_handlers (void)
|
||||
add_signal_handler (SIGUSR2, sigusr2_signal_handler, SA_RESTART);
|
||||
sigaddset (&signal_set, SIGUSR2);
|
||||
}
|
||||
add_signal_handler (SIGTRAP, mono_crashing_signal_handler, 0);
|
||||
sigaddset (&signal_set, SIGTRAP);
|
||||
add_signal_handler (SIGSYS, mono_crashing_signal_handler, 0);
|
||||
sigaddset (&signal_set, SIGSYS);
|
||||
|
||||
@@ -504,6 +502,7 @@ mono_runtime_cleanup_handlers (void)
|
||||
remove_signal_handler (SIGBUS);
|
||||
if (mono_jit_trace_calls != NULL)
|
||||
remove_signal_handler (SIGUSR2);
|
||||
remove_signal_handler (SIGSYS);
|
||||
|
||||
remove_signal_handler (SIGABRT);
|
||||
|
||||
@@ -1028,10 +1027,10 @@ dump_native_stacktrace (const char *signal, MonoContext *mctx)
|
||||
g_async_safe_printf ("=================================================================\n");
|
||||
|
||||
if (!leave) {
|
||||
mono_summarize_timeline_start ();
|
||||
mono_summarize_timeline_start (signal);
|
||||
mono_summarize_toggle_assertions (TRUE);
|
||||
|
||||
int mono_max_summary_len = 500000;
|
||||
int mono_max_summary_len = 10000000;
|
||||
int mono_state_tmp_file_tag = 1;
|
||||
mono_state_alloc_mem (&merp_mem, mono_state_tmp_file_tag, mono_max_summary_len * sizeof (gchar));
|
||||
|
||||
@@ -1159,7 +1158,7 @@ mono_dump_native_crash_info (const char *signal, MonoContext *mctx, MONO_SIG_HAN
|
||||
}
|
||||
|
||||
void
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining)
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining, void *context)
|
||||
{
|
||||
if (!crash_chaining) {
|
||||
/*Android abort is a fluke, it doesn't abort, it triggers another segv. */
|
||||
@@ -1169,6 +1168,11 @@ mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_
|
||||
abort ();
|
||||
#endif
|
||||
}
|
||||
mono_chain_signal (info->si_signo, info, context);
|
||||
|
||||
// we remove Mono's signal handlers from crashing signals in mono_handle_native_crash(), so re-raising will now allow the OS to handle the crash
|
||||
// TODO: perhaps we can always use this to abort, instead of explicit exit()/abort() as we do above
|
||||
raise (info->si_signo);
|
||||
}
|
||||
#endif /* !MONO_CROSS_COMPILE */
|
||||
|
||||
|
||||
Loaded 100 of 138 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user