Переглянути джерело

Remove sdks/ directory to reduce confusion (#21647)

Legacy Android and iOS are building from the 2020-02 branch and modern Android/iOS/WebAssembly are built from the https://github.com/dotnet/runtime repo.
Alexander Köplinger 2 роки тому
батько
коміт
1da2d9803f
100 змінених файлів з 2 додано та 17818 видалено
  1. 0 9
      .github/CODEOWNERS
  2. 0 2
      .gitignore
  3. 0 2
      README.md
  4. 1 2
      mcs/tools/linker/Makefile
  5. 0 177
      scripts/ci/pipeline/sdks-archive.groovy
  6. 1 260
      scripts/ci/run-jenkins.sh
  7. 0 3
      sdks/.gitignore
  8. 0 37
      sdks/Make.config.sample
  9. 0 8
      sdks/Makefile
  10. 0 75
      sdks/README.md
  11. 0 8
      sdks/android/.gitignore
  12. 0 204
      sdks/android/Makefile
  13. 0 1
      sdks/android/app/.gitignore
  14. 0 50
      sdks/android/app/CMakeLists.txt
  15. 0 278
      sdks/android/app/assets/mconfig
  16. 0 41
      sdks/android/app/build.gradle
  17. 0 21
      sdks/android/app/proguard-rules.pro
  18. 0 22
      sdks/android/app/src/main/AndroidManifest.xml
  19. 0 808
      sdks/android/app/src/main/c/runtime-bootstrap.c
  20. 0 163
      sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java
  21. 0 27
      sdks/android/build.gradle
  22. BIN
      sdks/android/gradle/wrapper/gradle-wrapper.jar
  23. 0 6
      sdks/android/gradle/wrapper/gradle-wrapper.properties
  24. 0 172
      sdks/android/gradlew
  25. 0 70
      sdks/android/lldb-android.sh
  26. 0 85
      sdks/android/managed/fake-monodroid.cs
  27. 0 1
      sdks/android/settings.gradle
  28. 0 113
      sdks/android/xa-lldb
  29. 0 7
      sdks/android/xtc/Makefile
  30. 0 43
      sdks/android/xtc/RuntimeTests.csproj
  31. 0 17
      sdks/android/xtc/RuntimeTests.sln
  32. 0 84
      sdks/android/xtc/Tests.cs
  33. 0 5
      sdks/android/xtc/packages.config
  34. 0 54
      sdks/builds/.gitignore
  35. 0 250
      sdks/builds/Makefile
  36. 0 521
      sdks/builds/android.mk
  37. 0 73
      sdks/builds/bcl.mk
  38. 0 39
      sdks/builds/create-shared-library.sh
  39. 0 32
      sdks/builds/desktop.mk
  40. 0 16
      sdks/builds/determine-linux-flavor.sh
  41. 0 58
      sdks/builds/ios-Mono.framework-Info.plist
  42. 0 56
      sdks/builds/ios-Mono.framework-tvos.Info.plist
  43. 0 56
      sdks/builds/ios-Mono.framework-watchos.Info.plist
  44. 0 634
      sdks/builds/ios.mk
  45. 0 156
      sdks/builds/llvm.mk
  46. 0 182
      sdks/builds/mac.mk
  47. 0 120
      sdks/builds/maccat.mk
  48. 0 20
      sdks/builds/mxe-Win32.cmake.in
  49. 0 20
      sdks/builds/mxe-Win64.cmake.in
  50. 0 30
      sdks/builds/mxe.mk
  51. 0 278
      sdks/builds/runtime.mk
  52. 0 58
      sdks/builds/unzip-android-archive.sh
  53. 0 240
      sdks/builds/wasm.mk
  54. 0 67
      sdks/builds/wrap-configure.sh
  55. 0 15
      sdks/desktop/Makefile
  56. 0 272
      sdks/ios/Makefile
  57. 0 71
      sdks/ios/README.md
  58. 0 2
      sdks/ios/app/.gitignore
  59. 0 12
      sdks/ios/app/Entitlements.plist.in
  60. 0 55
      sdks/ios/app/Info.plist.in
  61. 0 80
      sdks/ios/app/Makefile
  62. 0 142
      sdks/ios/app/main.m
  63. 0 16
      sdks/ios/app/runtime.h
  64. 0 492
      sdks/ios/app/runtime.m
  65. 0 360
      sdks/ios/appbuilder/appbuilder.cs
  66. 0 319
      sdks/ios/harness/harness.cs
  67. 0 295
      sdks/ios/test-runner/runner.cs
  68. 0 15
      sdks/ios/test-runner/xi.cs
  69. BIN
      sdks/ios/test-runner/xi.snk
  70. 0 17
      sdks/paths.mk
  71. 0 41
      sdks/versions.mk
  72. 0 12
      sdks/wasm/.gitignore
  73. 0 13
      sdks/wasm/BrowserDebugHost/BrowserDebugHost.csproj
  74. 0 40
      sdks/wasm/BrowserDebugHost/Program.cs
  75. 0 27
      sdks/wasm/BrowserDebugHost/Properties/launchSettings.json
  76. 0 164
      sdks/wasm/BrowserDebugHost/Startup.cs
  77. 0 15
      sdks/wasm/BrowserDebugProxy/BrowserDebugProxy.csproj
  78. 0 31
      sdks/wasm/BrowserDebugProxy/BrowserDebugProxy.sln
  79. 0 883
      sdks/wasm/BrowserDebugProxy/DebugStore.cs
  80. 0 29
      sdks/wasm/BrowserDebugProxy/DebuggerProxy.cs
  81. 0 329
      sdks/wasm/BrowserDebugProxy/DevToolsHelper.cs
  82. 0 381
      sdks/wasm/BrowserDebugProxy/DevToolsProxy.cs
  83. 0 352
      sdks/wasm/BrowserDebugProxy/EvaluateExpression.cs
  84. 0 75
      sdks/wasm/BrowserDebugProxy/MemberReferenceResolver.cs
  85. 0 977
      sdks/wasm/BrowserDebugProxy/MonoProxy.cs
  86. 0 695
      sdks/wasm/DebuggerTestSuite/ArrayTests.cs
  87. 0 981
      sdks/wasm/DebuggerTestSuite/CallFunctionOnTests.cs
  88. 0 67
      sdks/wasm/DebuggerTestSuite/DateTimeTests.cs
  89. 0 19
      sdks/wasm/DebuggerTestSuite/DebuggerTestSuite.csproj
  90. 0 306
      sdks/wasm/DebuggerTestSuite/DelegateTests.cs
  91. 0 167
      sdks/wasm/DebuggerTestSuite/DevToolsClient.cs
  92. 0 466
      sdks/wasm/DebuggerTestSuite/EvaluateOnCallFrameTests.cs
  93. 0 264
      sdks/wasm/DebuggerTestSuite/ExceptionTests.cs
  94. 0 81
      sdks/wasm/DebuggerTestSuite/InspectorClient.cs
  95. 0 558
      sdks/wasm/DebuggerTestSuite/PointerTests.cs
  96. 0 1064
      sdks/wasm/DebuggerTestSuite/Support.cs
  97. 0 15
      sdks/wasm/DebuggerTestSuite/TestHarnessOptions.cs
  98. 0 59
      sdks/wasm/DebuggerTestSuite/TestHarnessProxy.cs
  99. 0 255
      sdks/wasm/DebuggerTestSuite/TestHarnessStartup.cs
  100. 0 1528
      sdks/wasm/DebuggerTestSuite/Tests.cs

+ 0 - 9
.github/CODEOWNERS

@@ -140,15 +140,6 @@
 /scripts @akoeplinger @directhex
 /scripts/ci @akoeplinger @directhex
 
-/sdks @marek-safar @vargaz @lambdageek
-/sdks/builds/android* @alexischr @jonpryor
-/sdks/builds/mxe* @alexischr @jonpryor
-/sdks/builds/ios* @vargaz @rolfbjarne
-/sdks/builds/wasm* @vargaz @kjpou1 @lewing
-/sdks/wasm @vargaz @kjpou1 @kg @lewing
-/sdks/ios @vargaz @rolfbjarne
-/sdks/android @alexischr @jonpryor
-
 /support @lambdageek @vargaz
 
 /tools @lambdageek @vargaz

+ 0 - 2
.gitignore

@@ -136,8 +136,6 @@ extensions-config.h
 *.mlpd
 llvm/build/
 llvm/usr/
-sdks/builds/llvm-*/
-sdks/builds/android-*/
 mcs/build/compiler-server.log
 
 ##############################################################################

+ 0 - 2
README.md

@@ -206,8 +206,6 @@ runtime as an embedded library.
 
 * `scripts/` - Scripts used to invoke Mono and the corresponding program.
 
-* `sdks/` - A new way of embedding Mono into Xamarin.iOS, Xamarin.Android and other products.
-
 * `support/` - Various support libraries.
 
 * `tools/` - A collection of tools, mostly used during Mono development.

+ 1 - 2
mcs/tools/linker/Makefile

@@ -110,8 +110,7 @@ BINARY_TEST_CASES = \
 endif
 
 ifeq ($(PROFILE),wasm)
-LINKER_PROFILE_OPTIONS += --exclude-feature remoting --exclude-feature com --exclude-feature etw -d $(topdir)/../external/binary-reference-assemblies/build/monowasm \
---substitutions $(topdir)/../sdks/wasm/src/linker-subs.xml
+LINKER_PROFILE_OPTIONS += --exclude-feature remoting --exclude-feature com --exclude-feature etw -d $(topdir)/../external/binary-reference-assemblies/build/monowasm
 
 BINARY_TEST_CASES_ROOT:=../../../external/illinker-test-assets/wasm/
 

+ 0 - 177
scripts/ci/pipeline/sdks-archive.groovy

@@ -1,177 +0,0 @@
-isPr = (env.ghprbPullId && !env.ghprbPullId.empty ? true : false)
-monoBranch = (isPr ? "pr" : env.BRANCH_NAME)
-jobName = env.JOB_NAME.split('/').first()
-
-if (monoBranch == 'main') {
-    properties([ /* compressBuildLog() */  // compression is incompatible with JEP-210 right now
-                disableConcurrentBuilds()
-    ])
-}
-
-parallel (
-    "Android Darwin (Debug)": {
-        throttle(['provisions-android-toolchain']) {
-            node ("osx-devices") {
-                archive ("android", "debug", "Darwin")
-            }
-        }
-    },
-    "Android Darwin (Release)": {
-        throttle(['provisions-android-toolchain']) {
-            node ("osx-devices") {
-                archive ("android", "release", "Darwin")
-            }
-        }
-    },
-    "Android Windows (Release)": {
-        throttle(['provisions-android-toolchain']) {
-            node ("w64") {
-                archive ("android", "release", "Windows")
-            }
-        }
-    },
-    "Android Linux (Debug)": {
-        throttle(['provisions-android-toolchain']) {
-            node ("debian-10-amd64-exclusive") {
-                archive ("android", "debug", "Linux", "debian-10-amd64multiarchi386-preview", "g++-mingw-w64 gcc-mingw-w64 lib32stdc++6 lib32z1 libz-mingw-w64-dev linux-libc-dev:i386 zlib1g-dev zlib1g-dev:i386 adoptopenjdk-8-hotspot rsync python3-pip", "/mnt/scratch")
-            }
-        }
-    },
-    "Android Linux (Release)": {
-        throttle(['provisions-android-toolchain']) {
-            node ("debian-10-amd64-exclusive") {
-                archive ("android", "release", "Linux", "debian-10-amd64multiarchi386-preview", "g++-mingw-w64 gcc-mingw-w64 lib32stdc++6 lib32z1 libz-mingw-w64-dev linux-libc-dev:i386 zlib1g-dev zlib1g-dev:i386 adoptopenjdk-8-hotspot rsync python3-pip", "/mnt/scratch")
-            }
-        }
-    },
-    "iOS (Xcode 12.4)": {
-        throttle(['provisions-ios-toolchain']) {
-            node ("xcode124") {
-                archive ("ios", "release", "Darwin", "", "", "", "xcode124")
-            }
-        }
-    },
-    "Mac (Xcode 12.4)": {
-        throttle(['provisions-mac-toolchain']) {
-            node ("xcode124") {
-                archive ("mac", "release", "Darwin", "", "", "", "xcode124")
-            }
-        }
-    },
-    "Mac Catalyst (Xcode 12.4)": {
-        throttle(['provisions-mac-toolchain']) {
-            node ("xcode124") {
-                archive ("maccat", "release", "Darwin", "", "", "", "xcode124")
-            }
-        }
-    },
-    "WASM Linux": {
-        if (monoBranch != 'main') {
-            echo "Skipping WASM build on non-main branch."
-            return
-        }
-        throttle(['provisions-wasm-toolchain']) {
-            node ("ubuntu-1804-amd64") {
-                archive ("wasm", "release", "Linux", "ubuntu-1804-amd64-preview", "npm dotnet-sdk-2.1 nuget openjdk-8-jre python3-pip")
-            }
-        }
-    }
-)
-
-def archive (product, configuration, platform, chrootname = "", chrootadditionalpackages = "", chrootBindMounts = "", xcodeVersion = "") {
-    def packageFileName = null
-    def packageFileSha1 = null
-    def commitHash = null
-    def commitContext = (xcodeVersion == "" ? "Archive-${product}-${configuration}-${platform}" : "Archive-${product}-${configuration}-${platform}-${xcodeVersion}")
-    def azureArtifactUrl = null
-    def azureContainerName = "mono-sdks"
-    def azureVirtualPath = null
-    def utils = null
-
-    ws ("workspace/${jobName}/${monoBranch}/${product}/${configuration}") {
-        timestamps {
-            stage('Checkout') {
-                echo "Running on ${env.NODE_NAME}"
-
-                // clone and checkout repo
-                checkout scm
-
-                utils = load "scripts/ci/pipeline/utils.groovy"
-
-                // remove old stuff
-                sh 'git reset --hard HEAD'
-                // homebrew Git 2.22.0 misparses the submodule command and passes arguments like --hard and -xdff
-                // to git-submodule instead of to git-reset or git-clean.  Passing the entire command as a single
-                // argument seems to help.
-                sh 'git submodule foreach --recursive "git reset --hard HEAD"'
-                sh 'git clean -xdff'
-                sh 'git submodule foreach --recursive "git clean -xdff"'
-
-                // get current commit sha
-                commitHash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim()
-                currentBuild.displayName = "${commitHash.substring(0,7)}"
-            }
-            try {
-                stage('Build') {
-                    utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, commitContext, env.BUILD_URL, 'PENDING', 'Building...')
-
-                    // build the Archive
-                    timeout (time: 300, unit: 'MINUTES') {
-                        if (platform == "Darwin") {
-                            def brewpackages = "autoconf automake ccache cmake coreutils gdk-pixbuf gettext glib gnu-sed gnu-tar intltool ios-deploy jpeg libffi libidn2 libpng libtiff libtool libunistring ninja openssl p7zip pcre pkg-config scons wget xz mingw-w64 make"
-                            if (product == "android") {
-                                brewpackages = "${brewpackages} xamarin/xamarin-android-windeps/mingw-zlib"
-                                sh "brew tap xamarin/xamarin-android-windeps"
-                            }
-                            sh "brew install ${brewpackages} || brew upgrade ${brewpackages}"
-                            sh "CI_TAGS=sdks-${product},no-tests,${configuration},${xcodeVersion} scripts/ci/run-jenkins.sh"
-                        } else if (platform == "Linux") {
-                            chroot chrootName: chrootname,
-                                command: "CI_TAGS=sdks-${product},no-tests,${configuration} ANDROID_TOOLCHAIN_DIR=/mnt/scratch/android-toolchain ANDROID_TOOLCHAIN_CACHE_DIR=/mnt/scratch/android-archives scripts/ci/run-jenkins.sh",
-                                bindMounts: chrootBindMounts,
-                                additionalPackages: "xvfb xauth mono-devel git python wget bc build-essential libtool autoconf automake gettext iputils-ping cmake lsof libkrb5-dev curl p7zip-full ninja-build zip unzip gcc-multilib g++-multilib mingw-w64 binutils-mingw-w64 ${chrootadditionalpackages}"
-                        } else if (platform == "Windows") {
-                            sh "PATH=\"/usr/bin:/usr/local/bin:$PATH\" CI_TAGS=sdks-${product},win-amd64,no-tests,${configuration},${xcodeVersion} scripts/ci/run-jenkins.sh"
-                        } else {
-                            throw new Exception("Unknown platform \"${platform}\"")
-                        }
-                    }
-                    // find Archive in the workspace root
-                    packageFileName = findFiles (glob: "${product}-${configuration}-${platform}-${commitHash}.*")[0].name
-
-                    // compute SHA1 of the Archive
-                    packageFileSha1 = sha1 (packageFileName)
-                    writeFile (file: "${packageFileName}.sha1", text: "${packageFileSha1}")
-
-                    // include xcode version in virtual path if necessary
-                    if (xcodeVersion == "") {
-                        azureVirtualPath = ""
-                        azureArtifactUrl = "https://xamjenkinsartifact.azureedge.net/${azureContainerName}/${packageFileName}"
-                    } else {
-                        azureVirtualPath = "xcode-" + readFile ("xcode_version.txt")
-                        azureArtifactUrl = "https://xamjenkinsartifact.azureedge.net/${azureContainerName}/${azureVirtualPath}/${packageFileName}"
-                    }
-                }
-                stage('Upload Archive to Azure') {
-                    azureUpload(storageCredentialId: "fbd29020e8166fbede5518e038544343",
-                                storageType: "blobstorage",
-                                containerName: azureContainerName,
-                                virtualPath: azureVirtualPath,
-                                filesPath: "${packageFileName},${packageFileName}.sha1",
-                                allowAnonymousAccess: true,
-                                pubAccessible: true,
-                                doNotWaitForPreviousBuild: true,
-                                uploadArtifactsOnlyIfSuccessful: true)
-                }
-
-                sh 'git clean -xdff'
-
-                utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, commitContext, azureArtifactUrl, 'SUCCESS', packageFileName)
-            }
-            catch (Exception e) {
-                utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, commitContext, env.BUILD_URL, 'FAILURE', "Build failed.")
-                throw e
-            }
-        }
-    }
-}

+ 1 - 260
scripts/ci/run-jenkins.sh

@@ -32,14 +32,6 @@ source ${MONO_REPO_ROOT}/scripts/ci/util.sh
 # 		skip_step="CI provisioning scripts"
 # 		skip=true
 # 	fi
-# 	if ! grep -q -v a/sdks/wasm pr-files.txt; then
-# 		if [[ ${CI_TAGS} == *'webassembly'* ]] || [[ ${CI_TAGS} == *'wasm'* ]]; then
-# 			true
-# 		else
-# 			skip_step="WASM"
-# 			skip=true
-# 		fi
-# 	fi
 # 	if [ $skip = true ]; then
 # 		${TESTCMD} --label="Skipped on ${skip_step}." --timeout=60m --fatal sh -c 'exit 0'
 # 		if [[ $CI_TAGS == *'apidiff'* ]]; then report_github_status "success" "API Diff" "Skipped." || true; fi
@@ -86,7 +78,7 @@ export EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-crash-privacy=no "
 if [[ ${CI_TAGS} == *'osx-i386'* ]]; then EXTRA_CFLAGS="$EXTRA_CFLAGS -m32 -arch i386 -mmacosx-version-min=10.9"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -m32 -arch i386"; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --host=i386-apple-darwin13.0.0 --build=i386-apple-darwin13.0.0"; fi
 if [[ ${CI_TAGS} == *'osx-amd64'* ]]; then EXTRA_CFLAGS="$EXTRA_CFLAGS -m64 -arch x86_64 -mmacosx-version-min=10.9"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -m64 -arch x86_64" EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib"; fi
 if [[ ${CI_TAGS} == *'win-i386'* ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=i686-w64-mingw32 --enable-btls"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/Win32/bin/Release/mono-sgen.exe"; fi
-if [[ ${CI_TAGS} == *'win-amd64'* && ${CI_TAGS} != *'sdks-android'* ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm --enable-btls"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/x64/bin/Release/mono-sgen.exe"; fi
+if [[ ${CI_TAGS} == *'win-amd64'* ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm --enable-btls"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/x64/bin/Release/mono-sgen.exe"; fi
 if [[ ${CI_TAGS} == *'freebsd-amd64'* ]]; then export CC="clang"; export CXX="clang++"; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-dtrace --disable-boehm ac_cv_header_sys_inotify_h=no ac_cv_func_inotify_init=no ac_cv_func_inotify_add_watch=no ac_cv_func_inotify_rm_watch=no"; fi
 if [[ ${CI_TAGS} == *'make-install'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm --prefix=${MONO_REPO_ROOT}/tmp/monoprefix"; fi
 
@@ -159,257 +151,6 @@ then
 	fi
 fi
 
-if [[ ${CI_TAGS} == *'sdks-llvm'* ]]; then
-	${TESTCMD} --label=archive --timeout=120m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-llvm-llvm{,win}64 NINJA=
-	exit 0
-fi
-
-if [[ ${CI_TAGS} == *'sdks-ios'* ]];
-   then
-        # configuration on our bots
-        if [[ ${CI_TAGS} == *'xcode113'* ]]; then
-            export XCODE_DIR=/Applications/Xcode113.app/Contents/Developer
-            export MACOS_VERSION=10.15
-            export IOS_VERSION=13.2
-            export TVOS_VERSION=13.2
-            export WATCHOS_VERSION=6.1
-            export WATCHOS64_32_VERSION=6.1
-        elif [[ ${CI_TAGS} == *'xcode124'* ]]; then
-            export XCODE_DIR=/Applications/Xcode124.app/Contents/Developer
-            export MACOS_VERSION=11.1
-            export IOS_VERSION=14.4
-            export TVOS_VERSION=14.3
-            export WATCHOS_VERSION=7.2
-            export WATCHOS64_32_VERSION=7.2
-        else
-            export XCODE_DIR=/Applications/Xcode101.app/Contents/Developer
-            export MACOS_VERSION=10.14
-            export IOS_VERSION=12.1
-            export TVOS_VERSION=12.1
-            export WATCHOS_VERSION=5.1
-            export WATCHOS64_32_VERSION=5.1
-        fi
-
-        # retrieve selected Xcode version
-        /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' ${XCODE_DIR}/../version.plist > xcode_version.txt
-
-        # make sure we embed the correct path into the PDBs
-        export MONOTOUCH_MCS_FLAGS=-pathmap:${MONO_REPO_ROOT}/=/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/
-
-        echo "ENABLE_IOS=1" > sdks/Make.config
-        if [[ ${CI_TAGS} == *'cxx'* ]]; then
-            echo "ENABLE_CXX=1" >> sdks/Make.config
-        fi
-        if [[ ${CI_TAGS} == *'debug'* ]]; then
-            echo "CONFIGURATION=debug" >> sdks/Make.config
-        fi
-
-        ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-ios NINJA=
-        ${TESTCMD} --label=build     --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-ios     NINJA=
-        ${TESTCMD} --label=archive   --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-ios   NINJA=
-
-        if [[ ${CI_TAGS} != *'no-tests'* ]]; then
-            # Simulator runs
-            export sim_test_suites="Mono.Runtime.Tests corlib System System.Core System.Data System.Net.Http System.Numerics System.Runtime.Serialization System.Transactions System.IO.Compression System.IO.Compression.FileSystem System.Json System.ComponentModel.DataAnnotations System.Security System.Xml System.Xml.Linq System.ServiceModel.Web System.Web.Services Mono.CSharp Mono.Data.Sqlite Mono.Data.Tds Mono.Security"
-
-            ${TESTCMD} --label=build-ios-sim --timeout=20m $gnumake -C sdks/ios build-ios-sim-all
-            for suite in ${sim_test_suites}; do ${TESTCMD} --label=run-ios-sim-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-sim-${suite}; done
-
-            # Device runs
-            if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then
-                export device_test_suites="Mono.Runtime.Tests System.Core"
-
-                ${TESTCMD} --label=build-ios-dev --timeout=60m $gnumake -C sdks/ios build-ios-dev-all
-                for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
-
-                ${TESTCMD} --label=build-ios-dev-llvm --timeout=60m $gnumake -C sdks/ios build-ios-dev-llvm-all
-                for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-llvm-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
-
-                ${TESTCMD} --label=build-ios-dev-interp-only --timeout=60m $gnumake -C sdks/ios build-ios-dev-interp-only-all
-                for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-interp-only-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
-
-                ${TESTCMD} --label=build-ios-dev-interp-mixed --timeout=60m $gnumake -C sdks/ios build-ios-dev-interp-mixed-all
-                for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-interp-mixed-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
-            fi
-        fi
-        exit 0
-fi
-
-
-if [[ ${CI_TAGS} == *'sdks-maccat'* ]];
-then
-    # configuration on our bots
-    if [[ ${CI_TAGS} == *'xcode113'* ]]; then
-        export XCODE_DIR=/Applications/Xcode113.app/Contents/Developer
-        export MACOS_VERSION=10.15
-    elif [[ ${CI_TAGS} == *'xcode124'* ]]; then
-        export XCODE_DIR=/Applications/Xcode124.app/Contents/Developer
-        export MACOS_VERSION=11.1
-    else
-        export XCODE_DIR=/Applications/Xcode101.app/Contents/Developer
-        export MACOS_VERSION=10.14
-    fi
-
-    # retrieve selected Xcode version
-    /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' ${XCODE_DIR}/../version.plist > xcode_version.txt
-
-    # make sure we embed the correct path into the PDBs
-    export MONOTOUCH_MCS_FLAGS=-pathmap:${MONO_REPO_ROOT}/=/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/
-
-    echo "ENABLE_MACCAT=1" > sdks/Make.config
-    if [[ ${CI_TAGS} == *'cxx'* ]]; then
-        echo "ENABLE_CXX=1" >> sdks/Make.config
-    fi
-    if [[ ${CI_TAGS} == *'debug'* ]]; then
-        echo "CONFIGURATION=debug" >> sdks/Make.config
-    fi
-
-    ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-maccat NINJA=
-    ${TESTCMD} --label=build     --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-maccat     NINJA=
-    ${TESTCMD} --label=archive   --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-maccat   NINJA=
-
-    exit 0
-fi
-
-if [[ ${CI_TAGS} == *'sdks-mac'* ]];
-then
-    # configuration on our bots
-    if [[ ${CI_TAGS} == *'xcode113'* ]]; then
-        export XCODE_DIR=/Applications/Xcode113.app/Contents/Developer
-        export MACOS_VERSION=10.15
-    elif [[ ${CI_TAGS} == *'xcode124'* ]]; then
-        export XCODE_DIR=/Applications/Xcode124.app/Contents/Developer
-        export MACOS_VERSION=11.1
-    else
-        export XCODE_DIR=/Applications/Xcode101.app/Contents/Developer
-        export MACOS_VERSION=10.14
-    fi
-
-    # retrieve selected Xcode version
-    /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' ${XCODE_DIR}/../version.plist > xcode_version.txt
-
-    # make sure we embed the correct path into the PDBs
-    export XAMMAC_MCS_FLAGS=-pathmap:${MONO_REPO_ROOT}/=/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/src/Xamarin.Mac/
-
-    echo "ENABLE_MAC=1" > sdks/Make.config
-    if [[ ${CI_TAGS} == *'cxx'* ]]; then
-        echo "ENABLE_CXX=1" >> sdks/Make.config
-    fi
-    if [[ ${CI_TAGS} == *'debug'* ]]; then
-        echo "CONFIGURATION=debug" >> sdks/Make.config
-    fi
-
-    ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-mac NINJA=
-    ${TESTCMD} --label=build     --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-mac     NINJA=
-    ${TESTCMD} --label=archive   --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-mac   NINJA=
-
-    exit 0
-fi
-
-if [[ ${CI_TAGS} == *'sdks-android'* ]];
-   then
-        echo "ENABLE_ANDROID=1" > sdks/Make.config
-        echo "DISABLE_CCACHE=1" >> sdks/Make.config
-        if [[ ${CI_TAGS} == *'cxx'* ]]; then
-            echo "ENABLE_CXX=1" >> sdks/Make.config
-        fi
-        if [[ ${CI_TAGS} == *'debug'* ]]; then
-            echo "CONFIGURATION=debug" >> sdks/Make.config
-        fi
-
-        # TODO: provision-android on Windows.
-        if [[ ${CI_TAGS} != *'win-'* ]]; then
-        # For some very strange reasons, `make -C sdks/android accept-android-license` get stuck when invoked through ${TESTCMD}
-            # but doesn't get stuck when called via the shell, so let's just call it here now.
-            ${TESTCMD} --label=provision-android --timeout=120m --fatal $gnumake -j ${CI_CPU_COUNT} -C sdks/builds provision-android && $gnumake -C sdks/android accept-android-license
-        fi
-        ${TESTCMD} --label=provision-mxe --timeout=240m --fatal $gnumake -j ${CI_CPU_COUNT} -C sdks/builds provision-mxe
-
-        ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-android NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1
-        ${TESTCMD} --label=build     --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-android     NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1
-        ${TESTCMD} --label=archive   --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-android   NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1
-
-        if [[ ${CI_TAGS} != *'no-tests'* ]]; then
-            ${TESTCMD} --label=mini --timeout=20m $gnumake -C sdks/android check-Mono.Runtime.Tests
-            ${TESTCMD} --label=corlib --timeout=20m $gnumake -C sdks/android check-corlib
-            ${TESTCMD} --label=System --timeout=20m $gnumake -C sdks/android check-System
-            ${TESTCMD} --label=System.Core --timeout=20m $gnumake -C sdks/android check-System.Core
-            ${TESTCMD} --label=System.Data --timeout=20m $gnumake -C sdks/android check-System.Data
-            ${TESTCMD} --label=System.IO.Compression.FileSystem --timeout=20m $gnumake -C sdks/android check-System.IO.Compression.FileSystem
-            ${TESTCMD} --label=System.IO.Compression --timeout=20m $gnumake -C sdks/android check-System.IO.Compression
-            ${TESTCMD} --label=System.Json --timeout=20m $gnumake -C sdks/android check-System.Json
-            ${TESTCMD} --label=System.Net.Http --timeout=20m $gnumake -C sdks/android check-System.Net.Http
-            ${TESTCMD} --label=System.Numerics --timeout=20m $gnumake -C sdks/android check-System.Numerics
-            ${TESTCMD} --label=System.Runtime.Serialization --timeout=20m $gnumake -C sdks/android check-System.Runtime.Serialization
-            ${TESTCMD} --label=System.ServiceModel.Web --timeout=20m $gnumake -C sdks/android check-System.ServiceModel.Web
-            ${TESTCMD} --label=System.Transactions --timeout=20m $gnumake -C sdks/android check-System.Transactions
-            ${TESTCMD} --label=System.Xml --timeout=20m $gnumake -C sdks/android check-System.Xml
-            ${TESTCMD} --label=System.Xml.Linq --timeout=20m $gnumake -C sdks/android check-System.Xml.Linq
-            ${TESTCMD} --label=Mono.CSharp --timeout=20m $gnumake -C sdks/android check-Mono.CSharp
-            # ${TESTCMD} --label=Mono.Data.Sqlite --timeout=20m $gnumake -C sdks/android check-Mono.Data.Sqlite
-            ${TESTCMD} --label=Mono.Data.Tds --timeout=20m $gnumake -C sdks/android check-Mono.Data.Tds
-            ${TESTCMD} --label=Mono.Security --timeout=20m $gnumake -C sdks/android check-Mono.Security
-            ${TESTCMD} --label=Mono.Debugger.Soft --timeout=20m $gnumake -C sdks/android check-Mono.Debugger.Soft
-        fi
-        exit 0
-fi
-
-if [[ ${CI_TAGS} == *'webassembly'* ]] || [[ ${CI_TAGS} == *'wasm'* ]];
-   then
-        echo "ENABLE_WASM=1" > sdks/Make.config
-
-        if [[ ${CI_TAGS} != *'osx-amd64'* ]]; then
-            echo "ENABLE_WINDOWS=1" >> sdks/Make.config
-            #echo "ENABLE_WASM_DYNAMIC_RUNTIME=1" >> sdks/Make.config
-        fi
-
-        if [[ ${CI_TAGS} == *'cxx'* ]]; then
-            echo "ENABLE_CXX=1" >> sdks/Make.config
-        fi
-        if [[ ${CI_TAGS} == *'debug'* ]]; then
-            echo "CONFIGURATION=debug" >> sdks/Make.config
-        fi
-
-        echo "ENABLE_WASM_THREADS=1" >> sdks/Make.config
-
-        export aot_test_suites="System.Core"
-        export mixed_test_suites="System.Core"
-        export xunit_test_suites="System.Core corlib System Microsoft.CSharp System.Data System.IO.Compression System.Net.Http.UnitTests System.Numerics System.Runtime.Serialization System.Security System.Xml System.Xml.Linq"
-
-        ${TESTCMD} --label=provision --timeout=20m --fatal $gnumake --output-sync=recurse --trace -C sdks/builds provision-wasm
-
-        ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-wasm NINJA=
-        ${TESTCMD} --label=build     --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-wasm     NINJA=
-        ${TESTCMD} --label=archive   --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-wasm   NINJA=
-
-        ${TESTCMD} --label=wasm-build --timeout=20m --fatal $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm build
-        ${TESTCMD} --label=package --timeout=20m $gnumake -C sdks/wasm package
-
-        if [[ ${CI_TAGS} != *'no-tests'* ]]; then
-            ${TESTCMD} --label=mini --timeout=20m $gnumake -C sdks/wasm run-all-mini
-            ${TESTCMD} --label=v8-corlib --timeout=20m $gnu$gnumake -C sdks/wasm run-v8-corlib
-            # https://github.com/mono/mono/issues/19957
-            #${TESTCMD} --label=debugger --timeout=40m $gnumake -C sdks/wasm run-debugger-tests
-            ${TESTCMD} --label=mini-system --timeout=60m $gnu$gnumake -C sdks/wasm run-all-System
-            ${TESTCMD} --label=system-core --timeout=60m $gnumake -C sdks/wasm run-all-System.Core
-            for suite in ${xunit_test_suites}; do ${TESTCMD} --label=xunit-${suite} --timeout=30m $gnumake -C sdks/wasm run-${suite}-xunit; done
-            # disable for now until https://github.com/mono/mono/pull/13622 goes in
-            #${TESTCMD} --label=browser --timeout=20m $gnumake -C sdks/wasm run-browser-tests
-            #${TESTCMD} --label=browser-threads --timeout=20m $gnumake -C sdks/wasm run-browser-threads-tests
-            #${TESTCMD} --label=browser-dynamic --timeout=20m $gnumake -C sdks/wasm run-browser-dynamic-tests
-            if [[ ${CI_TAGS} == *'osx-amd64'* ]]; then
-                ${TESTCMD} --label=browser-safari --timeout=20m $gnumake -C sdks/wasm run-browser-safari-tests            
-            fi
-            ${TESTCMD} --label=aot-mini --timeout=20m $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm run-aot-mini
-            ${TESTCMD} --label=build-aot-all --timeout=20m $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm build-aot-all
-            for suite in ${aot_test_suites}; do ${TESTCMD} --label=run-aot-${suite} --timeout=10m $gnumake -C sdks/wasm run-aot-${suite}; done
-            for suite in ${mixed_test_suites}; do ${TESTCMD} --label=run-aot-mixed-${suite} --timeout=10m $gnumake -C sdks/wasm run-aot-mixed-${suite}; done
-            #${TESTCMD} --label=check-aot --timeout=20m $gnumake -C sdks/wasm check-aot
-        fi
-        exit 0
-fi
-
-
 if [[ ${CI_TAGS} != *'mac-sdk'* ]]; # Mac SDK builds Mono itself
 	then
 	echo ./autogen.sh CFLAGS="$CFLAGS $EXTRA_CFLAGS" CXXFLAGS="$CXXFLAGS $EXTRA_CXXFLAGS" LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" $EXTRA_CONF_FLAGS

+ 0 - 3
sdks/.gitignore

@@ -1,3 +0,0 @@
-out/
-ios/*.log
-Make.config

+ 0 - 37
sdks/Make.config.sample

@@ -1,37 +0,0 @@
-#This is a sample file of all options that can be used by a Make.config file.
-
-#Enables building Android
-ENABLE_ANDROID = 1
-
-#Disables building Android
-#DISABLE_ANDROID = 1
-
-#Disables building iOS
-#DISABLE_IOS = 1
-
-#Disables building Mac
-#DISABLE_MAC = 1
-
-#Disables build WebAssembly
-#DISABLE_WASM = 1
-
-#Disables WebAssembly Windows cross build
-#DISABLE_WASM_CROSS = 1
-
-#Disables building the BCL
-#DISABLE_BCL = 1
-
-#Disables building the Desktop profile
-#DISABLE_DESKTOP = 1
-
-#Disables building LLVM toolchain (some targets like ios/android/wasm will still use it)
-#DISABLE_LLVM = 1
-
-#Enables passing --enable-cxx to configure.
-#ENABLE_CXX = 1
-
-# Enable WASM threads build
-#ENABLE_WASM_THREADS=1
-
-# Enable WASM dynamic runtime build
-#ENABLE_WASM_DYNAMIC_RUNTIME=1

+ 0 - 8
sdks/Makefile

@@ -1,8 +0,0 @@
-
-all:
-	$(MAKE) -C builds all
-	$(MAKE) -C android all
-
-clean:
-	$(MAKE) -C builds clean
-	$(MAKE) -C android clean

+ 0 - 75
sdks/README.md

@@ -1,75 +0,0 @@
-This project provides build scripts and sample apps for Mono targeting its supported platforms. Supported are Android, iOS and WebAssembly.
-
-# Build instructions
-
-## Dependencies
-
-- automake 1.16.1
-
-  if you have already built before using a previous version of automake you may need to clean the repo.
-
-  ```bash
-  git clean -xffd
-  ```
-
-  The previous should be sufficient but if that does not work then try hard resetting
-
-  ```bash
-  git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive
-  ```
-
-- [ninja build system](https://ninja-build.org)
-
-  - Getting Ninja
-
-    You can [download the Ninja binary](https://github.com/ninja-build/ninja/releases) or [find
-    it in your system's package manager](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages)
-
-## Setup
-
-Copy `Make.config.sample` to `Make.config` and edit the new file to disable building the target you're not interested in.
-Unless you have a very particular need, the BCL build should be left enabled as it's needed by all test runners.
-
-## Building for XA/XI/XM and WebAssembly
-
-To build Mono for Android, iOS or WebAssembly, the build scripts can be found in `sdks/builds/`. 
-
-For Android, you need to copy `sdks/Make.config.sample` to `sdks/Make.config` and set
-
-```
-ENABLE_ANDROID = 1
-```
-
-The `make` targets are as follow:
-
-```bash
-# Android
-make -C sdks/builds provision-android && make -C sdks/android accept-android-license
-make -C sdks/builds provision-mxe
-make -C sdks/builds archive-android NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1
-
-# iOS
-make -C sdks/builds archive-ios NINJA=
-
-# WebAssembly
-make -C sdks/builds provision-wasm
-make -C sdks/builds archive-wasm  NINJA=
-
-# Mac
-make -C sdks/builds archive-mac [upcoming]
-```
-
-# WebAssembly
-
-Go to the `wasm` directory for building and testing WebAssembly.  For more information view the [WebAssembly readme](./wasm/README.md)
-
-
-# Dependencies
-
-| Project     | Dependencies        |
-| ----------- | ------------------- |
-| Android     | Android SDK and NDK |
-| iOS         | Xcode               |
-| WebAssembly |                     |
-
-See `sdks/versions.mk` for specific version numbers, and `sdks/paths.mk` for where they should be installed. These dependencies will not be installed as part of the build process, and will be expected to be present; an error will be triggered if it's not the case. If you need an additional version, please do contact us or submit a pull-request against [mono/mono](https://github.com/mono/mono).

+ 0 - 8
sdks/android/.gitignore

@@ -1,8 +0,0 @@
-/.gradle
-/.idea
-/.stamp-package
-/.stamp-install
-/app/assets
-/app/src/main/jniLibs/
-/lldb-mono-0.1
-/local.properties

+ 0 - 204
sdks/android/Makefile

@@ -1,204 +0,0 @@
-TOP=$(realpath $(CURDIR)/../..)
--include $(TOP)/sdks/Make.config
-include $(TOP)/sdks/versions.mk
-include $(TOP)/sdks/paths.mk
-
-UNAME=$(shell uname)
-
-SDK_DIR = $(or $(ANDROID_SDK_ROOT),$(ANDROID_TOOLCHAIN_DIR)/sdk)
-NDK_DIR = $(or $(ANDROID_NDK_ROOT),$(ANDROID_TOOLCHAIN_DIR)/ndk)
-
-ADB       = $(SDK_DIR)/platform-tools/adb
-
-PACKAGE   = org.mono.android.AndroidTestRunner
-RUNNER    = org.mono.android.AndroidRunner
-ACTIVITY  = org.mono.android.AndroidActivity
-
-CONFIGURATION?=release
-
-APK_DIR=apk
-
-DEBUGGER_RUNNER_EXE = app/assets/asm/dtest-app.exe
-DEBUGGER_RUNNER_PDB = app/assets/asm/dtest-app.pdb
-
-ifeq ($(ENABLE_INTERPRETER),1)
-SDK_OUT_PREFIX := $(TOP)/sdks/out/android-interpreter
-else
-SDK_OUT_PREFIX := $(TOP)/sdks/out/android
-endif
-
-CHECKS=$(subst mscorlib,corlib,$(patsubst $(TOP)/sdks/out/android-bcl/monodroid/tests/monodroid_%_test.dll,%,$(wildcard $(TOP)/sdks/out/android-bcl/monodroid/tests/monodroid_*_test.dll)))
-
-.PHONY: all
-all: .stamp-package
-
-#This is hilarious, but we can't clean unless we got the 2 property files around
-.PHONY: clean
-clean:
-	./gradlew clean
-
-.PHONY: check
-check: $(patsubst %,check-%,$(CHECKS))
-
-## Helper targets
-
-.PHONY: undeploy
-undeploy:
-	$(ADB) uninstall $(PACKAGE)
-
-.PHONY: kill
-kill:
-	$(ADB) shell am force-stop $(PACKAGE)
-
-.PHONY: logcat
-logcat:
-	$(ADB) logcat
-
-.PHONY: shell
-shell:
-	$(ADB) shell
-
-## Accept Android License
-
-.PHONY: accept-android-license
-accept-android-license:
-	yes | $(SDK_DIR)/tools/bin/sdkmanager --sdk_root=$(SDK_DIR) --licenses
-
-## Check targets
-
-local.properties:
-	echo "sdk.dir=$(SDK_DIR)" >  $@
-	echo "ndk.dir=$(NDK_DIR)" >> $@
-
-## Directories
-
-app/assets/asm app/src/main/jniLibs/armeabi-v7a app/src/main/jniLibs/arm64-v8a app/src/main/jniLibs/x86 app/src/main/jniLibs/x86_64 app/assets/armeabi-v7a app/assets/arm64-v8a app/assets/x86 app/assets/x86_64:
-	mkdir -p $@
-
-## Package the monosgen-2.0, MonoPosixHelper and mono-native libraries
-
-MONO_LIBS= \
-	libmonosgen-2.0.so \
-	libMonoPosixHelper.so \
-	libmono-btls-shared.so \
-	libmono-native.so
-
-$(patsubst %,app/src/main/jniLibs/armeabi-v7a/%,$(MONO_LIBS)): app/src/main/jniLibs/armeabi-v7a/%: $(SDK_OUT_PREFIX)-armeabi-v7a-$(CONFIGURATION)/lib/% | app/src/main/jniLibs/armeabi-v7a
-	cp $< $@
-
-.stamp-package: $(patsubst %,app/src/main/jniLibs/armeabi-v7a/%,$(MONO_LIBS))
-
-$(patsubst %,app/src/main/jniLibs/arm64-v8a/%,$(MONO_LIBS)): app/src/main/jniLibs/arm64-v8a/%: $(SDK_OUT_PREFIX)-arm64-v8a-$(CONFIGURATION)/lib/% | app/src/main/jniLibs/arm64-v8a
-	cp $< $@
-
-.stamp-package: $(patsubst %,app/src/main/jniLibs/arm64-v8a/%,$(MONO_LIBS))
-
-$(patsubst %,app/src/main/jniLibs/x86/%,$(MONO_LIBS)): app/src/main/jniLibs/x86/%: $(SDK_OUT_PREFIX)-x86-$(CONFIGURATION)/lib/% | app/src/main/jniLibs/x86
-	cp $< $@
-
-.stamp-package: $(patsubst %,app/src/main/jniLibs/x86/%,$(MONO_LIBS))
-
-$(patsubst %,app/src/main/jniLibs/x86_64/%,$(MONO_LIBS)): app/src/main/jniLibs/x86_64/%: $(SDK_OUT_PREFIX)-x86_64-$(CONFIGURATION)/lib/% | app/src/main/jniLibs/x86_64
-	cp $< $@
-
-.stamp-package: $(patsubst %,app/src/main/jniLibs/x86_64/%,$(MONO_LIBS))
-
-## Package Mono.Android.dll
-
-app/assets/asm/Mono.Android.dll: managed/fake-monodroid.cs | app/assets/asm
-	csc /nostdlib /noconfig /langversion:latest /t:library /out:$@ $(patsubst %,-r:$(TOP)/sdks/out/android-bcl/monodroid/%.dll,mscorlib System System.Core) $<
-
-.stamp-package: app/assets/asm/Mono.Android.dll
-
-## Package the BCL
-
-BCL=$(patsubst $(TOP)/sdks/out/android-bcl/monodroid/%,%,$(shell find $(TOP)/sdks/out/android-bcl/monodroid -type f))
-
-$(patsubst %,app/assets/asm/%,$(BCL)): app/assets/asm/%: $(TOP)/sdks/out/android-bcl/monodroid/% | app/assets/asm
-	cp -R $(TOP)/sdks/out/android-bcl/monodroid/* app/assets/asm
-
-.stamp-package: $(patsubst %,app/assets/asm/%,$(BCL))
-
-## Package LLDB
-
-lldb-mono-0.1:
-	wget --no-verbose -O - 'https://github.com/mono/lldb-binaries/releases/download/v0.1/lldb-mono-0.1.tar.gz' | tar xvfz -
-
-#FIXME: armeabi-v7a in place of armeabi
-lldb-mono-0.1/android/armeabi/lldb-server: | lldb-mono-0.1
-
-app/assets/armeabi-v7a/lldb-server: lldb-mono-0.1/android/armeabi/lldb-server | app/assets/armeabi-v7a
-	cp $< $@
-	chmod 777 $@
-
-.stamp-package: app/assets/armeabi-v7a/lldb-server
-
-lldb-mono-0.1/android/arm64-v8a/lldb-server: | lldb-mono-0.1
-
-app/assets/arm64-v8a/lldb-server: lldb-mono-0.1/android/arm64-v8a/lldb-server | app/assets/arm64-v8a
-	cp $< $@
-	chmod 777 $@
-
-.stamp-package: app/assets/arm64-v8a/lldb-server
-
-lldb-mono-0.1/android/x86/lldb-server: | lldb-mono-0.1
-
-app/assets/x86/lldb-server: lldb-mono-0.1/android/x86/lldb-server | app/assets/x86
-	cp $< $@
-	chmod 777 $@
-
-.stamp-package: app/assets/x86/lldb-server
-
-lldb-mono-0.1/android/x86_64/lldb-server: | lldb-mono-0.1
-
-app/assets/x86_64/lldb-server: lldb-mono-0.1/android/x86_64/lldb-server | app/assets/x86_64
-	cp $< $@
-	chmod 777 $@
-
-.stamp-package: app/assets/x86_64/lldb-server
-
-## Run Mono.Debugger.Soft, Mono.Profiler.Log and BCL tests
-
-.stamp-package:
-	touch $@
-
-.stamp-install: .stamp-package local.properties app/src/main/c/runtime-bootstrap.c app/src/main/java/org/mono/android/AndroidRunner.java
-	./gradlew uninstallAll assembleDebug installDebug
-	touch $@
-
-.PHONY: check-Mono.Debugger.Soft
-check-Mono.Debugger.Soft: .stamp-install
-	PATH="$$PATH:$(dir $(ADB))" mono --debug $(TOP)/sdks/out/android-bcl/monodroid_tools/nunit-lite-console.exe \
-		-labels \
-		-exclude:NotOnMac,NotWorking,CAS,InetAccess,MobileNotWorking,AndroidNotWorking,LargeFileSupport,AndroidSdksNotWorking \
-		-remote:android:$(PACKAGE)/$(RUNNER) \
-		-result:TestResult-Mono.Debugger.Soft.xml \
-		-format:nunit2 \
-		$(if $(TESTNAME),-test:$(TESTNAME)) \
-		$(TOP)/sdks/out/android-bcl/monodroid_tools/tests/monodroid_tools_Mono.Debugger.Soft_test.dll
-
-# TODO: profiler
-# .PHONY: check-Mono.Profiler.Log
-# check-Mono.Profiler.Log: .stamp-install
-# 	PATH="$$PATH:$(dir $(ADB))" mono --debug $(TOP)/sdks/out/android-bcl/monodroid_tools/nunit-lite-console.exe \
-# 		-labels \
-# 		-exclude:NotOnMac,NotWorking,CAS,InetAccess,MobileNotWorking,AndroidNotWorking,AndroidSdksNotWorking \
-# 		-remote:android:$(PACKAGE)/$(RUNNER) \
-# 		-result:TestResult-Mono.Profiler.Log.xml \
-# 		-format:nunit2 \
-# 		$(if $(TESTNAME),-test:$(TESTNAME)) \
-# 		$(TOP)/sdks/out/android-bcl/monodroid_tools/tests/monodroid_tools_Mono.Profiler.Log_test.dll
-
-.PHONY: check-%
-check-%: .stamp-install
-	PATH="$$PATH:$(dir $(ADB))" mono --debug $(TOP)/sdks/out/android-bcl/monodroid_tools/nunit-lite-console.exe \
-		-labels \
-		-exclude:NotOnMac,NotWorking,CAS,InetAccess,MobileNotWorking,AndroidNotWorking,LargeFileSupport,AndroidSdksNotWorking \
-		-android:$(PACKAGE)/$(RUNNER) \
-		-result:TestResult-$*.xml \
-		-format:nunit2 \
-		$(if $(TESTNAME),-test:$(TESTNAME)) \
-		$(TOP)/sdks/out/android-bcl/monodroid/tests/monodroid_$*_test.dll
-
-attach-lldb:
-	PATH="$$PATH:$(dir $(ADB))" $(TOP)/sdks/android/lldb-android.sh "$(PACKAGE)"

+ 0 - 1
sdks/android/app/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 50
sdks/android/app/CMakeLists.txt

@@ -1,50 +0,0 @@
-# For more information about using CMake with Android Studio, read the
-# documentation: https://d.android.com/studio/projects/add-native-code.html
-
-# Sets the minimum version of CMake required to build the native library.
-
-cmake_minimum_required(VERSION 3.4.1)
-
-# Creates and names a library, sets it as either STATIC
-# or SHARED, and provides the relative paths to its source code.
-# You can define multiple libraries, and CMake builds them for you.
-# Gradle automatically packages shared libraries with your APK.
-
-add_library( # Sets the name of the library.
-             runtime-bootstrap
-
-             # Sets the library as a shared library.
-             SHARED
-
-             # Provides a relative path to your source file(s).
-             src/main/c/runtime-bootstrap.c )
-
-# Searches for a specified prebuilt library and stores the path as a
-# variable. Because CMake includes system libraries in the search path by
-# default, you only need to specify the name of the public NDK library
-# you want to add. CMake verifies that the library exists before
-# completing its build.
-
-find_library( # Sets the name of the path variable.
-              log-lib
-
-              # Specifies the name of the NDK library that
-              # you want CMake to locate.
-              log )
-
-# Specifies libraries CMake should link to your target library. You
-# can link multiple libraries, such as libraries you define in this
-# build script, prebuilt third-party libraries, or system libraries.
-
-target_link_libraries( # Specifies the target library.
-                       runtime-bootstrap
-
-                       # Specifies the mono libraries
-                       ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libmonosgen-2.0.so
-                       ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libMonoPosixHelper.so
-                       ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libmono-native.so
-                       ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libmono-btls-shared.so
-
-                       # Links the target library to the log library
-                       # included in the NDK.
-                       ${log-lib} )

+ 0 - 278
sdks/android/app/assets/mconfig

@@ -1,278 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<configuration>
-
-	<configSections>
-		<section name="configProtectedData" type="System.Configuration.ProtectedConfigurationSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-		<section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-		<section name="connectionStrings" type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-		<section name="mscorlib" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
-		<section name="runtime" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
-		<section name="assemblyBinding"  type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
-		<section name="satelliteassemblies" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
-		<section name="startup" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
-		<section name="system.codedom" type="System.CodeDom.Compiler.CodeDomConfigurationHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		<section name="system.runtime.remoting" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
-		<section name="system.windows.forms" type="System.Windows.Forms.WindowsFormsSection, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		<section name="windows" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
-		<section name="strongNames" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
-		<sectionGroup name="system.web" type="System.Web.Configuration.SystemWebSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-			<section name="anonymousIdentification" type="System.Web.Configuration.AnonymousIdentificationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="authorization" type="System.Web.Configuration.AuthorizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="browserCaps" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="clientTarget" type="System.Web.Configuration.ClientTargetSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="compilation" type="System.Web.Configuration.CompilationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="customErrors" type="System.Web.Configuration.CustomErrorsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="deployment" type="System.Web.Configuration.DeploymentSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" />
-			<section name="globalization" type="System.Web.Configuration.GlobalizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="healthMonitoring" type="System.Web.Configuration.HealthMonitoringSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="hostingEnvironment" type="System.Web.Configuration.HostingEnvironmentSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
-			<section name="httpCookies" type="System.Web.Configuration.HttpCookiesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="httpModules" type="System.Web.Configuration.HttpModulesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="httpRuntime" type="System.Web.Configuration.HttpRuntimeSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="identity" type="System.Web.Configuration.IdentitySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="machineKey" type="System.Web.Configuration.MachineKeySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="membership" type="System.Web.Configuration.MembershipSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="mobileControls" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-                        <section name="deviceFilters" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="pages" type="System.Web.Configuration.PagesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="processModel" type="System.Web.Configuration.ProcessModelSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" allowLocation="false" />
-			<section name="profile" type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="roleManager" type="System.Web.Configuration.RoleManagerSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="securityPolicy" type="System.Web.Configuration.SecurityPolicySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
-			<section name="sessionPageState" type="System.Web.Configuration.SessionPageStateSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="sessionState" type="System.Web.Configuration.SessionStateSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="siteMap" type="System.Web.Configuration.SiteMapSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="trace" type="System.Web.Configuration.TraceSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="trust" type="System.Web.Configuration.TrustSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
-			<section name="urlMappings" type="System.Web.Configuration.UrlMappingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			<section name="webControls" type="System.Web.Configuration.WebControlsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="webParts" type="System.Web.Configuration.WebPartsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="webServices" type="System.Web.Services.Configuration.WebServicesSection, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<section name="xhtmlConformance" type="System.Web.Configuration.XhtmlConformanceSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-			<sectionGroup name="caching" type="System.Web.Configuration.SystemWebCachingSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-				<section name="cache" type="System.Web.Configuration.CacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-				<section name="outputCache" type="System.Web.Configuration.OutputCacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-				<section name="outputCacheSettings" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-				<section name="sqlCacheDependency" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
-			</sectionGroup>
-			<section name="monoSettings" type="System.Web.Configuration.MonoSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-		</sectionGroup>
-		<sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-			<section name="authenticationModules" type="System.Net.Configuration.AuthenticationModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="connectionManagement" type="System.Net.Configuration.ConnectionManagementSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="defaultProxy" type="System.Net.Configuration.DefaultProxySection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<sectionGroup name="mailSettings" type="System.Net.Configuration.MailSettingsSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-				<section name="smtp" type="System.Net.Configuration.SmtpSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			</sectionGroup>
-			<section name="requestCaching" type="System.Net.Configuration.RequestCachingSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="settings" type="System.Net.Configuration.SettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="webRequestModules" type="System.Net.Configuration.WebRequestModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		</sectionGroup>
-		<section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		<sectionGroup name="system.serviceModel" type="System.ServiceModel.Configuration.ServiceModelSectionGroup, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-			<section name="behaviors" type="System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="bindings" type="System.ServiceModel.Configuration.BindingsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="client" type="System.ServiceModel.Configuration.ClientSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="diagnostics" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		</sectionGroup>
-		<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-		<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-	</configSections>
-
-	<connectionStrings>
-		<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
-		<add name="LocalSqliteServer" connectionString="Data Source=|DataDirectory|/aspnetdb.sqlite;version=3" providerName="Mono.Data.Sqlite"/>
-	</connectionStrings>
-	
-	<configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
-		<providers>
-			<add name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
-                             description="" keyContainerName="MonoFrameworkConfigurationKey" cspProviderName="" useMachineContainer="true" useOAEP="false" />
-			<add name="DataProtectionConfigurationProvider" type="System.Configuration.DpapiProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
-                             description="" useMachineProtection="true" keyEntropy="" />
-		</providers>
-	</configProtectedData>
-
-	<system.net>
-		<authenticationModules>
-			<add type="System.Net.BasicClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<add type="System.Net.DigestClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<add type="System.Net.NtlmClient, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		</authenticationModules>
-		<webRequestModules>
-			<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<add prefix="ftp" type="System.Net.FtpWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-		</webRequestModules>
-		<settings>
-			<ipv6 enabled="false"/>
-		</settings>
-	</system.net>
-
-	<system.runtime.remoting>
-		<application>
-			<channels>
-<!--				<channel ref="http client" displayName="http client (delay loaded)" delayLoadAsClientChannel="true" />-->
-				<channel ref="tcp client" displayName="tcp client (delay loaded)" delayLoadAsClientChannel="true" />
-<!--				<channel ref="ipc client" displayName="ipc client (delay loaded)" delayLoadAsClientChannel="true" /> -->
-			</channels>
-		</application>
-		<channels>
-<!--
-			<channel id="http" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<channel id="http client" type="System.Runtime.Remoting.Channels.Http.HttpClientChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<channel id="http server" type="System.Runtime.Remoting.Channels.Http.HttpServerChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
--->
-
-			<channel id="tcp" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<channel id="tcp client" type="System.Runtime.Remoting.Channels.Tcp.TcpClientChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<channel id="tcp server" type="System.Runtime.Remoting.Channels.Tcp.TcpServerChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-<!--
-			<channel id="ipc" type="System.Runtime.Remoting.Channels.Ipc.IpcChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<channel id="ipc client" type="System.Runtime.Remoting.Channels.Ipc.IpcClientChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-			<channel id="ipc server" type="System.Runtime.Remoting.Channels.Ipc.IpcServerChannel, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
--->
-		</channels>
-			<channelSinkProviders>
-				<clientProviders>
-					<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-					<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-				</clientProviders>
-				<serverProviders>
-					<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-					<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-					<provider id="wsdl" type="System.Runtime.Remoting.MetadataServices.SdlChannelSinkProvider, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-				</serverProviders>
-			</channelSinkProviders>
-	</system.runtime.remoting>
-	
-	<appSettings>
-	<!--<add key="yourkey" value="your value" /> -->
-	<!--<remove key="a key defined higher in the hierarchy" /> -->
-	<!--<clear/> Removes all defined settings -->
-	</appSettings>
-	<system.diagnostics>
-		<trace autoflush="false" indentsize="4" />
-	</system.diagnostics>
-        <system.drawing>
-        </system.drawing>
-
-	<system.data>
-	  <DbProviderFactories>
-	    <add name="Mono Sqlite Data Provider"  invariant="Mono.Data.SqliteClient" 
-		 description="Mono Framework Data Provider for SQLite (old version)" 
-		 type="Mono.Data.SqliteClient.SqliteFactory, Mono.Data.SqliteClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"/>
-	    <add name="Mono Sqlite Provider"  invariant="Mono.Data.Sqlite" 
-		 description="Mono Framework Data Provider for SQLite (new version)"
-		 type="Mono.Data.Sqlite.SqliteFactory, Mono.Data.Sqlite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"/>
-	    <add name="Odbc Data Provider"         invariant="System.Data.Odbc"         
-		 description=".Net Framework Data Provider for Odbc"      
-		 type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
-            <add name="OleDb Data Provider"        invariant="System.Data.OleDb"        
-		 description=".Net Framework Data Provider for OleDb"     
-		 type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
-            <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" 
-		 description=".Net Framework Data Provider for Oracle"    
-		 type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
-            <add name="SqlClient Data Provider"    invariant="System.Data.SqlClient"    
-		 description=".Net Framework Data Provider for SqlServer" 
-		 type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
-            <add name="Sybase Data Provider"    invariant="Mono.Data.SybaseClient"    
-		 description=".Net Framework Data Provider for Sybase" 
-		 type="Mono.Data.SybaseClient.SybaseClientFactory, Mono.Data.SybaseClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"/>
-	  </DbProviderFactories>
-	</system.data>
-
-	<mscorlib>
-		<cryptographySettings>
-			<cryptoNameMapping>
-				<cryptoClasses>
-					<cryptoClass monoMD2="Mono.Security.Cryptography.MD2Managed, Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
-				</cryptoClasses>
-				<nameEntry name="MD2" class="monoMD2" />
-			</cryptoNameMapping>
-			<oidMap>
-				<oidEntry OID="1.2.840.113549.2.2" name="MD2" />
-				<oidEntry OID="1.2.840.113549.2.2" name="Mono.Security.Cryptography.MD2Managed" />
-			</oidMap>
-		</cryptographySettings>
-	</mscorlib>
-
-	<strongNames>
-		<pubTokenMapping>
-			<!-- ECMA key -->
-			<map Token="b77a5c561934e089" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
-			<!-- Microsoft (final) key -->
-			<map Token="b03f5f7f11d50a3a" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
-			<!-- Microsoft (Web Service Enhancement) key -->
-			<map Token="31bf3856ad364e35" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
-			<!-- IBM (DB2 Data Provider) key -->
-			<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
-			<!-- Silverlight 2.0 key -->
-			<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
-		</pubTokenMapping>
-	</strongNames>
-
-	<system.web>
-		<webServices>
-			<protocols>
-				<add name="HttpSoap"/>
-				<add name="HttpSoap12"/>
-				<add name="HttpPost"/>
-				<add name="HttpGet"/>
-				<add name="Documentation"/>
-			</protocols>
-			<conformanceWarnings>
-				<add name="BasicProfile1_1"/>
-			</conformanceWarnings>
-			<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
-		</webServices>
-
-		<membership>
-			<providers>
-				<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
-				<!-- <add name="AspNetSqlMembershipProvider" type="Mainsoft.Web.Security.GenericMembershipProvider, Mainsoft.Web.Security" applicationName="/" connectionStringName="LocalSqlServer" /> -->
-			</providers>
-		</membership>
-
-		<roleManager>
-			<providers>
-				<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="/" connectionStringName="LocalSqlServer" />
-				<!-- <add name="AspNetSqlRoleProvider" type="Mainsoft.Web.Security.GenericRoleProvider, Mainsoft.Web.Security" applicationName="/" connectionStringName="LocalSqlServer" /> -->
-			</providers>
-		</roleManager>
-
-		<profile>
-        		<providers>
-            		    <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-		        </providers>
-    		</profile>
-	</system.web>
-
-	<system.serviceModel>
-		<extensions>
-			<behaviorExtensions>
-				<add name="enableWebScript" type="System.ServiceModel.Configuration.WebScriptEnablingElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
-				<add name="webHttp" type="System.ServiceModel.Configuration.WebHttpElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
-			</behaviorExtensions>
-			<bindingElementExtensions>
-				<add name="webMessageEncoding" type="System.ServiceModel.Configuration.WebMessageEncodingElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
-			</bindingElementExtensions>
-			<bindingExtensions>
-				<add name="webHttpBinding" type="System.ServiceModel.Configuration.WebHttpBindingCollectionElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
-			</bindingExtensions>
-		</extensions>
-	</system.serviceModel>
-</configuration>
-
-

+ 0 - 41
sdks/android/app/build.gradle

@@ -1,41 +0,0 @@
-apply plugin: 'com.android.application'
-
-android {
-    compileSdkVersion 28
-    defaultConfig {
-        applicationId "org.mono.android.AndroidTestRunner"
-        minSdkVersion 15
-        targetSdkVersion 28
-        versionCode 1
-        versionName "1.0"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-        externalNativeBuild {
-            cmake {
-                cFlags "-O0 -g"
-            }
-        }
-        ndk {
-            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
-        }
-    }
-    sourceSets {
-        main {
-            assets.srcDirs = ['assets']
-        }
-    }
-    externalNativeBuild {
-        cmake {
-            path "CMakeLists.txt"
-        }
-    }
-    packagingOptions{
-        doNotStrip "**/*.so"
-    }
-}
-
-dependencies {
-    implementation fileTree(dir: 'libs', include: ['*.jar'])
-    testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'com.android.support.test:runner:1.0.2'
-    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
-}

+ 0 - 21
sdks/android/app/proguard-rules.pro

@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile

+ 0 - 22
sdks/android/app/src/main/AndroidManifest.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="org.mono.android.AndroidTestRunner">
-
-  <uses-sdk
-      android:minSdkVersion="14" />
-  <uses-permission
-      android:name="android.permission.INTERNET"/>
-
-  <application>
-    <activity android:name="org.mono.android.AndroidActivity">
-      <intent-filter>
-        <action android:name="android.intent.action.MAIN" />
-          <category android:name="android.intent.category.LAUNCHER" />
-      </intent-filter>
-    </activity>
-  </application>
-
-  <instrumentation
-      android:name="org.mono.android.AndroidRunner"
-      android:targetPackage="org.mono.android.AndroidTestRunner" />
-</manifest>

+ 0 - 808
sdks/android/app/src/main/c/runtime-bootstrap.c

@@ -1,808 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <pthread.h>
-#include <dlfcn.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <jni.h>
-
-#include <linux/prctl.h>
-#include <android/log.h>
-#include <sys/system_properties.h>
-
-#define DEFAULT_DIRECTORY_MODE S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
-
-
-typedef enum {
-        MONO_IMAGE_OK,
-        MONO_IMAGE_ERROR_ERRNO,
-        MONO_IMAGE_MISSING_ASSEMBLYREF,
-        MONO_IMAGE_IMAGE_INVALID
-} MonoImageOpenStatus;
-
-typedef enum {
-	MONO_DEBUG_FORMAT_NONE,
-	MONO_DEBUG_FORMAT_MONO,
-	/* Deprecated, the mdb debugger is not longer supported. */
-	MONO_DEBUG_FORMAT_DEBUGGER
-} MonoDebugFormat;
-
-enum {
-        MONO_DL_EAGER = 0,
-        MONO_DL_LAZY  = 1,
-        MONO_DL_LOCAL = 2,
-        MONO_DL_MASK  = 3
-};
-
-typedef struct MonoDomain_ MonoDomain;
-typedef struct MonoAssembly_ MonoAssembly;
-typedef struct MonoMethod_ MonoMethod;
-typedef struct MonoException_ MonoException;
-typedef struct MonoString_ MonoString;
-typedef struct MonoArray_ MonoArray;
-typedef struct MonoClass_ MonoClass;
-typedef struct MonoImage_ MonoImage;
-typedef struct MonoObject_ MonoObject;
-typedef struct MonoThread_ MonoThread;
-typedef int32_t gboolean;
-
-/* Imported from `mono-logger.h` */
-typedef void (*MonoLogCallback) (const char *log_domain, const char *log_level, const char *message, int32_t fatal, void *user_data);
-
-/*
- * The "err" variable contents must be allocated using g_malloc or g_strdup
- */
-typedef void* (*MonoDlFallbackLoad) (const char *name, int flags, char **err, void *user_data);
-typedef void* (*MonoDlFallbackSymbol) (void *handle, const char *name, char **err, void *user_data);
-typedef void* (*MonoDlFallbackClose) (void *handle, void *user_data);
-
-typedef void *(*mono_dl_fallback_register_fn) (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func, MonoDlFallbackClose close_func, void *user_data);
-
-typedef MonoDomain* (*mono_jit_init_version_fn) (const char *root_domain_name, const char *runtime_version);
-typedef MonoAssembly* (*mono_assembly_open_fn) (const char *filename, MonoImageOpenStatus *status);
-typedef void (*mono_set_assemblies_path_fn) (const char* path);
-typedef MonoString* (*mono_string_new_fn) (MonoDomain *domain, const char *text);
-typedef MonoImage* (*mono_assembly_get_image_fn) (MonoAssembly *assembly);
-typedef MonoClass* (*mono_class_from_name_fn) (MonoImage *image, const char* name_space, const char *name);
-typedef MonoMethod* (*mono_class_get_method_from_name_fn) (MonoClass *klass, const char *name, int param_count);
-typedef MonoObject* (*mono_runtime_invoke_fn) (MonoMethod *method, void *obj, void **params, MonoObject **exc);
-typedef void (*mono_set_crash_chaining_fn) (int);
-typedef void (*mono_set_signal_chaining_fn) (int);
-typedef MonoThread *(*mono_thread_attach_fn) (MonoDomain *domain);
-typedef void (*mono_domain_set_config_fn) (MonoDomain *, const char *, const char *);
-typedef int (*mono_runtime_set_main_args_fn) (int argc, char* argv[]);
-typedef void (*mono_trace_init_fn) (void);
-typedef void (*mono_trace_set_log_handler_fn) (MonoLogCallback callback, void *user_data);
-typedef void (*mono_jit_parse_options_fn) (int argc, char * argv[]);
-typedef void (*mono_debug_init_fn) (MonoDebugFormat format);
-typedef gboolean (*mini_parse_debug_option_fn) (const char *option);
-typedef void (*mono_jit_cleanup_fn) (MonoDomain *domain);
-typedef void (*mono_jit_set_aot_mode_fn) (int /* MonoAotMode */ mode);
-
-typedef MonoArray *(*mono_array_new_fn) (MonoDomain *domain, MonoClass *eclass, uintptr_t n);
-typedef MonoClass *(*mono_get_string_class_fn) (void);
-typedef void (*mono_dllmap_insert_fn) (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc);
-
-static JavaVM *jvm;
-
-static mono_jit_init_version_fn mono_jit_init_version;
-static mono_assembly_open_fn mono_assembly_open;
-static mono_set_assemblies_path_fn mono_set_assemblies_path;
-static mono_string_new_fn mono_string_new;
-static mono_assembly_get_image_fn mono_assembly_get_image;
-static mono_class_from_name_fn mono_class_from_name;
-static mono_class_get_method_from_name_fn mono_class_get_method_from_name;
-static mono_runtime_invoke_fn mono_runtime_invoke;
-static mono_set_crash_chaining_fn mono_set_crash_chaining;
-static mono_set_signal_chaining_fn mono_set_signal_chaining;
-static mono_dl_fallback_register_fn mono_dl_fallback_register;
-static mono_thread_attach_fn mono_thread_attach;
-static mono_domain_set_config_fn mono_domain_set_config;
-static mono_runtime_set_main_args_fn mono_runtime_set_main_args;
-static mono_trace_init_fn mono_trace_init;
-static mono_trace_set_log_handler_fn mono_trace_set_log_handler;
-static mono_jit_parse_options_fn mono_jit_parse_options;
-static mono_debug_init_fn mono_debug_init;
-static mono_array_new_fn mono_array_new;
-static mono_get_string_class_fn mono_get_string_class;
-static mono_dllmap_insert_fn mono_dllmap_insert;
-static mini_parse_debug_option_fn mini_parse_debug_option;
-static mono_jit_cleanup_fn mono_jit_cleanup;
-static mono_jit_set_aot_mode_fn mono_jit_set_aot_mode;
-
-static MonoAssembly *main_assembly;
-static void *runtime_bootstrap_dso;
-static void *mono_posix_helper_dso;
-
-static jclass AndroidRunner_klass = NULL;
-static jmethodID AndroidRunner_WriteLineToInstrumentation_method = NULL;
-
-//forward decls
-
-static void* my_dlsym (void *handle, const char *name, char **err, void *user_data);
-static void* my_dlopen (const char *name, int flags, char **err, void *user_data);
-
-static JNIEnv* mono_jvm_get_jnienv (void);
-
-//stuff
-
-static void
-_runtime_log (const char *log_domain, const char *log_level, const char *message, int32_t fatal, void *user_data)
-{
-	JNIEnv *env;
-	jstring j_message;
-
-	if (jvm == NULL)
-		__android_log_assert ("", "mono-sdks", "%s: jvm is NULL", __func__);
-
-	if (AndroidRunner_klass == NULL)
-		__android_log_assert ("", "mono-sdks", "%s: AndroidRunner_klass is NULL", __func__);
-	if (AndroidRunner_WriteLineToInstrumentation_method == NULL)
-		__android_log_assert ("", "mono-sdks", "%s: AndroidRunner_WriteLineToInstrumentation_method is NULL", __func__);
-
-	env = mono_jvm_get_jnienv ();
-
-	j_message = (*env)->NewStringUTF(env, message);
-
-	(*env)->CallStaticVoidMethod (env, AndroidRunner_klass, AndroidRunner_WriteLineToInstrumentation_method, j_message);
-
-	(*env)->DeleteLocalRef (env, j_message);
-
-	/* Still print it on the logcat */
-
-	android_LogPriority android_log_level;
-	switch (*log_level) {
-	case 'e': /* error */
-		android_log_level = ANDROID_LOG_FATAL;
-		break;
-	case 'c': /* critical */
-		android_log_level = ANDROID_LOG_ERROR;
-		break;
-	case 'w': /* warning */
-		android_log_level = ANDROID_LOG_WARN;
-		break;
-	case 'm': /* message */
-		android_log_level = ANDROID_LOG_INFO;
-		break;
-	case 'i': /* info */
-		android_log_level = ANDROID_LOG_DEBUG;
-		break;
-	case 'd': /* debug */
-		android_log_level = ANDROID_LOG_VERBOSE;
-		break;
-	default:
-		android_log_level = ANDROID_LOG_UNKNOWN;
-		break;
-	}
-
-	__android_log_write (android_log_level, log_domain, message);
-	if (android_log_level == ANDROID_LOG_FATAL)
-		abort ();
-}
-
-static void
-_log (const char *format, ...)
-{
-	va_list args;
-	char *buf;
-	int nbuf;
-
-	errno = 0;
-
-	va_start (args, format);
-	nbuf = vasprintf (&buf, format, args);
-	va_end (args);
-
-	if (buf == NULL || nbuf == -1)
-		__android_log_assert ("", "mono-sdks", "%s: vasprintf failed, error: \"%s\" (%d), nbuf = %d, buf = \"%s\"", __func__, strerror(errno), errno, nbuf, buf ? buf : "(null)");
-
-	_runtime_log ("mono-sdks", "debug", buf, 0, NULL);
-
-	free (buf);
-}
-
-static void
-strncpy_str (JNIEnv *env, char *buff, jstring str, int nbuff)
-{
-	jboolean isCopy = 0;
-	const char *copy_buff = (*env)->GetStringUTFChars (env, str, &isCopy);
-	strncpy (buff, copy_buff, nbuff);
-	if (isCopy)
-		(*env)->ReleaseStringUTFChars (env, str, copy_buff);
-}
-
-static char *
-m_strdup_printf (const char *format, ...)
-{
-        char *ret;
-        va_list args;
-        int n;
-
-        va_start (args, format);
-        n = vasprintf (&ret, format, args);
-        va_end (args);
-        if (n == -1)
-                return NULL;
-
-        return ret;
-}
-
-static int
-m_make_directory (const char *path, int mode)
-{
-#if WINDOWS
-        return mkdir (path);
-#else
-        return mkdir (path, mode);
-#endif
-}
-
-static int
-m_create_directory (const char *pathname, int mode)
-{
-        if (mode <= 0)
-                mode = DEFAULT_DIRECTORY_MODE;
-
-        if  (!pathname || *pathname == '\0') {
-                errno = EINVAL;
-                return -1;
-        }
-
-        mode_t oldumask = umask (022);
-        char *path = strdup (pathname);
-        int rv, ret = 0;
-		char *d;
-        for (d = path; *d; ++d) {
-                if (*d != '/')
-                        continue;
-                *d = 0;
-                if (*path) {
-                        rv = m_make_directory (path, mode);
-                        if  (rv == -1 && errno != EEXIST)  {
-                                ret = -1;
-                                break;
-                        }
-                }
-                *d = '/';
-        }
-        free (path);
-        if (ret == 0)
-                ret = m_make_directory (pathname, mode);
-        umask (oldumask);
-
-        return ret;
-}
-
-static volatile int wait_for_lldb = 1;
-
-void
-monodroid_clear_lldb_wait (void)
-{
-	wait_for_lldb = 0;
-}
-
-static void
-wait_for_unmanaged_debugger ()
-{
-	while (wait_for_lldb) {
-		_log ("Waiting for lldb to attach, run \"make -C sdks/android attach-lldb\" in another terminal");
-		sleep (5);
-	}
-}
-
-
-static void
-create_and_set (const char *home, const char *relativePath, const char *envvar)
-{
-	char *dir = m_strdup_printf ("%s/%s", home, relativePath);
-	int rv = m_create_directory (dir, DEFAULT_DIRECTORY_MODE);
-	if (rv < 0 && errno != EEXIST)
-		_log ("Failed to create XDG directory %s. %s", dir, strerror (errno));
-	if (envvar)
-		setenv (envvar, dir, 1);
-	free (dir);
-}
-
-void
-Java_org_mono_android_AndroidRunner_runTests (JNIEnv* env, jobject thiz, jstring j_files_dir, jstring j_cache_dir,
-	jstring j_native_library_dir, jstring j_assembly_dir, jstring j_assembly_name, jboolean is_debugger, jboolean is_profiler, jboolean wait_for_lldb)
-{
-	MonoDomain *root_domain;
-	MonoMethod *run_tests_method;
-	void **params;
-	char **argv;
-	char buff[1024], file_dir[2048], cache_dir[2048], native_library_dir[2048], assembly_dir[2048], assembly_name[2048];
-	int argc;
-
-	if (wait_for_lldb)
-		wait_for_unmanaged_debugger ();
-
-	_log ("IN %s\n", __func__);
-	strncpy_str (env, file_dir, j_files_dir, sizeof(file_dir));
-	strncpy_str (env, cache_dir, j_cache_dir, sizeof(cache_dir));
-	strncpy_str (env, native_library_dir, j_native_library_dir, sizeof(native_library_dir));
-	strncpy_str (env, assembly_dir, j_assembly_dir, sizeof(assembly_dir));
-	strncpy_str (env, assembly_name, j_assembly_name, sizeof(assembly_name));
-
-	_log ("-- file dir %s", file_dir);
-	_log ("-- cache dir %s", cache_dir);
-	_log ("-- native library dir %s", native_library_dir);
-	_log ("-- assembly dir %s", assembly_dir);
-	_log ("-- assembly name %s", assembly_name);
-	_log ("-- is debugger %d", is_debugger);
-	_log ("-- is profiler %d", is_profiler);
-	prctl (PR_SET_DUMPABLE, 1);
-
-	snprintf (buff, sizeof(buff), "%s/libmonosgen-2.0.so", native_library_dir);
-	void *libmono = dlopen (buff, RTLD_LAZY);
-	if (!libmono) {
-		_log ("Unknown file \"%s/libmonosgen-2.0.so\"", native_library_dir);
-		_exit (1);
-	}
-
-#define DLSYM(sym) \
-	do { \
-		sym = dlsym(libmono, #sym); \
-		if (!sym) { \
-			_log ("Unknown symbol \"%s\"", #sym); \
-			_exit (1); \
-		} \
-	} while (0)
-
-	DLSYM (mini_parse_debug_option);
-	DLSYM (mono_array_new);
-	DLSYM (mono_assembly_get_image);
-	DLSYM (mono_assembly_open);
-	DLSYM (mono_class_from_name);
-	DLSYM (mono_class_get_method_from_name);
-	DLSYM (mono_debug_init);
-	DLSYM (mono_dl_fallback_register);
-	DLSYM (mono_dllmap_insert);
-	DLSYM (mono_domain_set_config);
-	DLSYM (mono_get_string_class);
-	DLSYM (mono_jit_init_version);
-	DLSYM (mono_jit_parse_options);
-	DLSYM (mono_runtime_invoke);
-	DLSYM (mono_jit_cleanup);
-	DLSYM (mono_runtime_set_main_args);
-	DLSYM (mono_set_assemblies_path);
-	DLSYM (mono_set_crash_chaining);
-	DLSYM (mono_set_signal_chaining);
-	DLSYM (mono_string_new);
-	DLSYM (mono_thread_attach);
-	DLSYM (mono_trace_init);
-	DLSYM (mono_trace_set_log_handler);
-	DLSYM (mono_jit_set_aot_mode);
-
-#undef DLSYM
-
-	//MUST HAVE envs
-	setenv ("TMPDIR", cache_dir, 1);
-	setenv ("MONO_CFG_DIR", file_dir, 1);
-	// setenv ("MONO_DEBUG", "explicit-null-checks", 1);
-
-	create_and_set (file_dir, "home", "HOME");
-	create_and_set (file_dir, "home/.local/share", "XDG_DATA_HOME");
-	create_and_set (file_dir, "home/.local/share", "XDG_DATA_HOME");
-	create_and_set (file_dir, "home/.config", "XDG_CONFIG_HOME");
-
-	//Debug flags
-	setenv ("MONO_LOG_LEVEL", "info", 1);
-	setenv ("MONO_LOG_MASK", "all", 1);
-	// setenv ("MONO_VERBOSE_METHOD", "GetCallingAssembly", 1);
-
-	/* uncomment to enable interpreter */
-	// mono_jit_set_aot_mode (1000 /* MONO_EE_MODE_INTERP */);
-
-	mono_trace_init ();
-	mono_trace_set_log_handler (_runtime_log, NULL);
-
-	sprintf (buff, "%s:%s/tests", assembly_dir, assembly_dir);
-	mono_set_assemblies_path (buff);
-
-	mono_set_crash_chaining (1);
-	mono_set_signal_chaining (1);
-	mono_dl_fallback_register (my_dlopen, my_dlsym, NULL, NULL);
-
-	sprintf (buff, "%s/libruntime-bootstrap.so", native_library_dir);
-	runtime_bootstrap_dso = dlopen (buff, RTLD_LAZY);
-
-	sprintf (buff, "%s/libMonoPosixHelper.so", native_library_dir);
-	mono_posix_helper_dso = dlopen (buff, RTLD_LAZY);
-
-	sprintf (buff, "%s/libmono-native.so", native_library_dir);
-
-	mono_dllmap_insert (NULL, "System.Native", NULL, buff, NULL);
-	mono_dllmap_insert (NULL, "System.Net.Security.Native", NULL, buff, NULL);
-
-	if (wait_for_lldb)
-		mini_parse_debug_option ("lldb");
-
-	if (is_debugger) {
-		char *debug_options[] = { "--debugger-agent=transport=dt_socket,loglevel=10,address=127.0.0.1:6100,embedding=1", "--soft-breakpoints" };
-		mono_jit_parse_options (1, debug_options);
-	} else if (is_profiler) {
-		// TODO: profiler
-	}
-
-	mono_debug_init (MONO_DEBUG_FORMAT_MONO);
-
-	// Note: sets up domains. If the debugger is configured after this line is run, 
-	// then lookup_data_table will fail.
-	root_domain = mono_jit_init_version ("TEST RUNNER", "mobile");
-	mono_domain_set_config (root_domain, assembly_dir, file_dir);
-
-	mono_thread_attach (root_domain);
-
-	if (is_debugger) {
-		char *argv[] = { assembly_name };
-		mono_runtime_set_main_args (1, argv);
-
-		sprintf (buff, "%s/%s", assembly_dir, assembly_name);
-		main_assembly = mono_assembly_open (buff, NULL);
-		if (!main_assembly) {
-			_log ("Unknown assembly \"%s\"", buff);
-			_exit (1);
-		}
-
-		MonoClass *tests_class = mono_class_from_name (mono_assembly_get_image (main_assembly), "", "Tests");
-		if (!tests_class) {
-			_log ("Unknown class \"Tests\"");
-			_exit (1);
-		}
-
-		run_tests_method = mono_class_get_method_from_name (tests_class, "Main", 1);
-		if (!run_tests_method) {
-			_log ("Unknown method \"Main\"");
-			_exit (1);
-		}
-
-		// attached debugger sets the options the main class uses
-		// Therefore, we just pass Main no args
-		void *args[] = { mono_array_new (root_domain, mono_get_string_class (), 0) };
-		mono_runtime_invoke (run_tests_method, NULL, args, NULL);
-
-		// Properly disconnect the debugger
-		mono_jit_cleanup (root_domain);
-	} else if (is_profiler) {
-		// TODO: profiler
-		_log ("Unsupported profiler");
-		_exit (1);
-	} else {
-		char *argv[] = { "nunitlite.dll" };
-		mono_runtime_set_main_args (1, argv);
-
-		sprintf (buff, "%s/%s", assembly_dir, "nunitlite.dll");
-		main_assembly = mono_assembly_open (buff, NULL);
-		if (!main_assembly) {
-			_log ("Unknown assembly \"%s\"", buff);
-			_exit (1);
-		}
-
-		MonoClass *driver_class = mono_class_from_name (mono_assembly_get_image (main_assembly), "Xamarin", "AndroidTestAssemblyRunner/Driver");
-		if (!driver_class) {
-			_log ("Unknown class \"Xamarin.AndroidTestAssemblyRunner/Driver\"");
-			_exit (1);
-		}
-
-		run_tests_method = mono_class_get_method_from_name (driver_class, "RunTests", 1);
-		if (!run_tests_method) {
-			_log ("Unknown method \"RunTests\"");
-			_exit (1);
-		}
-
-		sprintf (buff, "%s/%s", assembly_dir, assembly_name);
-		void *args[] = { mono_string_new (root_domain, buff) };
-		mono_runtime_invoke (run_tests_method, NULL, args, NULL);
-	}
-}
-
-static int
-convert_dl_flags (int flags)
-{
-	int lflags = flags & MONO_DL_LOCAL? 0: RTLD_GLOBAL;
-
-	if (flags & MONO_DL_LAZY)
-		lflags |= RTLD_LAZY;
-	else
-		lflags |= RTLD_NOW;
-	return lflags;
-}
-
-
-/*
-This is the Android specific glue ZZZZOMG
-
-# Issues with the monodroid BCL profile
-	This pinvoke should not be on __Internal by libmonodroid.so: System.TimeZoneInfo+AndroidTimeZones:monodroid_get_system_property
-	This depends on monodroid native code: System.TimeZoneInfo+AndroidTimeZones.GetDefaultTimeZoneName
-*/
-
-#define MONO_API __attribute__ ((__visibility__ ("default")))
-
-#define INTERNAL_LIB_HANDLE ((void*)(size_t)-1)
-static void*
-my_dlopen (const char *name, int flags, char **err, void *user_data)
-{
-	if (!name)
-		return INTERNAL_LIB_HANDLE;
-
-	void *res = dlopen (name, convert_dl_flags (flags));
-
-	//TODO handle loading AOT modules from assembly_dir
-
-	return res;
-}
-
-static void*
-my_dlsym (void *handle, const char *name, char **err, void *user_data)
-{
-	void *s;
-
-	if (handle == INTERNAL_LIB_HANDLE) {
-		s = dlsym (runtime_bootstrap_dso, name);
-		if (!s && mono_posix_helper_dso)
-			s = dlsym (mono_posix_helper_dso, name);
-	} else {
-		s = dlsym (handle, name);
-	}
-
-	if (!s && err) {
-		*err = m_strdup_printf ("Could not find symbol '%s'.", name);
-	}
-
-	return s;
-}
-
-MONO_API int
-monodroid_get_system_property (const char *name, char **value)
-{
-	char *pvalue;
-	char  sp_value [PROP_VALUE_MAX+1] = { 0, };
-	int   len;
-
-	if (value)
-		*value = NULL;
-
-	pvalue  = sp_value;
-	len     = __system_property_get (name, sp_value);
-
-	if (len >= 0 && value) {
-		*value = malloc (len + 1);
-		if (!*value)
-			return -len;
-		memcpy (*value, pvalue, len);
-		(*value)[len] = '\0';
-	}
-
-	return len;
-}
-
-MONO_API void
-monodroid_free (void *ptr)
-{
-	free (ptr);
-}
-
-typedef struct {
-	struct _monodroid_ifaddrs *ifa_next; /* Pointer to the next structure.      */
-
-	char *ifa_name;                      /* Name of this network interface.     */
-	unsigned int ifa_flags;              /* Flags as from SIOCGIFFLAGS ioctl.   */
-
-	struct sockaddr *ifa_addr;           /* Network address of this interface.  */
-	struct sockaddr *ifa_netmask;        /* Netmask of this interface.          */
-	union {
-		/* At most one of the following two is valid.  If the IFF_BROADCAST
-		   bit is set in `ifa_flags', then `ifa_broadaddr' is valid.  If the
-		   IFF_POINTOPOINT bit is set, then `ifa_dstaddr' is valid.
-		   It is never the case that both these bits are set at once.  */
-		struct sockaddr *ifu_broadaddr;  /* Broadcast address of this interface. */
-		struct sockaddr *ifu_dstaddr;    /* Point-to-point destination address.  */
-	} ifa_ifu;
-	void *ifa_data;               /* Address-specific data (may be unused).  */
-} m_ifaddrs;
-
-typedef int (*get_ifaddr_fn)(m_ifaddrs **ifap);
-typedef void (*freeifaddr_fn)(m_ifaddrs *ifap);
-
-static void
-init_sock_addr (struct sockaddr **res, const char *str_addr)
-{
-	struct sockaddr_in addr;
-	addr.sin_family = AF_INET;
-	inet_pton (AF_INET, str_addr, &addr.sin_addr);
-
-	*res = calloc (1, sizeof (struct sockaddr));
-	**(struct sockaddr_in**)res = addr;
-}
-
-MONO_API int
-monodroid_getifaddrs (m_ifaddrs **ifap)
-{
-	char buff[1024];
-	FILE * f = fopen ("/proc/net/route", "r");
-	if (f) {
-		int i = 0;
-		fgets (buff, 1023, f);
-		fgets (buff, 1023, f);
-		while (!isspace (buff [i]) && i < 1024)
-			++i;
-		buff [i] = 0;
-		fclose (f);
-	} else {
-		strcpy (buff, "wlan0");
-	}
-
-	m_ifaddrs *res = calloc (1, sizeof (m_ifaddrs));
-	memset (res, 0, sizeof (*res));
-
-	res->ifa_next = NULL;
-	res->ifa_name = m_strdup_printf ("%s", buff);
-	res->ifa_flags = 0;
-	res->ifa_ifu.ifu_dstaddr = NULL;
-	init_sock_addr (&res->ifa_addr, "192.168.0.1");
-	init_sock_addr (&res->ifa_netmask, "255.255.255.0");
-
-	*ifap = res;
-	return 0;
-}
-
-MONO_API void
-monodroid_freeifaddrs (m_ifaddrs *ifap)
-{
-	free (ifap->ifa_name);
-	if (ifap->ifa_addr)
-		free (ifap->ifa_addr);
-	if (ifap->ifa_netmask)
-		free (ifap->ifa_netmask);
-	free (ifap);
-}
-
-MONO_API int
-_monodroid_get_android_api_level (void)
-{
-	return 24;
-}
-
-MONO_API int
-_monodroid_get_network_interface_up_state (void *ifname, int *is_up)
-{
-	*is_up = 1;
-	return 1;
-}
-
-MONO_API int
-_monodroid_get_network_interface_supports_multicast (void *ifname, int *supports_multicast)
-{
-	*supports_multicast = 0;
-	return 1;
-}
-
-MONO_API int
-_monodroid_get_dns_servers (void **dns_servers_array)
-{
-	*dns_servers_array = NULL;
-	if (!dns_servers_array)
-		return -1;
-
-	size_t  len;
-	char   *dns;
-	char   *dns_servers [8];
-	int     count = 0;
-	char    prop_name[] = "net.dnsX";
-	int i;
-	for (i = 0; i < 8; i++) {
-		prop_name [7] = (char)(i + 0x31);
-		len = monodroid_get_system_property (prop_name, &dns);
-		if (len <= 0) {
-			dns_servers [i] = NULL;
-			continue;
-		}
-		dns_servers [i] = strndup (dns, len);
-		count++;
-	}
-
-	if (count <= 0)
-		return 0;
-
-	char **ret = (char**)malloc (sizeof (char*) * count);
-	char **p = ret;
-	for (i = 0; i < 8; i++) {
-		if (!dns_servers [i])
-			continue;
-		*p++ = dns_servers [i];
-	}
-
-	*dns_servers_array = (void*)ret;
-	return count;
-}
-
-static int initialized = 0;
-
-static jobject
-lref_to_gref (JNIEnv *env, jobject lref)
-{
-	jobject g;
-	if (lref == 0)
-		return 0;
-	g = (*env)->NewGlobalRef (env, lref);
-	(*env)->DeleteLocalRef (env, lref);
-	return g;
-}
-
-static void
-mono_jvm_initialize (JavaVM *vm)
-{
-	JNIEnv *env;
-
-	if (initialized)
-		return;
-
-	jvm = vm;
-
-	int res = (*jvm)->GetEnv (jvm, (void**)&env, JNI_VERSION_1_6);
-	if (!env)
-		__android_log_assert ("", "mono-sdks", "%s: fatal error: Could not create env, res = %d", __func__, res);
-
-	AndroidRunner_klass = lref_to_gref(env, (*env)->FindClass (env, "org/mono/android/AndroidRunner"));
-	if (!AndroidRunner_klass)
-		__android_log_assert ("", "mono-sdks", "%s: fatal error: Could not find AndroidRunner_klass", __func__);
-
-	AndroidRunner_WriteLineToInstrumentation_method = (*env)->GetStaticMethodID (env, AndroidRunner_klass, "WriteLineToInstrumentation", "(Ljava/lang/String;)V");
-	if (!AndroidRunner_WriteLineToInstrumentation_method)
-		__android_log_assert ("", "mono-sdks", "%s: fatal error: Could not find AndroidRunner_WriteLineToInstrumentation_method", __func__);
-
-	initialized = 1;
-}
-
-JNIEXPORT jint JNICALL
-JNI_OnLoad (JavaVM *vm, void *reserved)
-{
-	mono_jvm_initialize (vm);
-	return JNI_VERSION_1_6;
-}
-
-static JNIEnv*
-mono_jvm_get_jnienv (void)
-{
-	JNIEnv *env;
-
-	if (!initialized)
-		__android_log_assert ("", "mono-sdks", "%s: Fatal error: jvm not initialized", __func__);
-
-	(*jvm)->GetEnv (jvm, (void**)&env, JNI_VERSION_1_6);
-	if (env)
-		return env;
-
-	(*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
-	if (env)
-		return env;
-
-	__android_log_assert ("", "mono-sdks", "%s: Fatal error: Could not create env", __func__);
-}

+ 0 - 163
sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java

@@ -1,163 +0,0 @@
-package org.mono.android;
-
-import android.app.Instrumentation;
-
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.res.AssetManager;
-
-import android.os.Bundle;
-import android.os.Build;
-
-import android.util.Log;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-
-import org.mono.android.AndroidTestRunner.R;
-
-public class AndroidRunner extends Instrumentation
-{
-	static AndroidRunner inst;
-
-	String testsuite;
-	boolean waitForLLDB;
-
-	@Override
-	public void onCreate(Bundle savedInstanceState)
-	{
-		testsuite = savedInstanceState.getString ("TestSuite");
-		waitForLLDB = savedInstanceState.getString ("WaitForLLDB").equals ("True");
-
-		super.onCreate (savedInstanceState);
-
-		start ();
-	}
-
-	@Override
-	public void onStart ()
-	{
-		super.onStart ();
-
-		AndroidRunner.inst = this;
-
-		Context context = getContext ();
-
-		String filesDir    = context.getFilesDir ().getAbsolutePath ();
-		String cacheDir    = context.getCacheDir ().getAbsolutePath ();
-		String nativeLibraryDir = context.getApplicationInfo ().nativeLibraryDir;
-		String assemblyDir = filesDir + "/assemblies";
-		String lldbDir = filesDir + "/lldb";
-
-		//XXX copy stuff
-		Log.w ("MONO", "DOING THE COPYING!2");
-
-		AssetManager am = context.getAssets ();
-
-		new File (assemblyDir).mkdir ();
-		copyAssetDir (am, "asm", assemblyDir);
-
-		new File (lldbDir).mkdir ();
-		copyAssetDir (am, Build.CPU_ABI, lldbDir);
-
-		new File (filesDir + "/mono").mkdir ();
-		new File (filesDir + "/mono/2.1").mkdir ();
-		copyAssetDir (am, "mconfig", filesDir + "/mono/2.1");
-
-		if (waitForLLDB) {
-			Log.w ("MONO", "Launching lldb-server " + Build.CPU_ABI);
-
-			String lldbServerFile = lldbDir + "/lldb-server";
-
-			new File(lldbServerFile).setExecutable (true);
-
-			// launch LLDB server in background
-			ProcessBuilder pb = new ProcessBuilder (
-				lldbServerFile,
-				"platform",
-				"--server",
-				"--listen", "127.0.0.1:6101",
-				"--log-channels", "lldb process:gdb-remote packets");
-
-			try {
-				final Process p = pb.start ();
-			} catch (IOException ioe) {
-				Log.e ("MONO", "Error when launching lldb-server", ioe);
-
-				runOnMainSync (new Runnable () {
-					public void run() {
-						finish (1, null);
-					}
-				});
-
-				return;
-			}
-		}
-
-		if (testsuite.startsWith("debugger:")) {
-			runTests (filesDir, cacheDir, nativeLibraryDir, assemblyDir, "tests/" + testsuite.substring(9), true, false, waitForLLDB);
-		} else if (testsuite.startsWith("profiler:")) {
-			runTests (filesDir, cacheDir, nativeLibraryDir, assemblyDir, "tests/" + testsuite.substring(9), false, true, waitForLLDB);
-		} else {
-			runTests (filesDir, cacheDir, nativeLibraryDir, assemblyDir, "tests/" + testsuite, false, false, waitForLLDB);
-		}
-
-		runOnMainSync (new Runnable () {
-			public void run() {
-				finish (0, null);
-			}
-		});
-	}
-
-	void copyAssetDir (AssetManager am, String path, String outpath) {
-		Log.w ("MONO", "EXTRACTING: " + path);
-		try {
-			String[] res = am.list (path);
-			for (int i = 0; i < res.length; ++i) {
-				String fromFile = path + "/" + res [i];
-				String toFile = outpath + "/" + res [i];
-
-				InputStream fromStream;
-				try {
-					fromStream = am.open (fromFile);
-				} catch (FileNotFoundException e) {
-					// am.list() returns directories, we need to process them too
-					new File (toFile).mkdirs ();
-					copyAssetDir (am, fromFile, toFile);
-					continue;
-				}
-
-				Log.w ("MONO", "\tCOPYING " + fromFile + " to " + toFile);
-				copy (fromStream, new FileOutputStream (toFile));
-			}
-		} catch (Exception e) {
-			Log.w ("MONO", "WTF", e);
-		}
-	}
-
-	void copy (InputStream in, OutputStream out) throws IOException {
-		byte[] buff = new byte [1024];
-		for (int len = in.read (buff); len != -1; len = in.read (buff)) {
-			out.write (buff, 0, len);
-		}
-		in.close ();
-		out.close ();
-	}
-
-	native void runTests (String filesDir, String cacheDir, String dataDir, String assemblyDir, String assemblyName, boolean isDebugger, boolean isProfiler, boolean waitForLLDB);
-
-	static void WriteLineToInstrumentation (String line)
-	{
-		Bundle b = new Bundle();
-		b.putString(Instrumentation.REPORT_KEY_STREAMRESULT, line + "\n");
-		AndroidRunner.inst.sendStatus(0, b);
-	}
-
-	static {
-		System.loadLibrary("runtime-bootstrap");
-	}
-}

+ 0 - 27
sdks/android/build.gradle

@@ -1,27 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
-    
-    repositories {
-        google()
-        jcenter()
-    }
-    dependencies {
-        classpath 'com.android.tools.build:gradle:3.1.4'
-        
-
-        // NOTE: Do not place your application dependencies here; they belong
-        // in the individual module build.gradle files
-    }
-}
-
-allprojects {
-    repositories {
-        google()
-        jcenter()
-    }
-}
-
-task clean(type: Delete) {
-    delete rootProject.buildDir
-}

BIN
sdks/android/gradle/wrapper/gradle-wrapper.jar


+ 0 - 6
sdks/android/gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +0,0 @@
-#Thu Aug 16 10:31:31 EDT 2018
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

+ 0 - 172
sdks/android/gradlew

@@ -1,172 +0,0 @@
-#!/usr/bin/env sh
-
-##############################################################################
-##
-##  Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '/.*' > /dev/null; then
-        PRG="$link"
-    else
-        PRG=`dirname "$PRG"`"/$link"
-    fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn () {
-    echo "$*"
-}
-
-die () {
-    echo
-    echo "$*"
-    echo
-    exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "`uname`" in
-  CYGWIN* )
-    cygwin=true
-    ;;
-  Darwin* )
-    darwin=true
-    ;;
-  MINGW* )
-    msys=true
-    ;;
-  NONSTOP* )
-    nonstop=true
-    ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
-        # IBM's JDK on AIX uses strange locations for the executables
-        JAVACMD="$JAVA_HOME/jre/sh/java"
-    else
-        JAVACMD="$JAVA_HOME/bin/java"
-    fi
-    if [ ! -x "$JAVACMD" ] ; then
-        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-    fi
-else
-    JAVACMD="java"
-    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
-    MAX_FD_LIMIT=`ulimit -H -n`
-    if [ $? -eq 0 ] ; then
-        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
-            MAX_FD="$MAX_FD_LIMIT"
-        fi
-        ulimit -n $MAX_FD
-        if [ $? -ne 0 ] ; then
-            warn "Could not set maximum file descriptor limit: $MAX_FD"
-        fi
-    else
-        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
-    fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
-    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
-    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
-    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-    JAVACMD=`cygpath --unix "$JAVACMD"`
-
-    # We build the pattern for arguments to be converted via cygpath
-    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
-    SEP=""
-    for dir in $ROOTDIRSRAW ; do
-        ROOTDIRS="$ROOTDIRS$SEP$dir"
-        SEP="|"
-    done
-    OURCYGPATTERN="(^($ROOTDIRS))"
-    # Add a user-defined pattern to the cygpath arguments
-    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
-        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
-    fi
-    # Now convert the arguments - kludge to limit ourselves to /bin/sh
-    i=0
-    for arg in "$@" ; do
-        CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -`
-        CHECK2=`echo "$arg"|grep -E -c "^-"`                                 ### Determine if an option
-
-        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
-            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
-        else
-            eval `echo args$i`="\"$arg\""
-        fi
-        i=$((i+1))
-    done
-    case $i in
-        (0) set -- ;;
-        (1) set -- "$args0" ;;
-        (2) set -- "$args0" "$args1" ;;
-        (3) set -- "$args0" "$args1" "$args2" ;;
-        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
-        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
-        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
-        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
-        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
-        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
-    esac
-fi
-
-# Escape application args
-save () {
-    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
-    echo " "
-}
-APP_ARGS=$(save "$@")
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
-  cd "$(dirname "$0")"
-fi
-
-exec "$JAVACMD" "$@"

+ 0 - 70
sdks/android/lldb-android.sh

@@ -1,70 +0,0 @@
-#!/bin/bash
-
-show_usage()
-{
-	echo "Usage: lldb-android [-d <DEVICE>] <package>."
-}
-
-shell()
-{
-	adb -s "$DEVICE" shell "$@"
-}
-
-while getopts "d:" option ; do
-	case "$option" in
-		d)
-			DEVICE=$OPTARG
-			shift 2
-			;;
-	esac
-done
-
-if [ "$1" == "" ]; then
-	show_usage
-	exit 1
-fi
-
-PKG=$1
-
-echo "Package: $PKG"
-
-if [ "$DEVICE" = "" ]; then
-	DEVICE_COUNT=`adb devices | grep 'device$' | wc -l`
-	if [ $DEVICE_COUNT -eq 1 ]; then
-		DEVICE=`adb devices | grep 'device$' | awk -F"\t+" '{print $1}'`
-	fi
-fi
-
-if [ -z $DEVICE ]; then
-	echo "Unable to find a device."
-	exit 1
-fi
-
-echo "Device: $DEVICE"
-
-for i in 1 2 3 4 5; do
-	PID=$(shell "ps" | grep -E "\b$PKG\b$" | awk -F' +' '{print $2}')
-
-	if [ "$PID" != "" ]; then
-		break
-	fi
-	sleep 1
-done
-
-if [ "$PID" == "" ]; then
-	echo "Can't find process pid."
-	exit 1
-fi
-
-START_FILE=/tmp/lldb_commands.$DEVICE.$PID
-
-echo "
-platform select remote-android
-platform connect connect://[$DEVICE]:6101
-settings set auto-confirm true
-settings set plugin.symbol-file.dwarf.comp-dir-symlink-paths /proc/self/cwd
-process attach -p $PID
-process handle -p true -n true -s false SIGPWR SIGXCPU SIGTTIN
-p (void)monodroid_clear_lldb_wait()" > $START_FILE
-
-lldb -s $START_FILE

+ 0 - 85
sdks/android/managed/fake-monodroid.cs

@@ -1,85 +0,0 @@
-using System;
-using System.Threading;
-using System.Runtime.InteropServices;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-	
-namespace Android.Runtime {
-	public static class AndroidEnvironment {
-
-		public const string AndroidLogAppName = "Mono.Android";
-
-		static object lock_ = new object ();
-
-		// This is invoked by
-		// System.Core!System.AndroidPlatform.GetDefaultTimeZone ()
-		// DO NOT REMOVE
-		static string GetDefaultTimeZone ()
-		{
-			return "America/Los_Angeles"; //add glue code if you really care
-		}
-
-		// This is invoked by
-		// mscorlib.dll!System.AndroidPlatform.GetDefaultSyncContext()
-		// DO NOT REMOVE
-		static SynchronizationContext GetDefaultSyncContext ()
-		{
-			return null; //we don't really care
-		}
-
-		// These are invoked by
-		// System.dll!System.AndroidPlatform.getifaddrs
-		// DO NOT REMOVE
-		[DllImport ("__Internal")]
-		static extern int monodroid_getifaddrs (out IntPtr ifap);
-
-		static int GetInterfaceAddresses (out IntPtr ifap)
-		{
-			return monodroid_getifaddrs (out ifap);
-		}
-		
-		// These are invoked by
-		// System.dll!System.AndroidPlatform.freeifaddrs
-		// DO NOT REMOVE
-		[DllImport ("__Internal")] 
-		static extern void monodroid_freeifaddrs (IntPtr ifap);
-
-		static void FreeInterfaceAddresses (IntPtr ifap)
-		{
-			monodroid_freeifaddrs (ifap);
-		}
-
-		[DllImport ("__Internal")]
-		static extern void _monodroid_detect_cpu_and_architecture (ref ushort built_for_cpu, ref ushort running_on_cpu, ref byte is64bit);
-
-		static void DetectCPUAndArchitecture (out ushort builtForCPU, out ushort runningOnCPU, out bool is64bit)
-		{
-			ushort built_for_cpu = 0;
-			ushort running_on_cpu = 0;
-			byte _is64bit = 0;
-
-			_monodroid_detect_cpu_and_architecture (ref built_for_cpu, ref running_on_cpu, ref _is64bit);
-			builtForCPU = built_for_cpu;
-			runningOnCPU = running_on_cpu;
-			is64bit = _is64bit != 0;
-		}
-
-
-		static bool TrustEvaluateSsl (List <byte[]> certsRawData)
-		{
-			return true;
-		}
-
-		static IWebProxy GetDefaultProxy ()
-		{
-			return null;
-		}
-
-		static byte[] CertStoreLookup (long _1, bool _2)
-		{
-			return null;
-		}
-
-	}
-}

+ 0 - 1
sdks/android/settings.gradle

@@ -1 +0,0 @@
-include ':app'

+ 0 - 113
sdks/android/xa-lldb

@@ -1,113 +0,0 @@
-#!/bin/bash
-
-set -xi
-
-PLATFORM_TOOLS_DIR=$HOME/android-toolchain/sdk/platform-tools
-
-shell()
-{
-  $PLATFORM_TOOLS_DIR/adb -s "$DEVICE" shell "$@"
-}
-
-while getopts "d:" option ; do
-    case "$option" in
-		d)
-			DEVICE=$OPTARG
-			shift 2
-			;;
-	esac
-done
-
-# Directory with lldb binaries/debug servers
-LLDB_MONO_DIR=`dirname $0`
-NOW=`date +%s`
-
-if [ "$DEVICE" = "" ]; then
-  DEVICE_COUNT=`$PLATFORM_TOOLS_DIR/adb devices | grep 'device$' | wc -l`
-  if [ $DEVICE_COUNT -eq 1 ]; then
-    DEVICE=`$PLATFORM_TOOLS_DIR/adb devices | grep 'device$' | awk -F"\t+" '{print $1}'`
-  fi
-fi
-echo "Device: $DEVICE"
-
-SOCK="platform-${NOW}.sock"
-ARCH=$(shell "getprop ro.product.cpu.abi" | tr -d '\r')
-
-LLDB_SERVER_ARCH=$ARCH
-if [ "$ARCH" = "armeabi-v7a" ]; then
-  LLDB_SERVER_ARCH="armeabi"
-fi
-
-echo "Architecture: $ARCH"
-
-#LLDB_DIR=$HOME/Library/Android/sdk/lldb/2.2/android
-LLDB_DIR=$LLDB_MONO_DIR/android
-
-R_TMP=/data/local/tmp
-LLDB=/data/data/org.mono.android.AndroidTestRunner/lldb
-LLDB_BIN=$LLDB/bin
-LLDB_SERVER=$LLDB_BIN/lldb-server
-START_SERVER=$LLDB_BIN/start_lldb_server.sh
-LLDB_LOCAL_SERVER=$LLDB_DIR/$LLDB_SERVER_ARCH/lldb-server
-
-if [ ! -f $LLDB_LOCAL_SERVER ]; then
-	echo "Unable to find llvm-server binary at $LLDB_LOCAL_SERVER."
-	exit 1
-fi
-
-echo "Copying lldb-server to device..."
-$PLATFORM_TOOLS_DIR/adb -s "$DEVICE" push $LLDB_DIR/$LLDB_SERVER_ARCH/lldb-server $R_TMP
-$PLATFORM_TOOLS_DIR/adb -s "$DEVICE" push $LLDB_DIR/start_lldb_server.sh $R_TMP
-
-$PLATFORM_TOOLS_DIR/adb -s "$DEVICE" shell 'setprop debug.mono.lldb wait:`date +%s`'
-$PLATFORM_TOOLS_DIR/adb -s "$DEVICE" shell 'setprop debug.mono.debug 1'
-# FIXME: Add to it
-$PLATFORM_TOOLS_DIR/adb -s "$DEVICE" shell 'setprop debug.mono.env MONO_LLDB=1'
-
-echo "Starting app..."
-shell "am instrument org.mono.android.AndroidTestRunner/org.mono.android.AndroidRunner "
-shell "run-as org.mono.android.AndroidTestRunner mkdir -p $LLDB_BIN"
-shell "rm -f $LLDB_SERVER"
-shell "cat $R_TMP/lldb-server | run-as org.mono.android.AndroidTestRunner sh -c \"cat > $LLDB_SERVER && chmod 700 $LLDB_SERVER\""
-shell "cat $R_TMP/start_lldb_server.sh | run-as org.mono.android.AndroidTestRunner sh -c \"cat > $START_SERVER && chmod 700 $START_SERVER\""
-
-echo "Waiting for app to start..."
-
-for i in 1 2 3 4 5; do
-	PID=$(shell "ps" | grep "org.mono.android.AndroidTestRunner\s*$" | awk -F' +' '{print $2}')
-
-	if [ "$PID" != "" ]; then
-		break
-	fi
-	sleep 1
-done
-
-if [ "$PID" == "" ]; then
-	echo "Can't find process pid."
-	exit 1
-fi
-echo "pid == $PID"
-
-START_FILE=/tmp/lldb_commands.$NOW
-echo "platform select remote-android
-platform connect unix-abstract-connect://[$DEVICE]$LLDB/tmp/$SOCK
-settings set auto-confirm true
-settings set plugin.symbol-file.dwarf.comp-dir-symlink-paths /proc/self/cwd
-process attach -p $PID
-p (void)monodroid_clear_lldb_wait()
-$COMMANDS" > $START_FILE
-
-echo -n "Starting lldb server in the background"
-shell "run-as org.mono.android.AndroidTestRunner $START_SERVER $LLDB unix-abstract $LLDB/tmp $SOCK \"lldb process:gdb-remote packets\""&
-for i in {1..5}; do
-  echo -n ' .'
-  sleep 1
-done
-echo " done."
-
-declare -a PIDS=( `pgrep -P $!` "$!" )
-
-$LLDB_MONO_DIR/lldb -s $START_FILE
-
-rm $START_FILE
-kill "${PIDS[@]}"

+ 0 - 7
sdks/android/xtc/Makefile

@@ -1,7 +0,0 @@
-build:
-	nuget restore
-	xbuild RuntimeTests.csproj
-
-xtc-submit: build
-	mono packages/Xamarin.UITest.2.0.7/tools/test-cloud.exe submit ../bin/AndroidRunner-debug.apk $(API_KEY) --devices 8e3ae326 --series "master" --locale "en_US" --app-name "Mono Runtime Test runner" --user [email protected] --assembly-dir bin/Debug
-	

+ 0 - 43
sdks/android/xtc/RuntimeTests.csproj

@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{71CD4DAD-A331-462E-95FD-2ED2FB40AC25}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <RootNamespace>RuntimeTests</RootNamespace>
-    <AssemblyName>RuntimeTests</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="nunit.framework">
-      <HintPath>packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
-    </Reference>
-    <Reference Include="Xamarin.UITest">
-      <HintPath>packages\Xamarin.UITest.2.0.7\lib\Xamarin.UITest.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Tests.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>

+ 0 - 17
sdks/android/xtc/RuntimeTests.sln

@@ -1,17 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RuntimeTests", "RuntimeTests.csproj", "{71CD4DAD-A331-462E-95FD-2ED2FB40AC25}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{71CD4DAD-A331-462E-95FD-2ED2FB40AC25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{71CD4DAD-A331-462E-95FD-2ED2FB40AC25}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{71CD4DAD-A331-462E-95FD-2ED2FB40AC25}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{71CD4DAD-A331-462E-95FD-2ED2FB40AC25}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-EndGlobal

+ 0 - 84
sdks/android/xtc/Tests.cs

@@ -1,84 +0,0 @@
-using System;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using NUnit.Framework;
-using Xamarin.UITest;
-using Xamarin.UITest.Android;
-using Xamarin.UITest.Queries;
-
-namespace RuntimeTests
-{
-	[TestFixture]
-	public class Tests
-	{
-		IApp app;
-
-		[SetUp]
-		public void BeforeEachTest ()
-		{
-			
-			// TODO: If the Android app being tested is included in the solution then open
-			// the Unit Tests window, right click Test Apps, select Add App Project
-			// and select the app projects that should be tested.
-			app = ConfigureApp
-				.Android
-				// TODO: Update this path to point to your Android app and uncomment the
-				// code if the app is not included in the solution.
-				.ApkFile ("/Users/kumpera/src/mono-sdks/android/AndroidRunner-debug.apk")
-				.StartApp ();
-		}
-
-		//[Test]
-		//public void Repl ()
-		//{
-		//	app.Repl ();
-		//}
-
-		void RunTest (string testsuite)
-		{
-			app.WaitForElement ("button");
-			app.WaitForElement ("input");
-			app.Screenshot ("app-launched");
-
-			app.Tap ("input");
-			app.EnterText (testsuite);
-			app.Screenshot ("test-suite-filled");
-			app.Tap ("button");
-			app.Screenshot ("button-tapped");
-			Thread.Sleep (500);
-
-			int c = 0;
-			string text;
-			while ((text = app.Query (x => x.Id ("text")) [0].Text) == "IN-PROGRESS") {
-				Console.WriteLine ("AFTER TAP STATUS: {0}, STEPS: {1}", text, c);
-				Thread.Sleep (1000);
-				++c;
-				if (c > (10 * 60))
-					break;
-			}
-			app.Screenshot ("loop-finished");
-
-			Assert.AreEqual ("PASS", app.Query (x => x.Id ("text")) [0].Text, "ACTUAL RESULT");
-			app.Screenshot ("after-the-last-assert");
-		}
-
-		[Test]
-		public void TestMini ()
-		{
-			RunTest ("mini");
-		}
-
-		[Test]
-		public void TestCorlib ()
-		{
-			RunTest ("corlib");
-		}
-
-		[Test]
-		public void TestSystem ()
-		{
-			RunTest ("system");
-		}
-	}
-}

+ 0 - 5
sdks/android/xtc/packages.config

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="NUnit" version="2.6.3" targetFramework="net45" />
-  <package id="Xamarin.UITest" version="2.0.7" targetFramework="net45" />
-</packages>

+ 0 - 54
sdks/builds/.gitignore

@@ -1,54 +0,0 @@
-.stamp-*
-*.mk.generated
-*.config.cache
-mxe/
-llvm-llvm32/
-llvm-llvm64/
-llvm-llvmwin32/
-llvm-llvmwin64/
-llvm36-llvm32/
-android-armeabi-*/
-android-armeabi-v7a-*/
-android-arm64-v8a-*/
-android-x86-*/
-android-x86_64-*/
-android-host-Darwin-*/
-android-host-Linux-*/
-android-host-mxe-Win32-*/
-android-host-mxe-Win64-*/
-android-cross-arm-*/
-android-cross-arm64-*/
-android-cross-x86-*/
-android-cross-x86_64-*/
-android-cross-arm-win-*/
-android-cross-arm64-win-*/
-android-cross-x86-win-*/
-android-cross-x86_64-win-*/
-ios-target32-*/
-ios-target32s-*/
-ios-target64-*/
-ios-targettv-*/
-ios-targetwatch-*/
-ios-targetwatch64_32-*/
-ios-cross32-*/
-ios-cross64-*/
-ios-crosswatch-*/
-ios-crosswatch64_32-*/
-ios-sim32-*/
-ios-sim64-*/
-ios-simtv-*/
-ios-simwatch-*/
-ios-simwatch64-*/
-mac-mac64-*/
-mac-macarm64-*/
-mac-crossarm64-*/
-maccat-mac64-*/
-wasm-runtime-*/
-wasm-cross-*/
-wasm-cross-win-*/
-bcl/
-desktop-x86/
-desktop-x86_64/
-toolchains/
-mxe-Win32.cmake
-mxe-Win64.cmake

+ 0 - 250
sdks/builds/Makefile

@@ -1,250 +0,0 @@
-TOP=$(realpath $(CURDIR)/../..)
--include $(TOP)/sdks/Make.config
-
-MAKEFLAGS += --no-builtin-rules
-
-CONFIGURATION?=release
-
-RELEASE=$(if $(filter $(CONFIGURATION),release),1)
-
-lowercase=$(shell echo "$(1)" | tr '[:upper:]' '[:lower:]')
-
-UNAME=$(shell uname)
-
-ifneq (,$(findstring CYGWIN,$(UNAME)))
-UNAME=Windows
-endif
-
-ifdef ENABLE_WSL_WINDOWS_BUILD_HOST
-ifeq ($(UNAME),Linux)
-UNAME_WSL_CHECK=$(shell uname -a)
-ifneq (,$(findstring Microsoft,$(UNAME_WSL_CHECK)))
-UNAME=Windows
-endif
-endif
-endif
-
-ifneq ($(UNAME),Darwin)
-ifneq ($(UNAME),Linux)
-ifneq ($(UNAME),Windows)
-$(error "Unsupported UNAME=$(UNAME)")
-endif
-endif
-endif
-
-ifeq ($(UNAME),Windows)
-# x86_64 or i686
-HOST_ARCH_MINGW32=$(shell uname -m)
-endif
-
-ifneq ($(UNAME),Darwin)
-# iOS and Mac requires Xcode to be available, and Xcode is only available on macOS
-ENABLE_IOS=
-ENABLE_MAC=
-ENABLE_MACCAT=
-endif
-
-# On Windows, we will just trigger LLVM and Android builds using this Makefile.
-ifeq ($(UNAME),Windows)
-ENABLE_IOS=
-ENABLE_MAC=
-ENABLE_MACCAT=
-ENABLE_WASM=
-ENABLE_WASM_CROSS=
-ENABLE_DESKTOP=
-DISABLE_CCACHE=1
-DISABLE_LIBTOOLIZE=1
-IGNORE_PROVISION_MXE=1
-endif
-
-CCACHE:=$(if $(DISABLE_CCACHE),,$(shell which ccache))
-NINJA:=$(shell which ninja)
-
-include $(TOP)/sdks/versions.mk
-include $(TOP)/sdks/paths.mk
-
-ifndef DISABLE_LIBTOOLIZE
-#brew's libtool is not compatible with some of the deps needed (I.E. V8) so in those systems we need to explicit add to the path
-#this is due mono not being compatible with xcode's libtool, which is what's on path by default
-ifeq (, $(shell which glibtoolize))
-EXTRA_PATH=$(wildcard /usr/local/Cellar/libtool/*/bin/)
-endif
-endif
-
-.PHONY: all
-all:
-
-## Common Mono targets
-
-.PHONY: configure-mono
-configure-mono: $(TOP)/configure
-
-
-ifeq ($(UNAME),Darwin)
-.stamp-ulimit-check:
-	@if [ $$(ulimit -n) -lt 1024 ] ; then \
-		echo "Error: Increase ulimit -n to at least 1024"; \
-		exit 1; \
-	fi
-	touch $@
-else
-.stamp-ulimit-check:
-	touch $@
-endif
-
-$(TOP)/configure: $(TOP)/configure.ac $(TOP)/autogen.sh .stamp-ulimit-check
-	cd $(TOP) && PATH=$(EXTRA_PATH):$$PATH NOCONFIGURE=1 ./autogen.sh $(if $(wildcard $(TOP)/../mono-extensions),--enable-extension-module=xamarin --enable-extension-module)
-
-## Archive targets
-
-ifdef ENABLE_ANDROID
-android_ARCHIVE=
-endif
-
-ifdef ENABLE_IOS
-ios_ARCHIVE=
-endif
-
-ifdef ENABLE_MAC
-mac_ARCHIVE=
-endif
-
-ifdef ENABLE_MACCAT
-maccat_ARCHIVE=
-endif
-
-ifdef ENABLE_WASM
-wasm_ARCHIVE=
-endif
-
-##
-# Parameters:
-#  $(1): target (android, ios, mac, wasm)
-#  $(2): compression format (7z, zip)
-define ArchiveTemplate
-_$(1)_HASH = $$(shell git -C $$(TOP) rev-parse HEAD)
-_$(1)_PACKAGE = $(1)-$$(CONFIGURATION)-$$(UNAME)-$$(_$(1)_HASH).$(2)
-
-ifeq ($(2),7z)
-_$(1)_COMPRESSION_ARGS = -t7z -mx=9
-endif
-
-.PHONY: archive-$(1)
-archive-$(1):
-	cd $$(TOP)/sdks/out && 7z a $$(_$(1)_COMPRESSION_ARGS) $$(TOP)/$$(_$(1)_PACKAGE) $$(sort $$($(1)_ARCHIVE))
-endef
-
-ifdef ENABLE_ANDROID
-$(eval $(call ArchiveTemplate,android,7z))
-endif
-
-ifdef ENABLE_IOS
-$(eval $(call ArchiveTemplate,ios,7z))
-endif
-
-ifdef ENABLE_MAC
-$(eval $(call ArchiveTemplate,mac,7z))
-endif
-
-ifdef ENABLE_MACCAT
-$(eval $(call ArchiveTemplate,maccat,7z))
-endif
-
-ifdef ENABLE_WASM
-$(eval $(call ArchiveTemplate,wasm,zip))
-endif
-
-## Targets
-
-.PHONY: build-custom-%
-build-custom-%:
-	$(MAKE) -C $*
-
-.PHONY: setup-custom-%
-setup-custom-%:
-	mkdir -p $(TOP)/sdks/out/$*
-
-##
-# Parameters:
-# $(1): product
-# $(2): target
-define TargetTemplate
-
-.PHONY: toolchain-$(1)-$(2)
-toolchain-$(1)-$(2): .stamp-$(1)-$(2)-toolchain
-
-.PHONY: toolchain
-toolchain: toolchain-$(1)-$(2)
-
-.stamp-$(1)-$(2)-configure: .stamp-$(1)-$(2)-toolchain
-
-.PHONY: configure-$(1)-$(2)
-configure-$(1)-$(2): .stamp-$(1)-$(2)-configure
-
-.PHONY: configure
-configure: configure-$(1)-$(2)
-
-.PHONY: build-$(1)-$(2)
-build-$(1)-$(2): .stamp-$(1)-$(2)-configure
-	$$(MAKE) build-custom-$(1)-$(2)
-
-.PHONY: build
-build: build-$(1)-$(2)
-
-.PHONY: setup-$(1)-$(2)
-setup-$(1)-$(2):
-	$$(MAKE) setup-custom-$(1)-$(2)
-
-.PHONY: package-$(1)-$(2)
-package-$(1)-$(2): setup-$(1)-$(2) build-$(1)-$(2)
-
-.PHONY: clean-$(1)-$(2)
-clean-$(1)-$(2):
-
-.PHONY: clean
-clean: clean-$(1)-$(2)
-
-endef
-
-## Products
-
-include runtime.mk
-include bcl.mk
-
-## MXE targets
-ifeq ($(and $(DISABLE_ANDROID),$(DISABLE_WASM_CROSS)),)
-# FIXME add iOS support(?)
-include mxe.mk
-endif
-
-## LLVM targets
-include llvm.mk
-
-## Android targets
-ifdef ENABLE_ANDROID
-include android.mk
-endif
-
-## iOS targets
-ifdef ENABLE_IOS
-include ios.mk
-endif
-
-## Mac targets
-ifdef ENABLE_MAC
-include mac.mk
-endif
-
-## Mac Catalyst targets
-ifdef ENABLE_MACCAT
-include maccat.mk
-endif
-
-## Desktop targets
-## To run host-side tests
-ifdef ENABLE_DESKTOP
-include desktop.mk
-endif
-
-## WASM targets
-include wasm.mk

+ 0 - 521
sdks/builds/android.mk

@@ -1,521 +0,0 @@
-
-ANDROID_URI?=https://dl.google.com/android/repository/
-ANT_URI?=https://archive.apache.org/dist/ant/binaries/
-
-ANDROID_SDK_PREFIX?=$(ANDROID_TOOLCHAIN_DIR)/sdk
-ANDROID_TOOLCHAIN_PREFIX?=$(ANDROID_TOOLCHAIN_DIR)/toolchains
-ANDROID_NEW_NDK=$(shell if test `grep 'Pkg\.Revision' $(ANDROID_TOOLCHAIN_DIR)/ndk/source.properties | cut -d '=' -f 2 | tr -d ' ' | cut -d '.' -f 1` -ge 18; then echo yes; else echo no; fi)
-
-android_SOURCES_DIR = $(TOP)/sdks/out/android-sources
-android_TPN_DIR = $(TOP)/sdks/out/android-tpn
-android_HOST_DARWIN_LIB_DIR = $(TOP)/sdks/out/android-host-Darwin-$(CONFIGURATION)/lib
-android_HOST_DARWIN_BIN_DIR = $(TOP)/sdks/out/android-host-Darwin-$(CONFIGURATION)/bin
-android_PLATFORM_BIN=$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin
-
-ifneq (,$(filter $(UNAME),Darwin Linux))
-android_ARCHIVE += android-sources android-tpn
-ADDITIONAL_PACKAGE_DEPS += $(android_SOURCES_DIR) $(android_TPN_DIR)
-endif
-
-ifeq ($(UNAME),Darwin)
-ANDROID_LIBCLANG = $(ANDROID_TOOLCHAIN_DIR)/ndk/toolchains/llvm/prebuilt/darwin-x86_64/lib64/libclang.dylib
-else ifeq ($(UNAME),Linux)
-ANDROID_LIBCLANG = $(ANDROID_TOOLCHAIN_DIR)/ndk/toolchains/llvm/prebuilt/linux-x86_64/lib64/libclang.so.8svn
-endif
-
-COMMA := ,
-
-##
-# Parameters:
-#  $(1): target
-#  $(2): dir
-#  $(3): subdir (optional)
-#  $(4): stamp (optional, default to $(1))
-define AndroidProvisioningTemplate
-
-$$(ANDROID_TOOLCHAIN_CACHE_DIR)/$(1).zip:
-	mkdir -p $$(dir $$@)
-	wget --no-verbose -O $$@ $$(ANDROID_URI)$(1).zip
-
-$$(ANDROID_TOOLCHAIN_DIR)/$(2)/.stamp-$$(or $(4),$(1)): $$(ANDROID_TOOLCHAIN_CACHE_DIR)/$(1).zip
-	mkdir -p $$(dir $$@)
-	rm -rf $$(ANDROID_TOOLCHAIN_DIR)/$(2)$$(if $(3),/$(3))
-	./unzip-android-archive.sh "$$<" "$$(ANDROID_TOOLCHAIN_DIR)/$(2)$$(if $(3),/$(3))"
-	touch $$@
-
-.PHONY: provision-android
-provision-android: $$(ANDROID_TOOLCHAIN_DIR)/$(2)/.stamp-$$(or $(4),$(1))
-
-endef
-
-##
-# Parameters:
-# $(1): target
-# $(2): dir
-# $(3): subdir (optional)
-# $(4): stamp (optional, default to $(1))
-define AndroidProvisioningTemplateStub
-
-.PHONY: provision-android-$(1)
-provision-android-$(1):
-	@echo "TODO: provision $(2)/.stamp-$$(or $(4),$(1)) for $$(UNAME)"
-
-.PHONY: provision-android
-provision-android: provision-android-$(1)
-
-endef
-
-ifeq ($(UNAME),Darwin)
-$(eval $(call AndroidProvisioningTemplate,android-ndk-$(ANDROID_NDK_VERSION)-darwin-x86_64,ndk,,ndk))
-$(eval $(call AndroidProvisioningTemplate,platform-tools_r$(ANDROID_PLATFORM_TOOLS_VERSION)-darwin,sdk,platform-tools))
-$(eval $(call AndroidProvisioningTemplate,sdk-tools-darwin-$(ANDROID_SDKTOOLS_VERSION),sdk,tools))
-$(eval $(call AndroidProvisioningTemplate,cmake-$(ANDROID_CMAKE_VERSION)-darwin-x86_64,sdk,cmake/$(ANDROID_CMAKE_VERSION)))
-else ifeq ($(UNAME),Linux)
-$(eval $(call AndroidProvisioningTemplate,android-ndk-$(ANDROID_NDK_VERSION)-linux-x86_64,ndk,,ndk))
-$(eval $(call AndroidProvisioningTemplate,platform-tools_r$(ANDROID_PLATFORM_TOOLS_VERSION)-linux,sdk,platform-tools))
-$(eval $(call AndroidProvisioningTemplate,sdk-tools-linux-$(ANDROID_SDKTOOLS_VERSION),sdk,tools))
-$(eval $(call AndroidProvisioningTemplate,cmake-$(ANDROID_CMAKE_VERSION)-linux-x86_64,sdk,cmake/$(ANDROID_CMAKE_VERSION)))
-else ifeq ($(UNAME),Windows)
-$(eval $(call AndroidProvisioningTemplateStub,android-ndk-$(ANDROID_NDK_VERSION)-win32-x86_64,ndk,,ndk))
-$(eval $(call AndroidProvisioningTemplateStub,platform-tools_r$(ANDROID_PLATFORM_TOOLS_VERSION)-win32,sdk,platform-tools))
-$(eval $(call AndroidProvisioningTemplateStub,sdk-tools-win32-$(ANDROID_SDKTOOLS_VERSION),sdk,tools))
-$(eval $(call AndroidProvisioningTemplateStub,cmake-$(ANDROID_CMAKE_VERSION)-win32-x86_64,sdk,cmake/$(ANDROID_CMAKE_VERSION)))
-endif
-
-##
-# Parameters:
-#  $(1): target
-#  $(2): arch
-#  $(3): abi_name
-#  $(4): host_triple
-#  $(5): interpreter (either '-interpreter' or empty)
-#
-# Flags:
-#  android-$(1)_CFLAGS
-#  android-$(1)_CXXFLAGS
-#  android-$(1)_LDFLAGS
-define AndroidTargetTemplate
-_android$(5)-$(1)_AR=$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-ar
-_android$(5)-$(1)_AS=$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-as
-_android$(5)-$(1)_CC=$$(CCACHE) $$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-clang
-_android$(5)-$(1)_CXX=$$(CCACHE) $$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-clang++
-_android$(5)-$(1)_CPP=$$(CCACHE) $$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-$$(if $(wildcard $$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-cpp),cpp,clang -E)
-_android$(5)-$(1)_CXXCPP=$$(CCACHE) $$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-$$(if $(wildcard $$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-cpp),cpp,clang++ -E)
-_android$(5)-$(1)_DLLTOOL=
-_android$(5)-$(1)_LD=$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-ld
-_android$(5)-$(1)_OBJDUMP="$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-objdump"
-_android$(5)-$(1)_RANLIB=$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-ranlib
-_android$(5)-$(1)_CMAKE=$$(ANDROID_SDK_PREFIX)/cmake/$(ANDROID_CMAKE_VERSION)/bin/cmake
-_android$(5)-$(1)_STRIP=$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/bin/$(3)-strip
-
-_android$(5)-$(1)_AC_VARS= \
-	mono_cv_uscore=yes \
-	ac_cv_func_sched_getaffinity=no \
-	ac_cv_func_sched_setaffinity=no \
-	ac_cv_func_shm_open_working_with_mmap=no
-
-_android$(5)-$(1)_CFLAGS= \
-	-fstack-protector \
-	-DMONODROID=1 $$(if $$(filter $$(ANDROID_NEW_NDK),yes),-D__ANDROID_API__=$$(ANDROID_SDK_VERSION_$(1)))
-
-_android$(5)-$(1)_CXXFLAGS= \
-	-fstack-protector \
-	-DMONODROID=1 $$(if $$(filter $$(ANDROID_NEW_NDK),yes),-D__ANDROID_API__=$$(ANDROID_SDK_VERSION_$(1)))
-
-
-_android$(5)-$(1)_CPPFLAGS= \
-	-I$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/sysroot/usr/include
-
-_android$(5)-$(1)_CXXCPPFLAGS= \
-	-I$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang/sysroot/usr/include
-
-_android$(5)-$(1)_LDFLAGS= \
-	-z now -z relro -z noexecstack \
-	-ldl -lm -llog -lc -lgcc \
-	-Wl,-rpath-link=$$(ANDROID_TOOLCHAIN_DIR)/ndk/platforms/android-$$(ANDROID_SDK_VERSION_$(1))/arch-$(2)/usr/lib,-dynamic-linker=/system/bin/linker \
-	-L$$(ANDROID_TOOLCHAIN_DIR)/ndk/platforms/android-$$(ANDROID_SDK_VERSION_$(1))/arch-$(2)/usr/lib
-
-_android$(5)-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-executables \
-	--disable-iconv \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-dynamic-btls \
-	--enable-maintainer-mode \
-	--enable-minimal=ssa,portability,attach,verifier,full_messages,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,security,shared_handles,$$(if $(5),,interpreter$$(COMMA)),gac,cfgdir_config \
-	--enable-monodroid \
-	--with-btls-android-ndk=$$(ANDROID_TOOLCHAIN_DIR)/ndk \
-	--with-btls-android-api=$$(ANDROID_SDK_VERSION_$(1)) \
-	$$(if $$(filter $$(ANDROID_NEW_NDK),yes),--with-btls-android-ndk-asm-workaround) \
-	--with-btls-android-cmake-toolchain=$$(ANDROID_TOOLCHAIN_DIR)/ndk/build/cmake/android.toolchain.cmake \
-	--with-sigaltstack=yes \
-	--with-tls=pthread \
-	--without-ikvm-native \
-	--disable-cooperative-suspend \
-	--disable-hybrid-suspend \
-	--disable-crash-reporting
-
-ifeq ($(5),-interpreter)
-.stamp-android$(5)-$(1)-toolchain: .stamp-android-$(1)-toolchain
-else
-.stamp-android-$(1)-toolchain: | $$(if $$(IGNORE_PROVISION_ANDROID),,provision-android)
-	$(PYTHON) "$$(ANDROID_TOOLCHAIN_DIR)/ndk/build/tools/make_standalone_toolchain.py" --verbose --force --api=$$(ANDROID_SDK_VERSION_$(1)) --arch=$(2) --install-dir=$$(ANDROID_TOOLCHAIN_PREFIX)/$(1)-clang
-	touch $$@
-endif
-
-$$(eval $$(call RuntimeTemplate,android,$(1),$(4),,$(5)))
-
-endef
-
-##
-# Parameters:
-#  $(1): target
-#  $(2): arch
-#  $(3): abi_name
-#  $(4): host_triple
-#
-# Flags:
-#  android-$(1)_CFLAGS
-#  android-$(1)_CXXFLAGS
-#  android-$(1)_LDFLAGS
-define AndroidTargetTemplateStub
-
-.stamp-android-$(1)-toolchain: | $$(if $$(IGNORE_PROVISION_ANDROID),,provision-android)
-	touch $$@
-
-$$(eval $$(call RuntimeTemplateStub,android,$(1),$(4)))
-
-endef
-
-## android-armeabi-v7a
-android-armeabi-v7a_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp
-android-armeabi-v7a_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp
-android-armeabi-v7a_LDFLAGS=-Wl,--fix-cortex-a8
-ifeq ($(UNAME),Windows)
-$(eval $(call AndroidTargetTemplateStub,armeabi-v7a,arm,arm-linux-androideabi,armv5-linux-androideabi))
-else
-$(eval $(call AndroidTargetTemplate,armeabi-v7a,arm,arm-linux-androideabi,armv5-linux-androideabi))
-$(eval $(call AndroidTargetTemplate,armeabi-v7a,arm,arm-linux-androideabi,armv5-linux-androideabi,-interpreter))
-endif
-
-## android-arm64-v8a
-android-arm64-v8a_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -DL_cuserid=9 -DANDROID64
-android-arm64-v8a_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -DL_cuserid=9 -DANDROID64
-ifeq ($(UNAME),Windows)
-$(eval $(call AndroidTargetTemplateStub,arm64-v8a,arm64,aarch64-linux-android,aarch64-linux-android))
-else
-$(eval $(call AndroidTargetTemplate,arm64-v8a,arm64,aarch64-linux-android,aarch64-linux-android))
-$(eval $(call AndroidTargetTemplate,arm64-v8a,arm64,aarch64-linux-android,aarch64-linux-android,-interpreter))
-endif
-
-## android-x86
-ifeq ($(UNAME),Windows)
-$(eval $(call AndroidTargetTemplateStub,x86,x86,i686-linux-android,i686-linux-android))
-else
-$(eval $(call AndroidTargetTemplate,x86,x86,i686-linux-android,i686-linux-android))
-$(eval $(call AndroidTargetTemplate,x86,x86,i686-linux-android,i686-linux-android,-interpreter))
-endif
-
-## android-x86_64
-android-x86_64_CFLAGS=-DL_cuserid=9
-android-x86_64_CXXFLAGS=-DL_cuserid=9
-ifeq ($(UNAME),Windows)
-$(eval $(call AndroidTargetTemplateStub,x86_64,x86_64,x86_64-linux-android,x86_64-linux-android))
-else
-$(eval $(call AndroidTargetTemplate,x86_64,x86_64,x86_64-linux-android,x86_64-linux-android))
-$(eval $(call AndroidTargetTemplate,x86_64,x86_64,x86_64-linux-android,x86_64-linux-android,-interpreter))
-endif
-
-##
-# Parameters
-#  $(1): target
-#
-# Flags:
-#  android-$(1)_CFLAGS
-#  android-$(1)_CXXFLAGS
-define AndroidHostTemplate
-
-_android-$(1)_AR=ar
-_android-$(1)_AS=as
-_android-$(1)_CC=cc
-_android-$(1)_CXX=c++
-_android-$(1)_CXXCPP=cpp
-_android-$(1)_LD=ld
-_android-$(1)_RANLIB=ranlib
-_android-$(1)_STRIP=strip
-
-_android-$(1)_CFLAGS= \
-	$$(if $$(filter $$(UNAME),Darwin),-mmacosx-version-min=10.9)
-
-_android-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-iconv \
-	--disable-mono-debugger \
-	--disable-nls \
-	--disable-mcs-build \
-	--enable-dynamic-btls \
-	--enable-maintainer-mode \
-	--enable-monodroid \
-	--with-mcs-docs=no \
-	--without-ikvm-native \
-	--with-static_mono=no \
-	--disable-crash-reporting
-
-.stamp-android-$(1)-toolchain:
-	touch $$@
-
-$$(eval $$(call RuntimeTemplate,android,$(1)))
-
-ifeq ($$(UNAME),Darwin)
-ADDITIONAL_PACKAGE_DEPS += $$(android_HOST_DARWIN_LIB_DIR)/.stamp-android-loader-path
-endif
-
-endef
-
-# on Windows, we use the AndroidHostMxeTemplate, instead
-ifneq ($(UNAME),Windows)
-$(eval $(call AndroidHostTemplate,host-$(UNAME)))
-endif
-
-##
-# Parameters
-#  $(1): target
-#  $(2): arch
-define AndroidHostMxeTemplate
-
-_android-$(1)_PATH=$$(MXE_PREFIX)/bin
-
-_android-$(1)_AR=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-ar
-_android-$(1)_AS=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-as
-_android-$(1)_CC=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-gcc
-_android-$(1)_CXX=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-g++
-_android-$(1)_DLLTOOL=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-dlltool
-_android-$(1)_LD=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-ld
-_android-$(1)_OBJDUMP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-objdump
-_android-$(1)_RANLIB=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-ranlib
-_android-$(1)_STRIP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-strip
-
-# On Cygwin, assume x86_64-mingw32-zlib and i686-mingw32-zlib are installed
-# TODO: WSL packages will depend on the distro
-_android-$(1)_AC_VARS= \
-	$$(if $$(filter $$(UNAME),Windows),,ac_cv_header_zlib_h=no) \
-	ac_cv_search_dlopen=no
-
-_android-$(1)_CFLAGS= \
-	-DXAMARIN_PRODUCT_VERSION=0 \
-	$$(if $$(filter $$(UNAME),Windows),,-I$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/include)
-
-_android-$(1)_CXXFLAGS= \
-	-DXAMARIN_PRODUCT_VERSION=0 \
-		$$(if $$(filter $$(UNAME),Windows),,-I$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/include)
-
-_android-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-llvm \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-static-gcc-libs \
-	--enable-maintainer-mode \
-	--enable-monodroid \
-	--with-monodroid \
-	--with-static_mono=no \
-	--disable-crash-reporting
-
-ifeq ($(UNAME),Darwin)
-_android-$(1)_LDFLAGS= \
-	$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/lib/libz.a
-endif
-
-.stamp-android-$(1)-toolchain:
-	touch $$@
-
-.stamp-android-$(1)-$$(CONFIGURATION)-configure: | $(if $(IGNORE_PROVISION_MXE),,provision-mxe)
-
-$$(eval $$(call RuntimeTemplate,android,$(1),$(2)-w64-mingw32))
-
-endef
-
-ifneq ($(UNAME),Windows)
-$(eval $(call AndroidHostMxeTemplate,host-mxe-Win32,i686))
-$(eval $(call AndroidHostMxeTemplate,host-mxe-Win64,x86_64))
-else
-# on Windows the MinGW-built Mono is the host Mono.  But we have to use the cross template
-# because 'gcc' is the cygwin or WSL compiler, while the x86_64-w64-mingw32-gcc is the windows native compiler.
-# TODO: build $(eval $(call AndroidHostMxeTemplate,host-mxe-Win64,x86_64))
-# TODO: also build $(eval $(call AndroidHostMxeTemplate,host-mxe-Win32,i686))
-endif
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): target arch
-#  $(4): device target (armeabi-v7a, arm64-v8a, x86 or x86_64)
-#  $(5): llvm (llvm64 or llvmwin64)
-#  $(6): offsets dumper abi
-define AndroidCrossTemplate
-
-_android-$(1)_OFFSETS_DUMPER_ARGS=--libclang="$$(ANDROID_LIBCLANG)" --sysroot="$$(ANDROID_TOOLCHAIN_DIR)/ndk/sysroot"
-
-_android-$(1)_AR=ar
-_android-$(1)_AS=as
-_android-$(1)_CC=$$(or $$(android-$(1)_CC),cc)
-_android-$(1)_CXX=$$(or $$(android-$(1)_CXX),c++)
-_android-$(1)_CXXCPP=cpp
-_android-$(1)_LD=ld
-_android-$(1)_RANLIB=ranlib
-_android-$(1)_STRIP=strip
-
-_android-$(1)_CFLAGS= \
-	$$(if $$(RELEASE),,-DDEBUG_CROSS) \
-	$$(if $$(filter $$(UNAME),Darwin),-mmacosx-version-min=10.9) \
-	-DXAMARIN_PRODUCT_VERSION=0
-
-_android-$(1)_CXXFLAGS= \
-	$$(if $$(RELEASE),,-DDEBUG_CROSS) \
-	$$(if $$(filter $$(UNAME),Darwin),-mmacosx-version-min=10.9 -stdlib=libc++) \
-	-DXAMARIN_PRODUCT_VERSION=0
-
-_android-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-maintainer-mode \
-	--with-tls=pthread
-
-$$(eval $$(call CrossRuntimeTemplate,android,$(1),$$(if $$(filter $$(UNAME),Darwin),$(2)-apple-darwin10,$$(if $$(filter $$(UNAME),Linux),$(2)-linux-gnu)),$(3)-linux-android,$(4),$(5),$(6)))
-
-endef
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): target arch
-#  $(4): device target (armeabi-v7a, arm64-v8a, x86 or x86_64)
-#  $(5): llvm (llvm64 or llvmwin64)
-#  $(6): offsets dumper abi
-define AndroidCrossTemplateStub
-
-$$(eval $$(call CrossRuntimeTemplateStub,android,$(1),$$(if $$(filter $$(UNAME),Darwin),$(2)-apple-darwin10,$$(if $$(filter $$(UNAME),Linux),$(2)-linux-gnu)),$(3)-linux-android,$(4),$(5),$(6)))
-
-endef
-
-ifeq ($(UNAME),Windows)
-$(eval $(call AndroidCrossTemplateStub,cross-arm,x86_64,armv7,armeabi-v7a,llvm-llvm64,armv7-none-linux-androideabi))
-$(eval $(call AndroidCrossTemplateStub,cross-arm64,x86_64,aarch64-v8a,arm64-v8a,llvm-llvm64,aarch64-v8a-linux-android))
-$(eval $(call AndroidCrossTemplateStub,cross-x86,x86_64,i686,x86,llvm-llvm64,i686-none-linux-android))
-$(eval $(call AndroidCrossTemplateStub,cross-x86_64,x86_64,x86_64,x86_64,llvm-llvm64,x86_64-none-linux-android))
-else
-$(eval $(call AndroidCrossTemplate,cross-arm,x86_64,armv7,armeabi-v7a,llvm-llvm64,armv7-none-linux-androideabi))
-$(eval $(call AndroidCrossTemplate,cross-arm64,x86_64,aarch64-v8a,arm64-v8a,llvm-llvm64,aarch64-v8a-linux-android))
-$(eval $(call AndroidCrossTemplate,cross-x86,x86_64,i686,x86,llvm-llvm64,i686-none-linux-android))
-$(eval $(call AndroidCrossTemplate,cross-x86_64,x86_64,x86_64,x86_64,llvm-llvm64,x86_64-none-linux-android))
-endif
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): target arch
-#  $(4): device target
-#  $(5): llvm
-#  $(6): offsets dumper abi
-define AndroidCrossMXETemplate
-
-_android-$(1)_OFFSETS_DUMPER_ARGS=--libclang="$$(ANDROID_LIBCLANG)" --sysroot="$$(ANDROID_TOOLCHAIN_DIR)/ndk/sysroot"
-
-_android-$(1)_PATH=$$(MXE_PREFIX)/bin
-
-_android-$(1)_AR=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-ar
-_android-$(1)_AS=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-as
-_android-$(1)_CC=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-gcc
-_android-$(1)_CXX=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-g++
-_android-$(1)_DLLTOOL=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-dlltool
-_android-$(1)_LD=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-ld
-_android-$(1)_OBJDUMP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-objdump
-_android-$(1)_RANLIB=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-ranlib
-_android-$(1)_STRIP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32-strip
-
-_android-$(1)_CFLAGS= \
-	$$(if $$(RELEASE),,-DDEBUG_CROSS) \
-	-DXAMARIN_PRODUCT_VERSION=0 \
-	-I$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/include
-
-_android-$(1)_CXXFLAGS= \
-	$$(if $$(RELEASE),,-DDEBUG_CROSS) \
-	-DXAMARIN_PRODUCT_VERSION=0 \
-	-I$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/include
-
-_android-$(1)_LDFLAGS=
-
-
-_android-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-static-gcc-libs \
-	--enable-maintainer-mode \
-	--with-tls=pthread
-
-ifeq ($(UNAME),Darwin)
-_android-$(1)_CONFIGURE_FLAGS += \
-	--with-static-zlib=$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/lib/libz.a
-endif
-
-.stamp-android-$(1)-$$(CONFIGURATION)-configure: | $(if $(IGNORE_PROVISION_MXE),,provision-mxe)
-
-$$(eval $$(call CrossRuntimeTemplate,android,$(1),$(2)-w64-mingw32,$(3)-linux-android,$(4),$(5),$(6)))
-
-endef
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): target arch
-#  $(4): device target
-#  $(5): llvm
-#  $(6): offsets dumper abi
-define AndroidCrossMXETemplateStub
-
-$$(eval $$(call CrossRuntimeTemplateStub,android,$(1),$(2)-w64-mingw32,$(3)-linux-android,$(4),$(5),$(6)))
-
-endef
-
-ifneq ($(UNAME),Windows)
-$(eval $(call AndroidCrossMXETemplate,cross-arm-win,x86_64,armv7,armeabi-v7a,llvm-llvmwin64,armv7-none-linux-androideabi))
-$(eval $(call AndroidCrossMXETemplate,cross-arm64-win,x86_64,aarch64-v8a,arm64-v8a,llvm-llvmwin64,aarch64-v8a-linux-android))
-$(eval $(call AndroidCrossMXETemplate,cross-x86-win,x86_64,i686,x86,llvm-llvmwin64,i686-none-linux-android))
-$(eval $(call AndroidCrossMXETemplate,cross-x86_64-win,x86_64,x86_64,x86_64,llvm-llvmwin64,x86_64-none-linux-android))
-else
-$(eval $(call AndroidCrossMXETemplateStub,cross-arm-win,x86_64,armv7,armeabi-v7a,llvm-llvmwin64,armv7-none-linux-androideabi))
-$(eval $(call AndroidCrossMXETemplateStub,cross-arm64-win,x86_64,aarch64-v8a,arm64-v8a,llvm-llvmwin64,aarch64-v8a-linux-android))
-$(eval $(call AndroidCrossMXETemplateStub,cross-x86-win,x86_64,i686,x86,llvm-llvmwin64,i686-none-linux-android))
-$(eval $(call AndroidCrossMXETemplateStub,cross-x86_64-win,x86_64,x86_64,x86_64,llvm-llvmwin64,x86_64-none-linux-android))
-endif
-
-ifeq ($(UNAME),Windows)
-_bcl_android_BUILD_FLAGS += \
-	PROFILE_PLATFORM=win32
-endif
-
-$(eval $(call BclTemplate,android,monodroid monodroid_tools,monodroid monodroid_tools))
-
-$(android_SOURCES_DIR)/external/linker/README.md:  # we use this as a sentinel file to avoid rsyncing everything on each build (slows down iterating)
-	mkdir -p $(android_SOURCES_DIR)/external/linker
-	cd $(TOP) && rsync -r --include='*.cs' --include="README.md" --include="*/" --exclude="*" external/linker $(android_SOURCES_DIR)/external
-
-$(android_SOURCES_DIR): $(android_SOURCES_DIR)/external/linker/README.md
-
-$(android_TPN_DIR)/LICENSE:
-	mkdir -p $(android_TPN_DIR)
-	cd $(TOP) && rsync -r --include='THIRD-PARTY-NOTICES.TXT' --include='license.txt' --include='License.txt' --include='LICENSE' --include='LICENSE.txt' --include='LICENSE.TXT' --include='COPYRIGHT.regex' --include='*/' --exclude="*" --prune-empty-dirs . $(android_TPN_DIR)
-
-$(android_TPN_DIR): $(android_TPN_DIR)/LICENSE
-
-$(android_HOST_DARWIN_LIB_DIR)/.stamp-android-loader-path: package-android-host-Darwin
-	$(android_PLATFORM_BIN)/install_name_tool -id @loader_path/libmonosgen-2.0.dylib $(android_HOST_DARWIN_LIB_DIR)/libmonosgen-2.0.dylib
-	$(android_PLATFORM_BIN)/install_name_tool -change $(android_HOST_DARWIN_LIB_DIR)/libmonosgen-2.0.1.dylib @loader_path/libmonosgen-2.0.dylib $(android_HOST_DARWIN_BIN_DIR)/mono
-	touch $@

+ 0 - 73
sdks/builds/bcl.mk

@@ -1,73 +0,0 @@
-
-_bcl_CONFIGURE_FLAGS = \
-	$(if $(filter $(UNAME),Windows),--host=$(HOST_ARCH_MINGW32)-w64-mingw32) \
-	--disable-boehm \
-	--disable-btls-lib \
-	--disable-nls \
-	--disable-support-build \
-	--with-mcs-docs=no
-
-.stamp-bcl-configure: $(TOP)/configure
-	mkdir -p $(TOP)/sdks/builds/bcl
-	./wrap-configure.sh $(TOP)/sdks/builds/bcl $(abspath $<) $(_bcl_CONFIGURE_FLAGS)
-	touch $@
-
-.PHONY: build-bcl
-build-bcl: .stamp-bcl-configure
-	$(MAKE) -C bcl -C mono
-
-.PHONY: clean-bcl
-clean-bcl:
-	rm -rf .stamp-bcl-configure $(TOP)/sdks/builds/bcl
-
-##
-# Parameters
-#  $(1): product
-#  $(2): build profiles
-#  $(3): test profiles
-define BclTemplate
-
-.stamp-$(1)-bcl-toolchain:
-	touch $$@
-
-.stamp-$(1)-bcl-configure: .stamp-bcl-configure
-	touch $$@
-
-.PHONY: setup-custom-$(1)-bcl
-setup-custom-$(1)-bcl:
-	mkdir -p $$(TOP)/sdks/out/$(1)-bcl $$(foreach profile,$(2),$$(TOP)/sdks/out/$(1)-bcl/$$(profile))
-
-.PHONY: build-$(1)-bcl
-build-$(1)-bcl: build-bcl
-
-.PHONY: build-custom-$(1)-bcl
-build-custom-$(1)-bcl:
-	$$(MAKE) -C bcl -C runtime all-mcs build_profiles="$(2)" $$(_bcl_$(1)_BUILD_FLAGS)
-	$$(if $(3),$$(MAKE) -C bcl -C runtime test xunit-test test_profiles="$(3)" $$(_bcl_$(1)_BUILD_FLAGS))
-
-.PHONY: package-$(1)-bcl
-package-$(1)-bcl:
-	$$(foreach profile,$(2), \
-		cp -R $$(TOP)/mcs/class/lib/$$(profile)/* $$(TOP)/sdks/out/$(1)-bcl/$$(profile);)
-
-.PHONY: clean-$(1)-bcl
-clean-$(1)-bcl: clean-bcl
-	rm -rf $$(TOP)/sdks/out/$(1)-bcl $$(foreach profile,$(2),$$(TOP)/sdks/out/$(1)-bcl/$$(profile))
-
-$$(eval $$(call TargetTemplate,$(1),bcl))
-
-.PHONY: configure-$(1)
-configure-$(1): configure-$(1)-bcl
-
-.PHONY: build-$(1)
-build-$(1): build-$(1)-bcl
-
-.PHONY: package-$(1)
-package-$(1): package-$(1)-bcl
-
-.PHONY: archive-$(1)
-archive-$(1): package-$(1)-bcl
-
-$(1)_ARCHIVE += $(1)-bcl
-
-endef

+ 0 - 39
sdks/builds/create-shared-library.sh

@@ -1,39 +0,0 @@
-#!/bin/bash -e
-
-# This script takes a static library (.a) as input and creates a dylib or framework from it:
-# 1) First all the object files are extracted from the static library.
-# 2) Then all the object files are relinked into a dynamic library / framework).
-#
-# Arguments
-# 1: the input static library
-# 2: the output framework library
-# 3+: any custom linker arguments.
-
-STATIC_LIBRARY=$1
-FRAMEWORK=$2
-
-if test -z $STATIC_LIBRARY; then
-	echo "The first argument must be the input (static) library."
-	exit 1
-elif ! test -f $STATIC_LIBRARY; then
-	echo "Could not find the input library: $STATIC_LIBRARY"
-	exit 1
-fi
-
-if test -z $FRAMEWORK; then
-	echo "The second argument must be the output (shared) library."
-	exit 1
-fi
-
-shift 2
-LINKER_FLAGS="$@"
-
-mkdir -p $(dirname $FRAMEWORK)
-TMPDIR=$FRAMEWORK.tmpdir
-rm -Rf $TMPDIR
-mkdir -p $TMPDIR
-cd $TMPDIR
-ar -x $STATIC_LIBRARY
-cd ..
-
-$CC $LINKER_FLAGS -dynamiclib -O2 -Wl,-application_extension -compatibility_version 2 -current_version 2.0 -framework CoreFoundation -lobjc -liconv -lz -o $FRAMEWORK $TMPDIR/*.o

+ 0 - 32
sdks/builds/desktop.mk

@@ -1,32 +0,0 @@
-
-##
-# Parameters:
-#  $(1): arch
-#  $(2): host_triple
-#
-# Flags:
-#  desktop-$(1)_CFLAGS
-#  desktop-$(1)_CXXFLAGS
-#  desktop-$(1)_LDFLAGS
-define DesktopTemplate
-
-_desktop-$(1)_CC=cc
-
-_desktop-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-iconv \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-dynamic-btls \
-	--enable-maintainer-mode \
-	--with-sigaltstack=yes \
-	--with-tls=pthread \
-	--without-ikvm-native
-
-$$(eval $$(call RuntimeTemplate,desktop,$(1),$(2)))
-
-endef
-
-$(eval $(call DesktopTemplate,x86_64,x86_64-apple-darwin17.2.0))
-
-$(eval $(call BclTemplate,desktop,net_4_x,))

+ 0 - 16
sdks/builds/determine-linux-flavor.sh

@@ -1,16 +0,0 @@
-#!/bin/bash
-if [ -f /etc/os-release ]; then
-    . /etc/os-release
-    FLAVOR=$NAME
-elif [ -n "$(which lsb_release)" ]; then
-    FLAVOR=$(lsb_release -si)
-elif [ -f /etc/lsb-release ]; then
-    . /etc/lsb-release
-    FLAVOR=$DISTRIB_ID
-elif [ -f /etc/debian_version ]; then
-    FLAVOR=Debian
-else
-    FLAVOR=$(uname -s)
-fi
-
-echo $FLAVOR

+ 0 - 58
sdks/builds/ios-Mono.framework-Info.plist

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-        <key>CFBundleDevelopmentRegion</key>
-        <string>en</string>
-        <key>CFBundleIdentifier</key>
-        <string>xamarin.ios.mono-framework</string>
-        <key>CFBundleInfoDictionaryVersion</key>
-        <string>6.0</string>
-        <key>CFBundleName</key>
-        <string>Mono</string>
-        <key>CFBundlePackageType</key>
-        <string>FMWK</string>
-        <key>CFBundleShortVersionString</key>
-        <string>1.0</string>
-        <key>CFBundleSignature</key>
-        <string>????</string>
-        <key>CFBundleVersion</key>
-        <string>3.12</string>
-        <key>NSPrincipalClass</key>
-        <string></string>
-        <key>CFBundleExecutable</key>
-        <string>Mono</string>
-
-        <key>BuildMachineOSBuild</key>
-        <string>13F34</string>
-        <key>CFBundleDevelopmentRegion</key>
-        <string>en</string>
-        <key>CFBundleSupportedPlatforms</key>
-        <array>
-                <string>iPhoneOS</string>
-        </array>
-        <key>DTCompiler</key>
-        <string>com.apple.compilers.llvm.clang.1_0</string>
-        <key>DTPlatformBuild</key>
-        <string>12D508</string>
-        <key>DTPlatformName</key>
-        <string>iphoneos</string>
-        <key>DTPlatformVersion</key>
-        <string>8.2</string>
-        <key>DTSDKBuild</key>
-        <string>12D508</string>
-        <key>DTSDKName</key>
-        <string>iphoneos8.2</string>
-        <key>DTXcode</key>
-        <string>0620</string>
-        <key>DTXcodeBuild</key>
-        <string>6C131e</string>
-        <key>MinimumOSVersion</key>
-        <string>8.0</string>
-        <key>UIDeviceFamily</key>
-        <array>
-                <integer>1</integer>
-                <integer>2</integer>
-        </array>
-</dict>
-</plist>

+ 0 - 56
sdks/builds/ios-Mono.framework-tvos.Info.plist

@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-        <key>CFBundleDevelopmentRegion</key>
-        <string>en</string>
-        <key>CFBundleIdentifier</key>
-        <string>xamarin.tvos.mono-framework</string>
-        <key>CFBundleInfoDictionaryVersion</key>
-        <string>6.0</string>
-        <key>CFBundleName</key>
-        <string>Mono</string>
-        <key>CFBundlePackageType</key>
-        <string>FMWK</string>
-        <key>CFBundleShortVersionString</key>
-        <string>1.0</string>
-        <key>CFBundleSignature</key>
-        <string>????</string>
-        <key>CFBundleVersion</key>
-        <string>3.12</string>
-        <key>NSPrincipalClass</key>
-        <string></string>
-        <key>CFBundleExecutable</key>
-        <string>Mono</string>
-        <key>BuildMachineOSBuild</key>
-        <string>13F34</string>
-        <key>CFBundleDevelopmentRegion</key>
-        <string>en</string>
-        <key>CFBundleSupportedPlatforms</key>
-        <array>
-                <string>AppleTVOS</string>
-        </array>
-        <key>DTCompiler</key>
-        <string>com.apple.compilers.llvm.clang.1_0</string>
-        <key>DTPlatformBuild</key>
-        <string>12D508</string>
-        <key>DTPlatformName</key>
-        <string>appletvos</string>
-        <key>DTPlatformVersion</key>
-        <string>9.0</string>
-        <key>DTSDKBuild</key>
-        <string>12D508</string>
-        <key>DTSDKName</key>
-        <string>appletvos9.0</string>
-        <key>DTXcode</key>
-        <string>0620</string>
-        <key>DTXcodeBuild</key>
-        <string>6C131e</string>
-        <key>MinimumOSVersion</key>
-        <string>9.0</string>
-        <key>UIDeviceFamily</key>
-        <array>
-                <integer>3</integer>
-        </array>
-</dict>
-</plist>

+ 0 - 56
sdks/builds/ios-Mono.framework-watchos.Info.plist

@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-        <key>CFBundleDevelopmentRegion</key>
-        <string>en</string>
-        <key>CFBundleIdentifier</key>
-        <string>xamarin.watchos.mono-framework</string>
-        <key>CFBundleInfoDictionaryVersion</key>
-        <string>6.0</string>
-        <key>CFBundleName</key>
-        <string>Mono</string>
-        <key>CFBundlePackageType</key>
-        <string>FMWK</string>
-        <key>CFBundleShortVersionString</key>
-        <string>1.0</string>
-        <key>CFBundleSignature</key>
-        <string>????</string>
-        <key>CFBundleVersion</key>
-        <string>3.12</string>
-        <key>NSPrincipalClass</key>
-        <string></string>
-        <key>CFBundleExecutable</key>
-        <string>Mono</string>
-        <key>BuildMachineOSBuild</key>
-        <string>13F34</string>
-        <key>CFBundleDevelopmentRegion</key>
-        <string>en</string>
-        <key>CFBundleSupportedPlatforms</key>
-        <array>
-                <string>WatchOS</string>
-        </array>
-        <key>DTCompiler</key>
-        <string>com.apple.compilers.llvm.clang.1_0</string>
-        <key>DTPlatformBuild</key>
-        <string>12D508</string>
-        <key>DTPlatformName</key>
-        <string>watchos</string>
-        <key>DTPlatformVersion</key>
-        <string>2.0</string>
-        <key>DTSDKBuild</key>
-        <string>12D508</string>
-        <key>DTSDKName</key>
-        <string>watchos2.2</string>
-        <key>DTXcode</key>
-        <string>0620</string>
-        <key>DTXcodeBuild</key>
-        <string>6C131e</string>
-        <key>MinimumOSVersion</key>
-        <string>2.0</string>
-        <key>UIDeviceFamily</key>
-        <array>
-                <integer>4</integer>
-        </array>
-</dict>
-</plist>

+ 0 - 634
sdks/builds/ios.mk

@@ -1,634 +0,0 @@
-
-#
-# Targets:
-# - build-ios-<target>
-#    Build <target>
-# - package-ios-<target>
-#    Install target into ../out/<target>
-# - clean-ios-<target>
-#    Clean target
-# Where <target> is: target32, target32s, target64, sim32, sim64, cross32, cross64
-#
-
-ios_FRAMEWORKS_DIR = $(TOP)/sdks/out/ios-frameworks
-ios_LIBS_DIR = $(TOP)/sdks/out/ios-libs
-ios_SOURCES_DIR = $(TOP)/sdks/out/ios-sources
-ios_TPN_DIR = $(TOP)/sdks/out/ios-tpn
-ios_MONO_VERSION = $(TOP)/sdks/out/ios-mono-version.txt
-
-ifndef DISABLE_CLASSIC
-ios_ARCHIVE += ios-frameworks ios-libs ios-sources ios-tpn ios-mono-version.txt
-ADDITIONAL_PACKAGE_DEPS += $(ios_FRAMEWORKS_DIR) $(ios_LIBS_DIR) $(ios_SOURCES_DIR) $(ios_TPN_DIR) $(ios_MONO_VERSION)
-endif
-
-ios_PLATFORM_BIN=$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin
-
-##
-# Device builds
-#
-# Parameters
-#  $(1): target (target32/target32s/target64)
-#  $(2): host triple
-#  $(3): host arch for compiler (armv7 or arm64)
-#
-# Flags:
-#  ios-$(1)_AC_VARS
-#  ios-$(1)_SYSROOT
-#  ios-$(1)_CONFIGURE_FLAGS
-#  ios-$(1)_CFLAGS
-#  ios-$(1)_CPPFLAGS
-#  ios-$(1)_CXXFLAGS
-#  ios-$(1)_LDFLAGS
-#  ios-$(1)_BITCODE_MARKER
-#
-# This handles tvos/watchos as well.
-#
-define iOSDeviceTemplate
-
-_ios-$(1)_CC=$$(CCACHE) $$(ios_PLATFORM_BIN)/clang
-_ios-$(1)_CXX=$$(CCACHE) $$(ios_PLATFORM_BIN)/clang++
-
-_ios-$(1)_AC_VARS= \
-	ac_cv_c_bigendian=no \
-	ac_cv_func_fstatat=no \
-	ac_cv_func_readlinkat=no \
-	ac_cv_func_getpwuid_r=no \
-	ac_cv_func_posix_getpwuid_r=yes \
-	ac_cv_header_curses_h=no \
-	ac_cv_header_localcharset_h=no \
-	ac_cv_header_sys_user_h=no \
-	ac_cv_func_getentropy=no \
-	ac_cv_func_futimens=no \
-	ac_cv_func_utimensat=no \
-	ac_cv_func_shm_open_working_with_mmap=no \
-	ac_cv_func_pthread_jit_write_protect_np=no \
-	ac_cv_func_preadv=no \
-	ac_cv_func_pwritev=no \
-	mono_cv_sizeof_sunpath=104 \
-	mono_cv_uscore=yes
-
-_ios-$(1)_CFLAGS= \
-	$$(ios-$(1)_SYSROOT) \
-	-arch $(3) \
-	-Wl,-application_extension \
-	-fexceptions \
-	$$(ios-$(1)_BITCODE_MARKER)
-
-_ios-$(1)_CXXFLAGS= \
-	$$(ios-$(1)_SYSROOT) \
-	-arch $(3) \
-	-Wl,-application_extension \
-	$$(ios-$(1)_BITCODE_MARKER)
-
-_ios-$(1)_CPPFLAGS= \
-	-DMONOTOUCH=1 \
-	$$(ios-$(1)_SYSROOT) \
-	-arch $(3) \
-	-DSMALL_CONFIG -D_XOPEN_SOURCE -DHOST_IOS -DHAVE_LARGE_FILE_SUPPORT=1 \
-
-_ios-$(1)_LDFLAGS= \
-	-arch $(3) \
-	-framework CoreFoundation \
-	-lobjc -lc++
-
-# Xcode 12 and later cause issues with no_weak_imports: https://github.com/mono/mono/issues/19393
-ifeq ($(XCODE_MAJOR_VERSION),$(filter $(XCODE_MAJOR_VERSION), 11 10 9))
-_ios-$(1)_LDFLAGS += -Wl,-no_weak_imports
-endif
-
-_ios-$(1)_CONFIGURE_FLAGS = \
-	--disable-boehm \
-	--disable-btls \
-	--disable-executables \
-	--disable-icall-tables \
-	--disable-iconv \
-	--disable-mcs-build \
-	--disable-nls \
-	--disable-visibility-hidden \
-	--enable-dtrace=no \
-	--enable-icall-export \
-	--enable-maintainer-mode \
-	--enable-minimal=ssa,com,interpreter,jit,portability,assembly_remapping,attach,verifier,full_messages,appdomains,security,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,remoting,shared_perfcounters,gac \
-	--enable-monotouch \
-	--with-lazy-gc-thread-creation=yes \
-	--with-tls=pthread \
-	--without-ikvm-native \
-	--without-sigaltstack \
-	--disable-cooperative-suspend \
-	--disable-hybrid-suspend \
-	--disable-crash-reporting
-
-.stamp-ios-$(1)-toolchain:
-	touch $$@
-
-$$(eval $$(call RuntimeTemplate,ios,$(1),$(2),yes))
-
-## Create special versions of the .dylibs:
-#
-# We have the following requirements:
-#
-# * libmonosgen-2.0.dylib: must have miphone-version-min=7.0 (otherwise iOS 9 won't load it; see bug #34267).
-# * libmono-profiler-log.dylib: same as libmonosgen-2.0.dylib
-# * libmono-native-compat.dylib: same as libmonosgen-2.0.dylib
-# * Mono.framework/Mono: must have miphone-version-min=8.0, otherwise the native linker won't add a LC_ENCRYPTION_INFO load command,
-#   which the App Store requires (see bug #32820). This is not a problem for libmonosgen-2.0.dylib, because that library is only
-#   used for incremental builds, which are not published).
-#
-# So what we do is to take the static library (libmonosgen-2.0.a), extract all the object files, and re-link
-# them the required times according to how many versions we need.
-
-$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmonosgen-2.0-minversion70.dylib: package-ios-$(1)
-	CC="$$(_ios-$(1)_CC)" $$(TOP)/sdks/builds/create-shared-library.sh $$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmonosgen-2.0.a $$@ -arch $(3) -miphoneos-version-min=7.0 $$(ios_sysroot)
-
-$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmono-profiler-log-minversion70.dylib: package-ios-$(1)
-	CC="$$(_ios-$(1)_CC)" $$(TOP)/sdks/builds/create-shared-library.sh $$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmono-profiler-log-static.a $$@ -arch $(3) -miphoneos-version-min=7.0 $$(ios_sysroot) -L$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib -lmonosgen-2.0
-
-$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmono-native-compat-minversion70.dylib: package-ios-$(1)
-	CC="$$(_ios-$(1)_CC)" $$(TOP)/sdks/builds/create-shared-library.sh $$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmono-native-compat.a $$@ -arch $(3) -miphoneos-version-min=7.0 $$(ios_sysroot) -L$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib -lmonosgen-2.0 -framework GSS
-
-$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmonosgen-2.0-minversion80.dylib: package-ios-$(1)
-	CC="$$(_ios-$(1)_CC)" $$(TOP)/sdks/builds/create-shared-library.sh $$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION)/lib/libmonosgen-2.0.a $$@ -arch $(3) -miphoneos-version-min=8.0 $$(ios_sysroot)
-
-endef
-
-ios_sysroot_path = $(XCODE_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_VERSION).sdk
-tvos_sysroot_path = $(XCODE_DIR)/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS$(TVOS_VERSION).sdk
-watchos_sysroot_path = $(XCODE_DIR)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCHOS_VERSION).sdk
-watchos64_32_sysroot_path = $(XCODE_DIR)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCHOS64_32_VERSION).sdk
-
-ios_sysroot = -isysroot $(ios_sysroot_path)
-tvos_sysroot = -isysroot $(tvos_sysroot_path)
-watchos_sysroot = -isysroot $(watchos_sysroot_path)
-watchos64_32_sysroot = -isysroot $(watchos64_32_sysroot_path)
-
-# --- CLASSIC ----
-# explicitly disable dtrace, since it requires inline assembly, which is disabled on AppleTV (and mono's configure.ac doesn't know that (yet at least))
-ios-targettv_CONFIGURE_FLAGS = 	--enable-dtrace=no --enable-llvm-runtime --with-bitcode=yes
-ios-targetwatch_CONFIGURE_FLAGS = --enable-cooperative-suspend --enable-llvm-runtime --with-bitcode=yes
-ios-targetwatch64_32_CONFIGURE_FLAGS = --enable-cooperative-suspend --enable-llvm-runtime --with-bitcode=yes
-
-ios-target32_SYSROOT = $(ios_sysroot) -miphoneos-version-min=$(IOS_VERSION_MIN)
-ios-target32s_SYSROOT = $(ios_sysroot) -miphoneos-version-min=$(IOS_VERSION_MIN)
-ios-target64_SYSROOT = $(ios_sysroot) -miphoneos-version-min=$(IOS_VERSION_MIN)
-ios-targettv_SYSROOT = $(tvos_sysroot) -mtvos-version-min=$(TVOS_VERSION_MIN)
-ios-targetwatch_SYSROOT = $(watchos_sysroot) -mwatchos-version-min=$(WATCHOS_VERSION_MIN)
-ios-targetwatch64_32_SYSROOT = $(watchos64_32_sysroot) -mwatchos-version-min=$(WATCHOS64_32_VERSION_MIN)
-
-ios-target32_CPPFLAGS = -DHOST_IOS
-ios-target32s_CPPFLAGS = -DHOST_IOS
-ios-target64_CPPFLAGS = -DHOST_IOS
-ios-targettv_CPPFLAGS = -DHOST_IOS -DHOST_TVOS
-ios-targetwatch_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
-ios-targetwatch64_32_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
-
-ios-targettv_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios-targettv_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios-targetwatch_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios-targetwatch_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios-targetwatch64_32_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios-targetwatch64_32_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-
-ios-targettv_LDFLAGS = -Wl,-bitcode_bundle -framework CoreFoundation -lobjc -lc++
-ios-targetwatch_LDFLAGS = -Wl,-bitcode_bundle -framework CoreFoundation -lobjc -lc++
-ios-targetwatch64_32_LDFLAGS = -Wl,-bitcode_bundle -framework CoreFoundation -lobjc -lc++
-
-ios-targettv_AC_VARS = \
-	ac_cv_func_system=no			\
-	ac_cv_func_pthread_kill=no      \
-	ac_cv_func_kill=no              \
-	ac_cv_func_sigaction=no         \
-	ac_cv_func_fork=no              \
-	ac_cv_func_execv=no             \
-	ac_cv_func_execve=no            \
-	ac_cv_func_execvp=no            \
-	ac_cv_func_signal=no
-ios-targetwatch_AC_VARS = $(ios-targettv_AC_VARS)
-ios-targetwatch64_32_AC_VARS = $(ios-targettv_AC_VARS)
-
-ifndef DISABLE_CLASSIC
-# ios-target32_BITCODE_MARKER=-fembed-bitcode-marker
-$(eval $(call iOSDeviceTemplate,target32,arm-apple-darwin10,armv7))
-$(eval $(call iOSDeviceTemplate,target32s,arm-apple-darwin10,armv7s))
-# ios-target64_BITCODE_MARKER=-fembed-bitcode-marker
-$(eval $(call iOSDeviceTemplate,target64,aarch64-apple-darwin10,arm64))
-$(eval $(call iOSDeviceTemplate,targettv,aarch64-apple-darwin10,arm64))
-$(eval $(call iOSDeviceTemplate,targetwatch,armv7k-apple-darwin10,armv7k))
-$(eval $(call iOSDeviceTemplate,targetwatch64_32,aarch64-apple-darwin10_ilp32,arm64_32))
-endif
-
-##
-# Simulator builds
-#
-# Parameters
-#  $(1): target (sim32 or sim64)
-#  $(2): host triple
-#  $(3): host arch (i386 or x86_64)
-#
-# Flags:
-#  ios-$(1)_SYSROOT
-#  ios-$(1)_AC_VARS
-#  ios-$(1)_CFLAGS
-#  ios-$(1)_CPPFLAGS
-#  ios-$(1)_CXXFLAGS
-#  ios-$(1)_LDFLAGS
-#
-# This handles tvos/watchos as well.
-#
-define iOSSimulatorTemplate
-
-_ios-$(1)_CC=$$(CCACHE) $$(ios_PLATFORM_BIN)/clang
-_ios-$(1)_CXX=$$(CCACHE) $$(ios_PLATFORM_BIN)/clang++
-
-_ios-$(1)_AC_VARS= \
-	ac_cv_func_clock_nanosleep=no \
-	ac_cv_func_fstatat=no \
-	ac_cv_func_readlinkat=no \
-	ac_cv_func_system=no \
-	ac_cv_func_getentropy=no \
-	ac_cv_func_futimens=no \
-	ac_cv_func_utimensat=no \
-	ac_cv_func_shm_open_working_with_mmap=no \
-	ac_cv_func_pthread_jit_write_protect_np=no \
-	ac_cv_func_preadv=no \
-	ac_cv_func_pwritev=no \
-	mono_cv_uscore=yes
-
-_ios-$(1)_CFLAGS= \
-	$$(ios-$(1)_SYSROOT) \
-	-arch $(3) \
-	-Wl,-application_extension
-
-_ios-$(1)_CPPFLAGS= \
-	-DMONOTOUCH=1 \
-	$$(ios-$(1)_SYSROOT) \
-	-arch $(3) \
-	-Wl,-application_extension
-
-_ios-$(1)_CXXFLAGS= \
-	$$(ios-$(1)_SYSROOT) \
-	-arch $(3) \
-	-Wl,-application_extension
-
-_ios-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-btls \
-	--disable-executables \
-	--disable-iconv \
-	--disable-mcs-build \
-	--disable-nls \
-	--disable-visibility-hidden \
-	--enable-maintainer-mode \
-	--enable-minimal=com,remoting,shared_perfcounters,gac \
-	--enable-monotouch \
-	--with-tls=pthread \
-	--without-ikvm-native \
-	--disable-cooperative-suspend \
-	--disable-hybrid-suspend \
-	--disable-crash-reporting
-
-.stamp-ios-$(1)-toolchain:
-	touch $$@
-
-$$(eval $$(call RuntimeTemplate,ios,$(1),$(2),yes))
-
-endef
-
-ios_sim_sysroot = -isysroot $(XCODE_DIR)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(IOS_VERSION).sdk 
-tvos_sim_sysroot = -isysroot $(XCODE_DIR)/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator$(TVOS_VERSION).sdk
-watchos_sim_sysroot = -isysroot $(XCODE_DIR)/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator$(WATCHOS_VERSION).sdk
-
-# --- CLASSIC ----
-ios-sim32_SYSROOT = $(ios_sim_sysroot) -mios-simulator-version-min=$(IOS_VERSION_MIN)
-ios-sim64_SYSROOT = $(ios_sim_sysroot) -mios-simulator-version-min=$(IOS_VERSION_MIN)
-ios-simtv_SYSROOT = $(tvos_sim_sysroot) -mtvos-simulator-version-min=$(TVOS_VERSION_MIN)
-ios-simwatch_SYSROOT = $(watchos_sim_sysroot) -mwatchos-simulator-version-min=$(WATCHOS_VERSION_MIN)
-ios-simwatch64_SYSROOT = $(watchos_sim_sysroot) -mwatchos-simulator-version-min=$(WATCHOS_VERSION_MIN)
-
-ios-simwatch_CONFIGURE_FLAGS = --enable-cooperative-suspend
-ios-simwatch64_CONFIGURE_FLAGS = --enable-cooperative-suspend
-
-ios-sim32_CPPFLAGS = -DHOST_IOS
-ios-sim64_CPPFLAGS = -DHOST_IOS
-ios-simtv_CPPFLAGS = -DHOST_IOS -DHOST_TVOS
-ios-simwatch_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
-ios-simwatch64_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
-
-ios-simtv_AC_VARS = \
-	ac_cv_func_pthread_kill=no \
-	ac_cv_func_kill=no \
-	ac_cv_func_sigaction=no \
-	ac_cv_func_fork=no \
-	ac_cv_func_execv=no \
-	ac_cv_func_execve=no \
-	ac_cv_func_execvp=no \
-	ac_cv_func_signal=no
-ios-simwatch_AC_VARS =  \
-	ac_cv_func_system=no \
-	ac_cv_func_pthread_kill=no \
-	ac_cv_func_kill=no \
-	ac_cv_func_sigaction=no \
-	ac_cv_func_fork=no \
-	ac_cv_func_execv=no \
-	ac_cv_func_execve=no \
-	ac_cv_func_execvp=no \
-	ac_cv_func_signal=no
-ios-simwatch64_AC_VARS =  \
-	ac_cv_func_system=no \
-	ac_cv_func_pthread_kill=no \
-	ac_cv_func_kill=no \
-	ac_cv_func_sigaction=no \
-	ac_cv_func_fork=no \
-	ac_cv_func_execv=no \
-	ac_cv_func_execve=no \
-	ac_cv_func_execvp=no \
-	ac_cv_func_signal=no
-
-
-ifndef DISABLE_CLASSIC
-$(eval $(call iOSSimulatorTemplate,sim32,i386-apple-darwin10,i386))
-$(eval $(call iOSSimulatorTemplate,sim64,x86_64-apple-darwin10,x86_64))
-$(eval $(call iOSSimulatorTemplate,simtv,x86_64-apple-darwin10,x86_64))
-$(eval $(call iOSSimulatorTemplate,simwatch,i386-apple-darwin10,i386))
-$(eval $(call iOSSimulatorTemplate,simwatch64,x86_64-apple-darwin10,x86_64))
-endif
-
-##
-# Cross compiler builds
-#
-# Parameters:
-#  $(1): target (cross32 or cross64)
-#  $(2): host arch (i386 or x86_64)
-#  $(3): target arch (arm or aarch64)
-#  $(4): device target (target32, target64, ...)
-#  $(5): llvm
-#  $(6): offsets dumper abi
-#  $(7): sysroot path
-#
-# Flags:
-#  ios-$(1)_AC_VARS
-#  ios-$(1)_CFLAGS
-#  ios-$(1)_CXXFLAGS
-#  ios-$(1)_LDFLAGS
-#  ios-$(1)_CONFIGURE_FLAGS
-define iOSCrossTemplate
-
-_ios-$(1)_OFFSETS_DUMPER_ARGS=--libclang="$$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" --sysroot="$(7)"
-_ios_$(1)_PLATFORM_BIN=$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin
-
-_ios-$(1)_CC=$$(CCACHE) $$(_ios_$(1)_PLATFORM_BIN)/clang
-_ios-$(1)_CXX=$$(CCACHE) $$(_ios_$(1)_PLATFORM_BIN)/clang++
-
-_ios-$(1)_AC_VARS= \
-	ac_cv_func_shm_open_working_with_mmap=no
-
-_ios-$(1)_CFLAGS= \
-	$$(ios-$(1)_SYSROOT) \
-	-Qunused-arguments
-
-_ios-$(1)_CXXFLAGS= \
-	$$(ios-$(1)_SYSROOT) \
-	-Qunused-arguments \
-	-stdlib=libc++
-
-_ios-$(1)_CPPFLAGS= \
-	-DMONOTOUCH=1
-
-_ios-$(1)_LDFLAGS= \
-	-stdlib=libc++
-
-_ios-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-btls \
-	--disable-iconv \
-	--disable-libraries \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-dtrace=no \
-	--enable-icall-symbol-map \
-	--enable-minimal=com,remoting \
-	--enable-monotouch \
-	--disable-crash-reporting
-
-$$(eval $$(call CrossRuntimeTemplate,ios,$(1),$(2)-apple-darwin10,$(3),$(4),$(5),$(6)))
-
-endef
-
-# --- CLASSIC ----
-ios-cross32_SYSROOT=-isysroot $(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_VERSION).sdk -mmacosx-version-min=$(MACOS_VERSION_MIN)
-ios-crosswatch_SYSROOT=-isysroot $(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_VERSION).sdk -mmacosx-version-min=$(MACOS_VERSION_MIN)
-ios-cross64_SYSROOT=-isysroot $(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_VERSION).sdk -mmacosx-version-min=$(MACOS_VERSION_MIN)
-ios-crosswatch64_32_SYSROOT=-isysroot $(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_VERSION).sdk -mmacosx-version-min=$(MACOS_VERSION_MIN)
-
-ios-crosswatch_CONFIGURE_FLAGS=--enable-cooperative-suspend
-
-ifndef DISABLE_CLASSIC
-$(eval $(call iOSCrossTemplate,cross32,x86_64,arm-darwin,target32,llvm-llvm64,arm-apple-darwin10,$(ios_sysroot_path)))
-$(eval $(call iOSCrossTemplate,cross64,x86_64,aarch64-darwin,target64,llvm-llvm64,aarch64-apple-darwin10,$(ios_sysroot_path)))
-$(eval $(call iOSCrossTemplate,crosswatch,x86_64,armv7k-unknown-darwin,targetwatch,llvm-llvm64,armv7k-apple-darwin,$(watchos_sysroot_path)))
-$(eval $(call iOSCrossTemplate,crosswatch64_32,x86_64,aarch64-apple-darwin10_ilp32,targetwatch64_32,llvm-llvm64,aarch64-apple-darwin10_ilp32,$(watchos64_32_sysroot_path)))
-endif
-
-$(ios_FRAMEWORKS_DIR): package-ios-target32 package-ios-target32s package-ios-target64 package-ios-targettv package-ios-targetwatch package-ios-targetwatch64_32 package-ios-sim32 package-ios-sim64 package-ios-simtv package-ios-simwatch package-ios-simwatch64 $(TOP)/sdks/builds/ios-Mono.framework-Info.plist $(TOP)/sdks/builds/ios-Mono.framework-tvos.Info.plist $(TOP)/sdks/builds/ios-Mono.framework-watchos.Info.plist $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion80.dylib $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion80.dylib $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion80.dylib
-	rm -rf $(ios_FRAMEWORKS_DIR)
-
-	### Mono.framework for devices ###
-	mkdir -p $(ios_FRAMEWORKS_DIR)/ios/Mono.framework/
-	mkdir -p $(ios_FRAMEWORKS_DIR)/tvos/Mono.framework/
-	mkdir -p $(ios_FRAMEWORKS_DIR)/watchos/Mono.framework/
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion80.dylib $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion80.dylib $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion80.dylib -create -output $(ios_FRAMEWORKS_DIR)/ios/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib -create -output $(ios_FRAMEWORKS_DIR)/tvos/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib -create -output $(ios_FRAMEWORKS_DIR)/watchos/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/Mono.framework/Mono $(ios_FRAMEWORKS_DIR)/ios/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/Mono.framework/Mono $(ios_FRAMEWORKS_DIR)/tvos/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/Mono.framework/Mono $(ios_FRAMEWORKS_DIR)/watchos/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_FRAMEWORKS_DIR)/ios/Mono.framework.dSYM $(ios_FRAMEWORKS_DIR)/ios/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_FRAMEWORKS_DIR)/tvos/Mono.framework.dSYM $(ios_FRAMEWORKS_DIR)/tvos/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_FRAMEWORKS_DIR)/watchos/Mono.framework.dSYM $(ios_FRAMEWORKS_DIR)/watchos/Mono.framework/Mono
-	cp $(TOP)/sdks/builds/ios-Mono.framework-Info.plist $(ios_FRAMEWORKS_DIR)/ios/Mono.framework/Info.plist
-	cp $(TOP)/sdks/builds/ios-Mono.framework-tvos.Info.plist $(ios_FRAMEWORKS_DIR)/tvos/Mono.framework/Info.plist
-	cp $(TOP)/sdks/builds/ios-Mono.framework-watchos.Info.plist $(ios_FRAMEWORKS_DIR)/watchos/Mono.framework/Info.plist
-
-	### Mono.framework for simulators ###
-	mkdir -p $(ios_FRAMEWORKS_DIR)/ios-sim/Mono.framework/
-	mkdir -p $(ios_FRAMEWORKS_DIR)/tvos-sim/Mono.framework/
-	mkdir -p $(ios_FRAMEWORKS_DIR)/watchos-sim/Mono.framework/
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib -create -output $(ios_FRAMEWORKS_DIR)/ios-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib -create -output $(ios_FRAMEWORKS_DIR)/tvos-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib -create -output $(ios_FRAMEWORKS_DIR)/watchos-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/Mono.framework/Mono $(ios_FRAMEWORKS_DIR)/ios-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/Mono.framework/Mono $(ios_FRAMEWORKS_DIR)/tvos-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/Mono.framework/Mono $(ios_FRAMEWORKS_DIR)/watchos-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_FRAMEWORKS_DIR)/ios-sim/Mono.framework.dSYM $(ios_FRAMEWORKS_DIR)/ios-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_FRAMEWORKS_DIR)/tvos-sim/Mono.framework.dSYM $(ios_FRAMEWORKS_DIR)/tvos-sim/Mono.framework/Mono
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_FRAMEWORKS_DIR)/watchos-sim/Mono.framework.dSYM $(ios_FRAMEWORKS_DIR)/watchos-sim/Mono.framework/Mono
-	cp $(TOP)/sdks/builds/ios-Mono.framework-Info.plist $(ios_FRAMEWORKS_DIR)/ios-sim/Mono.framework/Info.plist
-	cp $(TOP)/sdks/builds/ios-Mono.framework-tvos.Info.plist $(ios_FRAMEWORKS_DIR)/tvos-sim/Mono.framework/Info.plist
-	cp $(TOP)/sdks/builds/ios-Mono.framework-watchos.Info.plist $(ios_FRAMEWORKS_DIR)/watchos-sim/Mono.framework/Info.plist
-
-
-$(ios_LIBS_DIR): package-ios-target32 package-ios-target32s package-ios-target64 package-ios-targettv package-ios-targetwatch package-ios-targetwatch64_32 package-ios-sim32 package-ios-sim64 package-ios-simtv package-ios-simwatch package-ios-simwatch64 $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion70.dylib $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion70.dylib $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion70.dylib $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-profiler-log-minversion70.dylib $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-profiler-log-minversion70.dylib $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-profiler-log-minversion70.dylib $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-native-compat-minversion70.dylib $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-native-compat-minversion70.dylib $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-native-compat-minversion70.dylib
-	rm -rf $(ios_LIBS_DIR)
-
-	### libs for devices ###
-	mkdir -p $(ios_LIBS_DIR)/ios/
-	mkdir -p $(ios_LIBS_DIR)/tvos/
-	mkdir -p $(ios_LIBS_DIR)/watchos/
-
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion70.dylib       $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion70.dylib       $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0-minversion70.dylib       -create -output $(ios_LIBS_DIR)/ios/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-profiler-log-minversion70.dylib  $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-profiler-log-minversion70.dylib  $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-profiler-log-minversion70.dylib  -create -output $(ios_LIBS_DIR)/ios/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-native-compat-minversion70.dylib $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-native-compat-minversion70.dylib $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-native-compat-minversion70.dylib -create -output $(ios_LIBS_DIR)/ios/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-native-unified.dylib             $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-native-unified.dylib             $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-native-unified.dylib             -create -output $(ios_LIBS_DIR)/ios/libmono-native-unified.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-ee-interp.a                      $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-ee-interp.a                      $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-ee-interp.a                      -create -output $(ios_LIBS_DIR)/ios/libmono-ee-interp.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-icall-table.a                    $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-icall-table.a                    $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-icall-table.a                    -create -output $(ios_LIBS_DIR)/ios/libmono-icall-table.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-ilgen.a                          $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-ilgen.a                          $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-ilgen.a                          -create -output $(ios_LIBS_DIR)/ios/libmono-ilgen.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-native-compat.a                  $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-native-compat.a                  $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-native-compat.a                  -create -output $(ios_LIBS_DIR)/ios/libmono-native-compat.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-native-unified.a                 $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-native-unified.a                 $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-native-unified.a                 -create -output $(ios_LIBS_DIR)/ios/libmono-native-unified.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmono-profiler-log-static.a            $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmono-profiler-log-static.a            $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmono-profiler-log-static.a            -create -output $(ios_LIBS_DIR)/ios/libmono-profiler-log.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0.a                        $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0.a                        $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0.a                        -create -output $(ios_LIBS_DIR)/ios/libmonosgen-2.0.a
-
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib          -create -output $(ios_LIBS_DIR)/tvos/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-profiler-log.dylib     -create -output $(ios_LIBS_DIR)/tvos/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-native-compat.dylib    -create -output $(ios_LIBS_DIR)/tvos/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-native-unified.dylib   -create -output $(ios_LIBS_DIR)/tvos/libmono-native-unified.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-ee-interp.a            -create -output $(ios_LIBS_DIR)/tvos/libmono-ee-interp.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-icall-table.a          -create -output $(ios_LIBS_DIR)/tvos/libmono-icall-table.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-ilgen.a                -create -output $(ios_LIBS_DIR)/tvos/libmono-ilgen.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-native-compat.a        -create -output $(ios_LIBS_DIR)/tvos/libmono-native-compat.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-native-unified.a       -create -output $(ios_LIBS_DIR)/tvos/libmono-native-unified.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmono-profiler-log-static.a  -create -output $(ios_LIBS_DIR)/tvos/libmono-profiler-log.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmonosgen-2.0.a              -create -output $(ios_LIBS_DIR)/tvos/libmonosgen-2.0.a
-
-	$(ios_PLATFORM_BIN)/bitcode_strip $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib               -m -o $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0-stripped.dylib
-	$(ios_PLATFORM_BIN)/bitcode_strip $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-profiler-log.dylib          -m -o $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-profiler-log-stripped.dylib
-	$(ios_PLATFORM_BIN)/bitcode_strip $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-compat.dylib         -m -o $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-compat-stripped.dylib
-	$(ios_PLATFORM_BIN)/bitcode_strip $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-unified.dylib        -m -o $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-unified-stripped.dylib
-	$(ios_PLATFORM_BIN)/bitcode_strip $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib          -m -o $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmonosgen-2.0-stripped.dylib
-	$(ios_PLATFORM_BIN)/bitcode_strip $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-profiler-log.dylib     -m -o $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-profiler-log-stripped.dylib
-	$(ios_PLATFORM_BIN)/bitcode_strip $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-native.dylib           -m -o $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-native-stripped.dylib
-
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0-stripped.dylib         $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmonosgen-2.0-stripped.dylib        -create -output $(ios_LIBS_DIR)/watchos/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-profiler-log-stripped.dylib    $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-profiler-log-stripped.dylib   -create -output $(ios_LIBS_DIR)/watchos/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-compat-stripped.dylib                                                                                                   -create -output $(ios_LIBS_DIR)/watchos/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-unified-stripped.dylib  $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-native-stripped.dylib         -create -output $(ios_LIBS_DIR)/watchos/libmono-native-unified.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-ee-interp.a                    $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-ee-interp.a                   -create -output $(ios_LIBS_DIR)/watchos/libmono-ee-interp.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-icall-table.a                  $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-icall-table.a                 -create -output $(ios_LIBS_DIR)/watchos/libmono-icall-table.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-ilgen.a                        $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-ilgen.a                       -create -output $(ios_LIBS_DIR)/watchos/libmono-ilgen.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-compat.a                                                                                                                -create -output $(ios_LIBS_DIR)/watchos/libmono-native-compat.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-native-unified.a               $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-native.a                      -create -output $(ios_LIBS_DIR)/watchos/libmono-native-unified.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmono-profiler-log-static.a          $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmono-profiler-log-static.a         -create -output $(ios_LIBS_DIR)/watchos/libmono-profiler-log.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.a                      $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmonosgen-2.0.a                     -create -output $(ios_LIBS_DIR)/watchos/libmonosgen-2.0.a
-
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(ios_LIBS_DIR)/ios/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-profiler-log.dylib   -change $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/ios/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-compat.dylib  -change $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/ios/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-unified.dylib -change $(TOP)/sdks/out/ios-target32-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-target32s-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-target64-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/ios/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(ios_LIBS_DIR)/tvos/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-profiler-log.dylib   -change $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/tvos/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-compat.dylib  -change $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/tvos/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-unified.dylib -change $(TOP)/sdks/out/ios-targettv-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/tvos/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(ios_LIBS_DIR)/watchos/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-profiler-log.dylib   -change $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/watchos/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-compat.dylib  -change $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib                                                                                                                        $(ios_LIBS_DIR)/watchos/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-unified.dylib -change $(TOP)/sdks/out/ios-targetwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib -change $(TOP)/sdks/out/ios-targetwatch64_32-$(CONFIGURATION)/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $(ios_LIBS_DIR)/watchos/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios/libmonosgen-2.0.dylib.dSYM        $(ios_LIBS_DIR)/ios/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios/libmono-profiler-log.dylib.dSYM   $(ios_LIBS_DIR)/ios/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios/libmono-native-compat.dylib.dSYM  $(ios_LIBS_DIR)/ios/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios/libmono-native-unified.dylib.dSYM $(ios_LIBS_DIR)/ios/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos/libmonosgen-2.0.dylib.dSYM        $(ios_LIBS_DIR)/tvos/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos/libmono-profiler-log.dylib.dSYM   $(ios_LIBS_DIR)/tvos/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos/libmono-native-compat.dylib.dSYM  $(ios_LIBS_DIR)/tvos/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos/libmono-native-unified.dylib.dSYM $(ios_LIBS_DIR)/tvos/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos/libmonosgen-2.0.dylib.dSYM        $(ios_LIBS_DIR)/watchos/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos/libmono-profiler-log.dylib.dSYM   $(ios_LIBS_DIR)/watchos/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos/libmono-native-compat.dylib.dSYM  $(ios_LIBS_DIR)/watchos/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos/libmono-native-unified.dylib.dSYM $(ios_LIBS_DIR)/watchos/libmono-native-unified.dylib
-
-	### libs for simulators ###
-	mkdir -p $(ios_LIBS_DIR)/ios-sim/
-	mkdir -p $(ios_LIBS_DIR)/tvos-sim/
-	mkdir -p $(ios_LIBS_DIR)/watchos-sim/
-
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib          $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib         -create -output $(ios_LIBS_DIR)/ios-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmono-profiler-log.dylib     $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmono-profiler-log.dylib    -create -output $(ios_LIBS_DIR)/ios-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmono-native-compat.dylib    $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmono-native-compat.dylib   -create -output $(ios_LIBS_DIR)/ios-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmono-native-unified.dylib   $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmono-native-unified.dylib  -create -output $(ios_LIBS_DIR)/ios-sim/libmono-native-unified.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmono-native-compat.a        $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmono-native-compat.a       -create -output $(ios_LIBS_DIR)/ios-sim/libmono-native-compat.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmono-native-unified.a       $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmono-native-unified.a      -create -output $(ios_LIBS_DIR)/ios-sim/libmono-native-unified.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmono-profiler-log-static.a  $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmono-profiler-log-static.a -create -output $(ios_LIBS_DIR)/ios-sim/libmono-profiler-log.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-sim32-$(CONFIGURATION)/lib/libmonosgen-2.0.a              $(TOP)/sdks/out/ios-sim64-$(CONFIGURATION)/lib/libmonosgen-2.0.a             -create -output $(ios_LIBS_DIR)/ios-sim/libmonosgen-2.0.a
-
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib          -create -output $(ios_LIBS_DIR)/tvos-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmono-profiler-log.dylib     -create -output $(ios_LIBS_DIR)/tvos-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmono-native-compat.dylib    -create -output $(ios_LIBS_DIR)/tvos-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmono-native-unified.dylib   -create -output $(ios_LIBS_DIR)/tvos-sim/libmono-native-unified.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmono-native-compat.a        -create -output $(ios_LIBS_DIR)/tvos-sim/libmono-native-compat.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmono-native-unified.a       -create -output $(ios_LIBS_DIR)/tvos-sim/libmono-native-unified.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmono-profiler-log-static.a  -create -output $(ios_LIBS_DIR)/tvos-sim/libmono-profiler-log.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simtv-$(CONFIGURATION)/lib/libmonosgen-2.0.a              -create -output $(ios_LIBS_DIR)/tvos-sim/libmonosgen-2.0.a
-
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib         $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib         -create -output $(ios_LIBS_DIR)/watchos-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmono-profiler-log.dylib    $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmono-profiler-log.dylib    -create -output $(ios_LIBS_DIR)/watchos-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmono-native-compat.dylib   $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmono-native-compat.dylib   -create -output $(ios_LIBS_DIR)/watchos-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmono-native-unified.dylib  $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmono-native-unified.dylib  -create -output $(ios_LIBS_DIR)/watchos-sim/libmono-native-unified.dylib
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmono-native-compat.a       $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmono-native-compat.a       -create -output $(ios_LIBS_DIR)/watchos-sim/libmono-native-compat.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmono-native-unified.a      $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmono-native-unified.a      -create -output $(ios_LIBS_DIR)/watchos-sim/libmono-native-unified.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmono-profiler-log-static.a $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmono-profiler-log-static.a -create -output $(ios_LIBS_DIR)/watchos-sim/libmono-profiler-log.a
-	$(ios_PLATFORM_BIN)/lipo $(TOP)/sdks/out/ios-simwatch-$(CONFIGURATION)/lib/libmonosgen-2.0.a             $(TOP)/sdks/out/ios-simwatch64-$(CONFIGURATION)/lib/libmonosgen-2.0.a             -create -output $(ios_LIBS_DIR)/watchos-sim/libmonosgen-2.0.a
-
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(ios_LIBS_DIR)/ios-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-profiler-log.dylib   $(ios_LIBS_DIR)/ios-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-compat.dylib  $(ios_LIBS_DIR)/ios-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-unified.dylib $(ios_LIBS_DIR)/ios-sim/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(ios_LIBS_DIR)/tvos-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-profiler-log.dylib   $(ios_LIBS_DIR)/tvos-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-compat.dylib  $(ios_LIBS_DIR)/tvos-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-unified.dylib $(ios_LIBS_DIR)/tvos-sim/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(ios_LIBS_DIR)/watchos-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-profiler-log.dylib   $(ios_LIBS_DIR)/watchos-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-compat.dylib  $(ios_LIBS_DIR)/watchos-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-unified.dylib $(ios_LIBS_DIR)/watchos-sim/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios-sim/libmonosgen-2.0.dylib.dSYM        $(ios_LIBS_DIR)/ios-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios-sim/libmono-profiler-log.dylib.dSYM   $(ios_LIBS_DIR)/ios-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios-sim/libmono-native-compat.dylib.dSYM  $(ios_LIBS_DIR)/ios-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/ios-sim/libmono-native-unified.dylib.dSYM $(ios_LIBS_DIR)/ios-sim/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos-sim/libmonosgen-2.0.dylib.dSYM        $(ios_LIBS_DIR)/tvos-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos-sim/libmono-profiler-log.dylib.dSYM   $(ios_LIBS_DIR)/tvos-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos-sim/libmono-native-compat.dylib.dSYM  $(ios_LIBS_DIR)/tvos-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/tvos-sim/libmono-native-unified.dylib.dSYM $(ios_LIBS_DIR)/tvos-sim/libmono-native-unified.dylib
-
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos-sim/libmonosgen-2.0.dylib.dSYM        $(ios_LIBS_DIR)/watchos-sim/libmonosgen-2.0.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos-sim/libmono-profiler-log.dylib.dSYM   $(ios_LIBS_DIR)/watchos-sim/libmono-profiler-log.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos-sim/libmono-native-compat.dylib.dSYM  $(ios_LIBS_DIR)/watchos-sim/libmono-native-compat.dylib
-	$(ios_PLATFORM_BIN)/dsymutil -num-threads 4 -o $(ios_LIBS_DIR)/watchos-sim/libmono-native-unified.dylib.dSYM $(ios_LIBS_DIR)/watchos-sim/libmono-native-unified.dylib
-
-$(ios_SOURCES_DIR)/mcs/build/common/Consts.cs:  # we use this as a sentinel file to avoid rsyncing everything on each build (slows down iterating)
-	mkdir -p $(ios_SOURCES_DIR)
-	cd $(TOP) && rsync -r --exclude='external/api-doc-tools/*' --exclude='external/api-snapshot/*' --exclude='external/aspnetwebstack/*' --exclude='external/binary-reference-assemblies/*' --include='*.cs' --include='*/' --exclude="*" --prune-empty-dirs . $(ios_SOURCES_DIR)
-
-$(ios_SOURCES_DIR): $(ios_SOURCES_DIR)/mcs/build/common/Consts.cs
-
-$(ios_TPN_DIR)/LICENSE:
-	mkdir -p $(ios_TPN_DIR)
-	cd $(TOP) && rsync -r --include='THIRD-PARTY-NOTICES.TXT' --include='license.txt' --include='License.txt' --include='LICENSE' --include='LICENSE.txt' --include='LICENSE.TXT' --include='COPYRIGHT.regex' --include='*/' --exclude="*" --prune-empty-dirs . $(ios_TPN_DIR)
-
-$(ios_TPN_DIR): $(ios_TPN_DIR)/LICENSE
-
-$(ios_MONO_VERSION): $(TOP)/configure.ac
-	mkdir -p $(dir $(ios_MONO_VERSION))
-	grep AC_INIT $(TOP)/configure.ac | sed -e 's/.*\[//' -e 's/\].*//' > $@
-
-##
-# BCL builds
-##
-ifndef DISABLE_CLASSIC
-$(eval $(call BclTemplate,ios,monotouch monotouch_runtime monotouch_tv monotouch_tv_runtime monotouch_watch monotouch_watch_runtime monotouch_tools,monotouch monotouch_tv monotouch_watch))
-endif

+ 0 - 156
sdks/builds/llvm.mk

@@ -1,156 +0,0 @@
-
-##
-# Parameters
-#  $(1): version
-#  $(2): target
-#  $(3): src
-define LLVMProvisionTemplate
-_$(1)-$(2)_HASH = $$(shell git -C $(3) rev-parse HEAD)
-_$(1)-$(2)_PACKAGE = $(1)-$(2)-$$(_$(1)-$(2)_HASH)-$$(UNAME).tar.gz
-_$(1)-$(2)_URL = "https://xamjenkinsartifact.blob.core.windows.net/mono-sdks/$$(_$(1)-$(2)_PACKAGE)"
-
-$$(TOP)/sdks/out/$(1)-$(2)/.stamp-download:
-	curl --location --silent --show-error $$(_$(1)-$(2)_URL) | tar -xvzf - -C $$(dir $$@)
-	touch $$@
-
-.PHONY: download-$(1)-$(2)
-download-$(1)-$(2): | $(3) setup-$(1)-$(2)
-	-$$(MAKE) $$(TOP)/sdks/out/$(1)-$(2)/.stamp-download
-
-.PHONY: provision-$(1)-$(2)
-provision-$(1)-$(2): | $(3) download-$(1)-$(2)
-	$$(if $$(wildcard $$(TOP)/sdks/out/$(1)-$(2)/.stamp-download),,$$(MAKE) package-$(1)-$(2))
-
-.PHONY: archive-$(1)-$(2)
-archive-$(1)-$(2): package-$(1)-$(2)
-	tar -cvzf $$(TOP)/$$(_$(1)-$(2)_PACKAGE) -C $$(TOP)/sdks/out/$(1)-$(2) .
-endef
-
-$(eval $(call LLVMProvisionTemplate,llvm,llvm64,$(TOP)/external/llvm-project/llvm))
-$(eval $(call LLVMProvisionTemplate,llvm,llvmwin64,$(TOP)/external/llvm-project/llvm))
-ifeq ($(UNAME),Windows)
-$(eval $(call LLVMProvisionTemplate,llvm,llvmwin64-msvc,$(TOP)/external/llvm-project/llvm))
-endif
-
-##
-# Parameters
-#  $(1): target
-define LLVMTemplate
-
-_llvm-$(1)_CMAKE_ARGS = \
-	$$(llvm-$(1)_CMAKE_ARGS)
-
-.PHONY: setup-llvm-$(1)
-setup-llvm-$(1):
-	mkdir -p $$(TOP)/sdks/out/llvm-$(1)
-
-.PHONY: package-llvm-$(1)
-package-llvm-$(1): setup-llvm-$(1)
-	$$(MAKE) -C $$(TOP)/llvm -f build.mk install-llvm \
-		LLVM_BUILD="$$(TOP)/sdks/builds/llvm-$(1)" \
-		LLVM_PREFIX="$$(TOP)/sdks/out/llvm-$(1)" \
-		LLVM_CMAKE_ARGS="$$(_llvm-$(1)_CMAKE_ARGS)"
-
-.PHONY: clean-llvm-$(1)
-clean-llvm-$(1)::
-	$$(MAKE) -C $$(TOP)/llvm -f build.mk clean-llvm \
-		LLVM_BUILD="$$(TOP)/sdks/builds/llvm-$(1)" \
-		LLVM_PREFIX="$$(TOP)/sdks/out/llvm-$(1)"
-
-endef
-
-##
-# Parameters:
-#  $(1): target
-define LLVMTemplateStub
-
-.PHONY: setup-llvm-$(1)
-setup-llvm-$(1):
-	@echo "TODO: setup-llvm-$(1) on $(NAME)"
-
-.PHONY: package-llvm-$(1)
-package-llvm-$(1):
-	@echo "TODO: package-llvm-$(1) on $(UNAME)"
-
-.PHONY: clean-llvm-$(1)
-clean-llvm-$(1)::
-	@echo "TODO: clean-llvm-$(1) on $(UNAME)"
-
-endef
-
-$(eval $(call LLVMTemplate,llvm64))
-
-##
-# Parameters
-#  $(1): target
-#  $(2): arch
-#  $(3): mxe
-define LLVMMxeTemplate
-
-# -DCROSS_TOOLCHAIN_FLAGS_NATIVE is needed to compile the native tools (tlbgen) using the host compilers
-# -DLLVM_ENABLE_THREADS=0 is needed because mxe doesn't define std::mutex etc.
-# -DLLVM_BUILD_EXECUTION_ENGINE=Off is needed because it depends on threads
-# -DCMAKE_EXE_LINKER_FLAGS=-static is needed so that we don't dynamically link with any of the mingw gcc support libs.
-_llvm-$(1)_CMAKE_ARGS = \
-	-DCMAKE_EXE_LINKER_FLAGS=\"-static\" \
-	-DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_TOOLCHAIN_FILE=$$(TOP)/external/llvm-project/llvm/cmake/modules/NATIVE.cmake \
-	-DCMAKE_TOOLCHAIN_FILE=$$(TOP)/external/llvm-project/llvm/cmake/modules/$(3).cmake \
-	-DLLVM_ENABLE_THREADS=Off \
-	-DLLVM_BUILD_EXECUTION_ENGINE=Off \
-	$$(llvm-$(1)_CMAKE_ARGS)
-
-ifeq ($(UNAME),Darwin)
-_llvm-$(1)_CMAKE_ARGS += \
-	-DZLIB_ROOT=$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32 -DZLIB_LIBRARY=$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/lib/libz.a -DZLIB_INCLUDE_DIR=$$(MXE_PREFIX)/opt/mingw-zlib/usr/$(2)-w64-mingw32/include
-endif
-
-$$(TOP)/external/llvm-project/llvm/cmake/modules/$(3).cmake: $(3).cmake.in
-	sed -e 's,@MXE_PATH@,$$(MXE_PREFIX),' < $$< > $$@
-
-.PHONY: setup-llvm-$(1)
-setup-llvm-$(1):
-	mkdir -p $$(TOP)/sdks/out/llvm-$(1)
-
-.PHONY: package-llvm-$(1)
-package-llvm-$(1): $$(TOP)/external/llvm-project/llvm/cmake/modules/$(3).cmake setup-llvm-$(1)
-	$$(MAKE) -C $$(TOP)/llvm -f build.mk install-llvm \
-		CPU_COUNT=1 \
-		LLVM_BUILD="$$(TOP)/sdks/builds/llvm-$(1)" \
-		LLVM_PREFIX="$$(TOP)/sdks/out/llvm-$(1)" \
-		LLVM_CMAKE_ARGS="$$(_llvm-$(1)_CMAKE_ARGS)"
-
-.PHONY: clean-llvm-$(1)
-clean-llvm-$(1)::
-	$$(MAKE) -C $$(TOP)/llvm -f build.mk clean-llvm \
-		LLVM_BUILD="$$(TOP)/sdks/builds/llvm-$(1)" \
-		LLVM_PREFIX="$$(TOP)/sdks/out/llvm-$(1)"
-
-endef
-
-ifneq ($(MXE_PREFIX),)
-$(eval $(call LLVMMxeTemplate,llvmwin64,x86_64,mxe-Win64))
-endif
-
-##
-# Parameters
-#  $(1): target
-#  $(2): arch
-define LLVMMsvcTemplate
-
-.PHONY: setup-llvm-$(1)
-setup-llvm-$(1):
-	mkdir -p $$(TOP)/sdks/out/llvm-$(1)
-
-.PHONY: package-llvm-$(1)
-package-llvm-$(1): setup-llvm-$(1)
-	$$(TOP)/llvm/build_llvm_msbuild.sh "build" "$(2)" "release" "$$(TOP)/msvc/" "$$(TOP)/sdks/builds/llvm-$(1)" "$$(TOP)/sdks/out/llvm-$(1)"
-
-.PHONY: clean-llvm-$(1)
-clean-llvm-$(1):
-	$$(TOP)/llvm/build_llvm_msbuild.sh "clean" "$(2)" "release" "$$(TOP)/msvc/" "$$(TOP)/sdks/builds/llvm-$(1)" "$$(TOP)/sdks/out/llvm-$(1)"
-
-endef
-
-ifeq ($(UNAME),Windows)
-$(eval $(call LLVMMsvcTemplate,llvmwin64-msvc,x86_64))
-endif

+ 0 - 182
sdks/builds/mac.mk

@@ -1,182 +0,0 @@
-
-mac_BIN_DIR = $(TOP)/sdks/out/mac-bin
-mac_PKG_CONFIG_DIR = $(TOP)/sdks/out/mac-pkgconfig
-mac_LIBS_DIR = $(TOP)/sdks/out/mac-libs
-mac_TPN_DIR = $(TOP)/sdks/out/mac-tpn
-mac_MONO_VERSION = $(TOP)/sdks/out/mac-mono-version.txt
-
-mac_ARCHIVE += mac-bin mac-pkgconfig mac-libs mac-tpn mac-mono-version.txt
-ADDITIONAL_PACKAGE_DEPS += $(mac_BIN_DIR) $(mac_PKG_CONFIG_DIR) $(mac_LIBS_DIR) $(mac_TPN_DIR) $(mac_MONO_VERSION)
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): host arch for compiler (x86_64 or arm64)
-#  $(4): xcode dir
-define MacTemplate
-
-mac_$(1)_PLATFORM_BIN=$(4)/Toolchains/XcodeDefault.xctoolchain/usr/bin
-
-_mac-$(1)_CC=$$(CCACHE) $$(mac_$(1)_PLATFORM_BIN)/clang
-_mac-$(1)_CXX=$$(CCACHE) $$(mac_$(1)_PLATFORM_BIN)/clang++
-
-_mac-$(1)_AC_VARS= \
-	ac_cv_func_fstatat=no \
-	ac_cv_func_readlinkat=no \
-	ac_cv_func_futimens=no \
-	ac_cv_func_utimensat=no
-
-_mac-$(1)_CFLAGS= \
-	$$(mac-$(1)_SYSROOT) \
-	-arch $(3)
-
-_mac-$(1)_CXXFLAGS= \
-	$$(mac-$(1)_SYSROOT) \
-	-arch $(3)
-
-_mac-$(1)_CPPFLAGS=
-
-_mac-$(1)_LDFLAGS=
-
-# Xcode 12 and later cause issues with no_weak_imports: https://github.com/mono/mono/issues/19393
-ifeq ($(XCODE_MAJOR_VERSION),$(filter $(XCODE_MAJOR_VERSION), 11 10 9))
-_mac-$(1)_LDFLAGS += -Wl,-no_weak_imports
-endif
-
-_mac-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-btls \
-	--disable-iconv \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-maintainer-mode \
-	--with-glib=embedded \
-	--with-mcs-docs=no
-
-.stamp-mac-$(1)-toolchain:
-	touch $$@
-
-$$(eval $$(call RuntimeTemplate,mac,$(1),$(2)-apple-darwin10,yes))
-
-endef
-
-##
-# Cross compiler builds
-#
-# Parameters:
-#  $(1): target (crossarm64)
-#  $(2): host arch (x86_64 or aarch64)
-#  $(3): target arch (arm or aarch64)
-#  $(4): device target (target64, targetarm64 ...)
-#  $(5): llvm
-#  $(6): offsets dumper abi
-#  $(7): sysroot path
-#
-# Flags:
-#  mac-$(1)_AC_VARS
-#  mac-$(1)_CFLAGS
-#  mac-$(1)_CXXFLAGS
-#  mac-$(1)_LDFLAGS
-#  mac-$(1)_CONFIGURE_FLAGS
-define MacCrossTemplate
-
-_mac-$(1)_OFFSETS_DUMPER_ARGS=--libclang="$$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" --sysroot="$(7)"
-_mac_$(1)_PLATFORM_BIN=$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin
-
-_mac-$(1)_CC=$$(CCACHE) $$(_mac_$(1)_PLATFORM_BIN)/clang
-_mac-$(1)_CXX=$$(CCACHE) $$(_mac_$(1)_PLATFORM_BIN)/clang++
-
-_mac-$(1)_AC_VARS= \
-	ac_cv_func_fstatat=no \
-	ac_cv_func_readlinkat=no \
-	ac_cv_func_futimens=no \
-	ac_cv_func_utimensat=no
-
-_mac-$(1)_CFLAGS= \
-	$$(mac-$(1)_SYSROOT) \
-	-arch $(2) \
-	-Qunused-arguments
-
-_mac-$(1)_CXXFLAGS= \
-	$$(mac-$(1)_SYSROOT) \
-	-arch $(2) \
-	-Qunused-arguments \
-	-stdlib=libc++
-
-_mac-$(1)_CPPFLAGS= \
-	-arch $(2) \
-
-_mac-$(1)_LDFLAGS= \
-	-stdlib=libc++
-
-_mac-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-btls \
-	--disable-iconv \
-	--disable-mcs-build \
-	--disable-nls \
-	--enable-dtrace=no \
-	--enable-maintainer-mode \
-	--with-glib=embedded \
-	--with-mcs-docs=no
-
-$$(eval $$(call CrossRuntimeTemplate,mac,$(1),$(2)-apple-darwin20,$(3),$(4),$(5),$(6)))
-
-endef
-
-mac_sysroot_path = $(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_VERSION).sdk
-mac_sysroot = -isysroot $(mac_sysroot_path)
-
-mac-mac64_SYSROOT=$(mac_sysroot) -mmacosx-version-min=$(MACOS_VERSION_MIN)
-mac-macarm64_SYSROOT=$(mac_sysroot) -mmacosx-version-min=$(MACOS_VERSION_MIN)
-
-mac-crossarm64_SYSROOT=$(mac_sysroot) -mmacosx-version-min=$(MACOS_VERSION_MIN)
-
-$(eval $(call MacTemplate,mac64,x86_64,x86_64,$(XCODE_DIR)))
-$(eval $(call MacTemplate,macarm64,aarch64,arm64,$(XCODE_DIR)))
-
-$(eval $(call MacCrossTemplate,crossarm64,x86_64,aarch64-apple-darwin20.0.0,macarm64,llvm-llvm64,aarch64-apple-darwin20,$(mac_sysroot_path)))
-
-$(eval $(call BclTemplate,mac,xammac xammac_net_4_5,xammac xammac_net_4_5))
-
-$(mac_BIN_DIR): package-mac-mac64 package-mac-macarm64 package-mac-crossarm64
-	rm -rf $(mac_BIN_DIR)
-	mkdir -p $(mac_BIN_DIR)
-
-	cp $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/bin/mono-sgen $(mac_BIN_DIR)/mono-sgen
-	cp $(TOP)/sdks/out/mac-crossarm64-$(CONFIGURATION)/bin/aarch64-apple-darwin20.0.0-mono-sgen $(mac_BIN_DIR)/aarch64-darwin-mono-sgen
-
-$(mac_PKG_CONFIG_DIR): package-mac-mac64 package-mac-macarm64
-	rm -rf $(mac_PKG_CONFIG_DIR)
-	mkdir -p $(mac_PKG_CONFIG_DIR)
-
-	cp $(TOP)/sdks/builds/mac-mac64-$(CONFIGURATION)/data/mono-2.pc $(mac_PKG_CONFIG_DIR)
-
-$(mac_LIBS_DIR): package-mac-mac64 package-mac-macarm64
-	rm -rf $(mac_LIBS_DIR)
-	mkdir -p $(mac_LIBS_DIR)
-
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib        $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib        -create -output $(mac_LIBS_DIR)/libmonosgen-2.0.dylib
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libmono-native-compat.dylib  $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libmono-native-compat.dylib  -create -output $(mac_LIBS_DIR)/libmono-native-compat.dylib
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libmono-native-unified.dylib $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libmono-native-unified.dylib -create -output $(mac_LIBS_DIR)/libmono-native-unified.dylib
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libMonoPosixHelper.dylib     $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libMonoPosixHelper.dylib     -create -output $(mac_LIBS_DIR)/libMonoPosixHelper.dylib
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libmonosgen-2.0.a            $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libmonosgen-2.0.a            -create -output $(mac_LIBS_DIR)/libmonosgen-2.0.a
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libmono-native-compat.a      $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libmono-native-compat.a      -create -output $(mac_LIBS_DIR)/libmono-native-compat.a
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libmono-native-unified.a     $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libmono-native-unified.a     -create -output $(mac_LIBS_DIR)/libmono-native-unified.a
-	$(mac_mac64_PLATFORM_BIN)/lipo $(TOP)/sdks/out/mac-mac64-$(CONFIGURATION)/lib/libmono-profiler-log.a       $(TOP)/sdks/out/mac-macarm64-$(CONFIGURATION)/lib/libmono-profiler-log.a       -create -output $(mac_LIBS_DIR)/libmono-profiler-log.a
-
-	$(mac_mac64_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(mac_LIBS_DIR)/libmonosgen-2.0.dylib
-	$(mac_mac64_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-compat.dylib  $(mac_LIBS_DIR)/libmono-native-compat.dylib
-	$(mac_mac64_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native-unified.dylib $(mac_LIBS_DIR)/libmono-native-unified.dylib
-	$(mac_mac64_PLATFORM_BIN)/install_name_tool -id @rpath/libMonoPosixHelper.dylib     $(mac_LIBS_DIR)/libMonoPosixHelper.dylib
-
-$(mac_MONO_VERSION): $(TOP)/configure.ac
-	mkdir -p $(dir $(mac_MONO_VERSION))
-	grep AC_INIT $(TOP)/configure.ac | sed -e 's/.*\[//' -e 's/\].*//' > $@
-
-$(mac_TPN_DIR)/LICENSE:
-	mkdir -p $(mac_TPN_DIR)
-	cd $(TOP) && rsync -r --include='THIRD-PARTY-NOTICES.TXT' --include='license.txt' --include='License.txt' --include='LICENSE' --include='LICENSE.txt' --include='LICENSE.TXT' --include='COPYRIGHT.regex' --include='*/' --exclude="*" --prune-empty-dirs . $(mac_TPN_DIR)
-
-$(mac_TPN_DIR): $(mac_TPN_DIR)/LICENSE

+ 0 - 120
sdks/builds/maccat.mk

@@ -1,120 +0,0 @@
-
-maccat_PKG_CONFIG_DIR = $(TOP)/sdks/out/maccat-pkgconfig
-maccat_LIBS_DIR = $(TOP)/sdks/out/maccat-libs
-maccat_TPN_DIR = $(TOP)/sdks/out/maccat-tpn
-maccat_MONO_VERSION = $(TOP)/sdks/out/maccat-mono-version.txt
-
-maccat_ARCHIVE += maccat-pkgconfig maccat-libs maccat-tpn maccat-mono-version.txt
-ADDITIONAL_PACKAGE_DEPS += $(maccat_PKG_CONFIG_DIR) $(maccat_LIBS_DIR) $(maccat_TPN_DIR) $(maccat_MONO_VERSION)
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): xcode dir
-define MacCatTemplate
-
-maccat_$(1)_PLATFORM_BIN=$(3)/Toolchains/XcodeDefault.xctoolchain/usr/bin
-
-#
-# HACK: fak: The -target is placed in the CC define per the recommendation of
-# libtool who acknowledge that some parameters are just not passed through
-# to the compiler. You can use -Wc, flags, but I failed to get the working appropriately.
-#
-_maccat-$(1)_CC=$$(CCACHE) $$(maccat_$(1)_PLATFORM_BIN)/clang -target $(2)-apple-ios$(MACCAT_IOS_VERSION_MIN)-macabi
-_maccat-$(1)_CXX=$$(CCACHE) $$(maccat_$(1)_PLATFORM_BIN)/clang++ -target $(2)-apple-ios$(MACCAT_IOS_VERSION_MIN)-macabi
-
-_maccat-$(1)_AC_VARS= \
-	ac_cv_func_system=no \
-	ac_cv_c_bigendian=no \
-	ac_cv_func_fstatat=no \
-	ac_cv_func_readlinkat=no \
-	ac_cv_func_getpwuid_r=no \
-	ac_cv_func_posix_getpwuid_r=yes \
-	ac_cv_header_curses_h=no \
-	ac_cv_header_localcharset_h=no \
-	ac_cv_header_sys_user_h=no \
-	ac_cv_func_getentropy=no \
-	ac_cv_func_futimens=no \
-	ac_cv_func_utimensat=no \
-	ac_cv_func_shm_open_working_with_mmap=no \
-	mono_cv_sizeof_sunpath=104
-
-_maccat-$(1)_CFLAGS= \
-	$$(maccat-$(1)_SYSROOT) \
-	-fexceptions
-
-_maccat-$(1)_CXXFLAGS= \
-	$$(maccat-$(1)_SYSROOT)
-
-_maccat-$(1)_CPPFLAGS= \
-	-DSMALL_CONFIG -D_XOPEN_SOURCE -DHOST_IOS -DHOST_MACCAT -DHAVE_LARGE_FILE_SUPPORT=1
-
-_maccat-$(1)_LDFLAGS= \
-	-iframework $(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_VERSION).sdk/System/iOSSupport/System/Library/Frameworks \
-	-framework CoreFoundation \
-	-lobjc -lc++
-
-_maccat-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-btls \
-	--disable-executables \
-	--disable-iconv \
-	--disable-mcs-build \
-	--disable-nls \
-	--disable-visibility-hidden \
-	--enable-dtrace=no \
-	--enable-maintainer-mode \
-	--enable-minimal=ssa,com,interpreter,portability,assembly_remapping,attach,verifier,full_messages,appdomains,security,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,remoting,shared_perfcounters,gac \
-	--enable-monotouch \
-	--with-lazy-gc-thread-creation=yes \
-	--with-tls=pthread \
-	--without-ikvm-native \
-	--without-sigaltstack \
-	--disable-cooperative-suspend \
-	--disable-hybrid-suspend \
-	--disable-crash-reporting
-
-.stamp-maccat-$(1)-toolchain:
-	touch $$@
-
-$$(eval $$(call RuntimeTemplate,maccat,$(1),$(2)-apple-darwin10,yes))
-
-endef
-
-maccat-mac64_SYSROOT=-isysroot $(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_VERSION).sdk
-
-$(eval $(call MacCatTemplate,mac64,x86_64,$(XCODE_DIR)))
-
-$(eval $(call BclTemplate,maccat,monotouch,monotouch))
-
-$(maccat_PKG_CONFIG_DIR): package-maccat-mac64
-	rm -rf $(maccat_PKG_CONFIG_DIR)
-	mkdir -p $(maccat_PKG_CONFIG_DIR)
-
-	cp $(TOP)/sdks/builds/maccat-mac64-$(CONFIGURATION)/data/mono-2.pc $(maccat_PKG_CONFIG_DIR)
-
-$(maccat_LIBS_DIR): package-maccat-mac64
-	rm -rf $(maccat_LIBS_DIR)
-	mkdir -p $(maccat_LIBS_DIR)
-
-	cp $(TOP)/sdks/out/maccat-mac64-$(CONFIGURATION)/lib/libmonosgen-2.0.dylib        $(maccat_LIBS_DIR)/libmonosgen-2.0.dylib
-	cp $(TOP)/sdks/out/maccat-mac64-$(CONFIGURATION)/lib/libmono-native.dylib         $(maccat_LIBS_DIR)/libmono-native.dylib
-	cp $(TOP)/sdks/out/maccat-mac64-$(CONFIGURATION)/lib/libMonoPosixHelper.dylib     $(maccat_LIBS_DIR)/libMonoPosixHelper.dylib
-	cp $(TOP)/sdks/out/maccat-mac64-$(CONFIGURATION)/lib/libmonosgen-2.0.a            $(maccat_LIBS_DIR)/libmonosgen-2.0.a
-	cp $(TOP)/sdks/out/maccat-mac64-$(CONFIGURATION)/lib/libmono-native.a             $(maccat_LIBS_DIR)/libmono-native.a
-	cp $(TOP)/sdks/out/maccat-mac64-$(CONFIGURATION)/lib/libmono-profiler-log.a       $(maccat_LIBS_DIR)/libmono-profiler-log.a
-
-	$(maccat_mac64_PLATFORM_BIN)/install_name_tool -id @rpath/libmonosgen-2.0.dylib        $(maccat_LIBS_DIR)/libmonosgen-2.0.dylib
-	$(maccat_mac64_PLATFORM_BIN)/install_name_tool -id @rpath/libmono-native.dylib         $(maccat_LIBS_DIR)/libmono-native.dylib
-	$(maccat_mac64_PLATFORM_BIN)/install_name_tool -id @rpath/libMonoPosixHelper.dylib     $(maccat_LIBS_DIR)/libMonoPosixHelper.dylib
-
-$(maccat_MONO_VERSION): $(TOP)/configure.ac
-	mkdir -p $(dir $(maccat_MONO_VERSION))
-	grep AC_INIT $(TOP)/configure.ac | sed -e 's/.*\[//' -e 's/\].*//' > $@
-
-$(maccat_TPN_DIR)/LICENSE:
-	mkdir -p $(maccat_TPN_DIR)
-	cd $(TOP) && rsync -r --include='THIRD-PARTY-NOTICES.TXT' --include='license.txt' --include='License.txt' --include='LICENSE' --include='LICENSE.txt' --include='LICENSE.TXT' --include='COPYRIGHT.regex' --include='*/' --exclude="*" --prune-empty-dirs . $(maccat_TPN_DIR)
-
-$(maccat_TPN_DIR): $(maccat_TPN_DIR)/LICENSE

+ 0 - 20
sdks/builds/mxe-Win32.cmake.in

@@ -1,20 +0,0 @@
-# the name of the target operating system
-set(CMAKE_SYSTEM_NAME Windows)
-
-# here is the target environment located
-set(CMAKE_FIND_ROOT_PATH @MXE_PATH@)
-
-# which compilers to use for C and C++
-set(CMAKE_C_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/i686-w64-mingw32-gcc)
-set(CMAKE_CXX_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/i686-w64-mingw32-g++)
-set(CMAKE_RC_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/i686-w64-mingw32-windres)
-
-# adjust the default behaviour of the FIND_XXX() commands:
-# search headers and libraries in the target environment, search
-# programs in the host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
-set(BUILD_SHARED_LIBS ON)

+ 0 - 20
sdks/builds/mxe-Win64.cmake.in

@@ -1,20 +0,0 @@
-# the name of the target operating system
-set(CMAKE_SYSTEM_NAME Windows)
-
-# here is the target environment located
-set(CMAKE_FIND_ROOT_PATH @MXE_PATH@)
-
-# which compilers to use for C and C++
-set(CMAKE_C_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/x86_64-w64-mingw32-gcc)
-set(CMAKE_CXX_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/x86_64-w64-mingw32-g++)
-set(CMAKE_RC_COMPILER ${CMAKE_FIND_ROOT_PATH}/bin/x86_64-w64-mingw32-windres)
-
-# adjust the default behaviour of the FIND_XXX() commands:
-# search headers and libraries in the target environment, search
-# programs in the host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
-set(BUILD_SHARED_LIBS ON)

+ 0 - 30
sdks/builds/mxe.mk

@@ -1,30 +0,0 @@
-
-ifeq ($(UNAME),Linux)
-LINUX_FLAVOR=$(shell ./determine-linux-flavor.sh)
-endif
-
-LINUX_WITH_MINGW=:Ubuntu:,:Debian:,:Debian GNU/Linux:
-LINUX_HAS_MINGW=$(if $(findstring :$(LINUX_FLAVOR):,$(LINUX_WITH_MINGW)),yes)
-
-ifeq ($(UNAME),Windows)
-.PHONY: provision-mxe
-provision-mxe:
-	@echo "Won't provision MXE on Windows. Please install mingw packages, instead."
-
-else ifeq ($(LINUX_HAS_MINGW),yes)
-MXE_PREFIX=/usr
-
-.PHONY: provision-mxe
-provision-mxe:
-	@echo $(LINUX_FLAVOR) Linux does not require mxe provisioning. mingw from packages is used instead
-else
-MXE_PREFIX:=$(shell brew --prefix)
-
-.PHONY: provision-mxe
-provision-mxe:
-	brew tap xamarin/xamarin-android-windeps
-	brew install mingw-w64 xamarin/xamarin-android-windeps/mingw-zlib
-endif
-
-.PHONY: provision
-provision: provision-mxe

+ 0 - 278
sdks/builds/runtime.mk

@@ -1,278 +0,0 @@
-
-##
-# Parameters:
-#  $(1): product
-#  $(2): target
-#  $(3): host triple
-#  $(4): exclude from archive
-#  $(5): interpreter (either '-interpreter' or empty)
-#
-# Flags:
-#  _$(1)-$(2)_AR
-#  _$(1)-$(2)_AS
-#  _$(1)-$(2)_CC
-#  _$(1)-$(2)_CPP
-#  _$(1)-$(2)_CXX
-#  _$(1)-$(2)_CXXCPP
-#  _$(1)-$(2)_DLLTOOL
-#  _$(1)-$(2)_LD
-#  _$(1)-$(2)_CMAKE
-#  _$(1)-$(2)_OBJDUMP
-#  _$(1)-$(2)_RANLIB
-#  _$(1)-$(2)_STRIP
-#  _$(1)-$(2)_CFLAGS
-#  _$(1)-$(2)_CXXFLAGS
-#  _$(1)-$(2)_CPPFLAGS
-#  _$(1)-$(2)_LDFLAGS
-#  _$(1)-$(2)_AC_VARS
-#  _$(1)-$(2)_CONFIGURE_FLAGS
-#  _$(1)-$(2)_PATH
-define RuntimeTemplate
-
-_runtime_$(1)$(5)-$(2)_BITNESS=$$(if $$(or $$(findstring i686,$(3)),$$(findstring i386,$(3))),-m32,$$(if $$(findstring x86_64,$(3)),-m64))
-
-_runtime_$(1)$(5)-$(2)_CFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)$(5)-$(2)_CFLAGS) $$($(1)$(5)-$(2)_CFLAGS) $$(_runtime_$(1)$(5)-$(2)_BITNESS)
-_runtime_$(1)$(5)-$(2)_CXXFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)$(5)-$(2)_CXXFLAGS) $$($(1)$(5)-$(2)_CXXFLAGS) $$(_runtime_$(1)$(5)-$(2)_BITNESS)
-_runtime_$(1)$(5)-$(2)_CPPFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)$(5)-$(2)_CPPFLAGS) $$($(1)$(5)-$(2)_CPPFLAGS) $$(_runtime_$(1)$(5)-$(2)_BITNESS)
-_runtime_$(1)$(5)-$(2)_CXXCPPFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)$(5)-$(2)_CXXCPPFLAGS) $$($(1)$(5)-$(2)_CXXCPPFLAGS) $$(_runtime_$(1)$(5)-$(2)_BITNESS)
-_runtime_$(1)$(5)-$(2)_LDFLAGS=$$(_$(1)$(5)-$(2)_LDFLAGS) $$($(1)$(5)-$(2)_LDFLAGS)
-
-_runtime_$(1)$(5)-$(2)_AC_VARS=$$(_$(1)$(5)-$(2)_AC_VARS) $$($(1)$(5)-$(2)_AC_VARS)
-
-_runtime_$(1)$(5)-$(2)_CONFIGURE_ENVIRONMENT = \
-	$(if $$(_$(1)$(5)-$(2)_AR),AR="$$(_$(1)$(5)-$(2)_AR)") \
-	$(if $$(_$(1)$(5)-$(2)_AS),AS="$$(_$(1)$(5)-$(2)_AS)") \
-	$(if $$(_$(1)$(5)-$(2)_CC),CC="$$(_$(1)$(5)-$(2)_CC)") \
-	$(if $$(_$(1)$(5)-$(2)_CPP),CPP="$$(_$(1)$(5)-$(2)_CPP)") \
-	$(if $$(_$(1)$(5)-$(2)_CXX),CXX="$$(_$(1)$(5)-$(2)_CXX)") \
-	$(if $$(_$(1)$(5)-$(2)_CXXCPP),CXXCPP="$$(_$(1)$(5)-$(2)_CXXCPP)") \
-	$(if $$(_$(1)$(5)-$(2)_DLLTOOL),DLLTOOL="$$(_$(1)$(5)-$(2)_DLLTOOL)") \
-	$(if $$(_$(1)$(5)-$(2)_LD),LD="$$(_$(1)$(5)-$(2)_LD)") \
-	$(if $$(_$(1)$(5)-$(2)_OBJDUMP),OBJDUMP="$$(_$(1)$(5)-$(2)_OBJDUMP)") \
-	$(if $$(_$(1)$(5)-$(2)_RANLIB),RANLIB="$$(_$(1)$(5)-$(2)_RANLIB)") \
-	$(if $$(_$(1)$(5)-$(2)_CMAKE),CMAKE="$$(_$(1)$(5)-$(2)_CMAKE)") \
-	$(if $$(_$(1)$(5)-$(2)_STRIP),STRIP="$$(_$(1)$(5)-$(2)_STRIP)") \
-	CFLAGS="$$(_runtime_$(1)$(5)-$(2)_CFLAGS)" \
-	CXXFLAGS="$$(_runtime_$(1)$(5)-$(2)_CXXFLAGS)" \
-	CPPFLAGS="$$(_runtime_$(1)$(5)-$(2)_CPPFLAGS)" \
-	CXXCPPFLAGS="$$(_runtime_$(1)$(5)-$(2)_CXXCPPFLAGS)" \
-	LDFLAGS="$$(_runtime_$(1)$(5)-$(2)_LDFLAGS)" \
-	$$(_$(1)$(5)-$(2)_CONFIGURE_ENVIRONMENT) \
-	$$($(1)$(5)-$(2)_CONFIGURE_ENVIRONMENT)
-
-_runtime_$(1)$(5)-$(2)_CONFIGURE_FLAGS= \
-	$$(if $(3),--host=$(3)) \
-	--cache-file=$$(TOP)/sdks/builds/$(1)$(5)-$(2)-$$(CONFIGURATION).config.cache \
-	--prefix=$$(TOP)/sdks/out/$(1)$(5)-$(2)-$$(CONFIGURATION) \
-	$$(if $$(ENABLE_CXX),--enable-cxx) \
-	$$(_cross-runtime_$(1)$(5)-$(2)_CONFIGURE_FLAGS) \
-	$$(_$(1)$(5)-$(2)_CONFIGURE_FLAGS) \
-	$$($(1)$(5)-$(2)_CONFIGURE_FLAGS)
-
-.stamp-$(1)$(5)-$(2)-$$(CONFIGURATION)-configure: $$(TOP)/configure .stamp-$(1)$(5)-$(2)-toolchain
-	mkdir -p $$(TOP)/sdks/builds/$(1)$(5)-$(2)-$$(CONFIGURATION)
-	$(if $$(_$(1)$(5)-$(2)_PATH),PATH="$$$$PATH:$$(_$(1)$(5)-$(2)_PATH)") ./wrap-configure.sh $$(TOP)/sdks/builds/$(1)$(5)-$(2)-$$(CONFIGURATION) $$(abspath $$<) $$(_runtime_$(1)$(5)-$(2)_AC_VARS) $$(_runtime_$(1)$(5)-$(2)_CONFIGURE_ENVIRONMENT) $$(_runtime_$(1)$(5)-$(2)_CONFIGURE_FLAGS)
-	touch $$@
-
-.stamp-$(1)$(5)-$(2)-configure: .stamp-$(1)$(5)-$(2)-$$(CONFIGURATION)-configure
-	touch $$@
-
-.PHONY: build-custom-$(1)$(5)-$(2)
-build-custom-$(1)$(5)-$(2):
-	$$(MAKE) -C $(1)$(5)-$(2)-$$(CONFIGURATION)
-
-.PHONY: setup-custom-$(1)$(5)-$(2)
-setup-custom-$(1)$(5)-$(2):
-	mkdir -p $$(TOP)/sdks/out/$(1)$(5)-$(2)-$$(CONFIGURATION)
-
-.PHONY: package-$(1)$(5)-$(2)
-package-$(1)$(5)-$(2):
-	$$(MAKE) -C $$(TOP)/sdks/builds/$(1)$(5)-$(2)-$$(CONFIGURATION)/mono install
-	$$(MAKE) -C $$(TOP)/sdks/builds/$(1)$(5)-$(2)-$$(CONFIGURATION)/support install
-
-.PHONY: clean-$(1)$(5)-$(2)
-clean-$(1)$(5)-$(2):
-	rm -rf .stamp-$(1)$(5)-$(2)-toolchain .stamp-$(1)$(5)-$(2)-$$(CONFIGURATION)-configure $$(TOP)/sdks/builds/toolchains/$(1)$(5)-$(2) $$(TOP)/sdks/builds/$(1)$(5)-$(2)-$$(CONFIGURATION) $$(TOP)/sdks/builds/$(1)$(5)-$(2)-$$(CONFIGURATION).config.cache $$(TOP)/sdks/out/$(1)$(5)-$(2)-$$(CONFIGURATION)
-
-$$(eval $$(call TargetTemplate,$(1)$(5),$(2)))
-
-.PHONY: configure-$(1)
-configure-$(1): configure-$(1)$(5)-$(2)
-
-.PHONY: build-$(1)
-build-$(1): build-$(1)$(5)-$(2)
-
-.PHONY: package-$(1)
-package-$(1): package-$(1)$(5)-$(2) $$(ADDITIONAL_PACKAGE_DEPS)
-
-.PHONY: archive-$(1)
-archive-$(1): package-$(1)
-
-ifneq ($(4),yes)
-$(1)_ARCHIVE += $(1)$(5)-$(2)-$$(CONFIGURATION)
-endif
-
-endef
-
-##
-# Parameters:
-#  $(1): product
-#  $(2): target
-#  $(3): host triple
-#
-# Flags:
-#  _$(1)-$(2)_AR
-#  _$(1)-$(2)_AS
-#  _$(1)-$(2)_CC
-#  _$(1)-$(2)_CPP
-#  _$(1)-$(2)_CXX
-#  _$(1)-$(2)_CXXCPP
-#  _$(1)-$(2)_DLLTOOL
-#  _$(1)-$(2)_LD
-#  _$(1)-$(2)_CMAKE
-#  _$(1)-$(2)_OBJDUMP
-#  _$(1)-$(2)_RANLIB
-#  _$(1)-$(2)_STRIP
-#  _$(1)-$(2)_CFLAGS
-#  _$(1)-$(2)_CXXFLAGS
-#  _$(1)-$(2)_CPPFLAGS
-#  _$(1)-$(2)_LDFLAGS
-#  _$(1)-$(2)_AC_VARS
-#  _$(1)-$(2)_CONFIGURE_FLAGS
-#  _$(1)-$(2)_PATH
-define RuntimeTemplateStub
-
-.stamp-$(1)-$(2)-$$(CONFIGURATION)-configure: $$(TOP)/configure .stamp-$(1)-$(2)-toolchain
-	touch $$@
-
-.stamp-$(1)-$(2)-configure: .stamp-$(1)-$(2)-$$(CONFIGURATION)-configure
-	touch $$@
-
-.PHONY: build-custom-$(1)-$(2)
-build-custom-$(1)-$(2):
-	@echo "TODO: build-custom-$(1)-$(2) on $$(UNAME)"
-
-.PHONY: setup-custom-$(1)-$(2)
-setup-custom-$(1)-$(2):
-	@echo "TODO: setup-custom-$(1)-$(2) on $$(UNAME)"
-
-.PHONY: package-$(1)-$(2)
-package-$(1)-$(2):
-	@echo "TODO: package-$(1)-$(2) on $$(UNAME)"
-
-.PHONY: clean-$(1)-$(2)
-clean-$(1)-$(2):
-	rm -rf .stamp-$(1)-$(2)-toolchain .stamp-$(1)-$(2)-$$(CONFIGURATION)-configure $$(TOP)/sdks/builds/toolchains/$(1)-$(2) $$(TOP)/sdks/builds/$(1)-$(2)-$$(CONFIGURATION) $$(TOP)/sdks/builds/$(1)-$(2)-$$(CONFIGURATION).config.cache $$(TOP)/sdks/out/$(1)-$(2)-$$(CONFIGURATION)
-
-$$(eval $$(call TargetTemplate,$(1),$(2)))
-
-.PHONY: configure-$(1)
-configure-$(1): configure-$(1)-$(2)
-
-.PHONY: build-$(1)
-build-$(1): build-$(1)-$(2)
-
-.PHONY: archive-$(1)
-archive-$(1): package-$(1)-$(2)
-
-
-endef
-
-
-##
-# Parameters:
-#  $(1): product
-#  $(2): target
-#  $(3): host triple
-#  $(4): target triple
-#  $(5): device target
-#  $(6): llvm
-#  $(7): offsets dumper abi
-#
-# Flags:
-#  _$(1)-$(2)_AR
-#  _$(1)-$(2)_AS
-#  _$(1)-$(2)_CC
-#  _$(1)-$(2)_CPP
-#  _$(1)-$(2)_CXX
-#  _$(1)-$(2)_CXXCPP
-#  _$(1)-$(2)_DLLTOOL
-#  _$(1)-$(2)_LD
-#  _$(1)-$(2)_OBJDUMP
-#  _$(1)-$(2)_RANLIB
-#  _$(1)-$(2)_STRIP
-#  _$(1)-$(2)_CFLAGS
-#  _$(1)-$(2)_CXXFLAGS
-#  _$(1)-$(2)_CPPFLAGS
-#  _$(1)-$(2)_LDFLAGS
-#  _$(1)-$(2)_AC_VARS
-#  _$(1)-$(2)_CONFIGURE_FLAGS
-#  _$(1)-$(2)_PATH
-#  _$(1)-$(2)_OFFSETS_DUMPER_ARGS
-define CrossRuntimeTemplate
-
-_cross-runtime_$(1)-$(2)_CONFIGURE_FLAGS= \
-	--target=$(4) \
-	--with-cross-offsets=$(4).h \
-	--with-llvm=$$(TOP)/sdks/out/$(6)
-
-.stamp-$(1)-$(2)-toolchain:
-	touch $$@
-
-.stamp-$(1)-$(2)-$$(CONFIGURATION)-configure: | $$(if $$(IGNORE_PROVISION_LLVM),,provision-$(6))
-
-$$(TOP)/sdks/builds/$(1)-$(2)-$$(CONFIGURATION)/$(4).h: .stamp-$(1)-$(2)-$$(CONFIGURATION)-configure | configure-$(1)-$(5)
-	python3 $(TOP)/mono/tools/offsets-tool/offsets-tool.py --targetdir="$$(TOP)/sdks/builds/$(1)-$(5)-$$(CONFIGURATION)" --abi=$(7) --monodir="$$(TOP)" --outfile="$$@" $$(_$(1)-$(2)_OFFSETS_DUMPER_ARGS)
-
-build-$(1)-$(2): $$(TOP)/sdks/builds/$(1)-$(2)-$$(CONFIGURATION)/$(4).h
-
-$$(eval $$(call RuntimeTemplate,$(1),$(2),$(3)))
-
-.PHONY: archive-$(1)
-archive-$(1): provision-$(6)
-
-$(1)_ARCHIVE += $(6)
-
-endef
-
-##
-# Parameters:
-#  $(1): product
-#  $(2): target
-#  $(3): host triple
-#  $(4): target triple
-#  $(5): device target
-#  $(6): llvm
-#  $(7): offsets dumper abi
-#
-# Flags:
-#  _$(1)-$(2)_AR
-#  _$(1)-$(2)_AS
-#  _$(1)-$(2)_CC
-#  _$(1)-$(2)_CPP
-#  _$(1)-$(2)_CXX
-#  _$(1)-$(2)_CXXCPP
-#  _$(1)-$(2)_DLLTOOL
-#  _$(1)-$(2)_LD
-#  _$(1)-$(2)_OBJDUMP
-#  _$(1)-$(2)_RANLIB
-#  _$(1)-$(2)_STRIP
-#  _$(1)-$(2)_CFLAGS
-#  _$(1)-$(2)_CXXFLAGS
-#  _$(1)-$(2)_CPPFLAGS
-#  _$(1)-$(2)_LDFLAGS
-#  _$(1)-$(2)_AC_VARS
-#  _$(1)-$(2)_CONFIGURE_FLAGS
-#  _$(1)-$(2)_PATH
-#  _$(1)-$(2)_OFFSETS_DUMPER_ARGS
-define CrossRuntimeTemplateStub
-
-.stamp-$(1)-$(2)-toolchain:
-	touch $$@
-
-.stamp-$(1)-$(2)-$$(CONFIGURATION)-configure:
-
-$$(eval $$(call RuntimeTemplateStub,$(1),$(2),$(3)))
-
-endef
-

+ 0 - 58
sdks/builds/unzip-android-archive.sh

@@ -1,58 +0,0 @@
-#!/usr/bin/env bash
-
-set -xe
-
-function cleanup()
-{
-	if [ -n "$ARCHIVE_TEMP_DIR" ]; then
-		rm -rf "$ARCHIVE_TEMP_DIR"
-	fi
-}
-
-trap cleanup 0
-
-## Parameters:
-#    $1: path to source archive
-#    $2: destination directory
-
-#
-# Special case archives - archives which have no single root directory when unpacked and thus
-#                         the workaround below doesn't work for them.
-# Entry format: grep regex matching the END of path in $1 (no trailing $ necessary)
-#
-SPECIAL_CASE_ARCHIVES="
-    cmake-.*\.zip
-"
-
-HAVE_SPECIAL_CASE=no
-for sac in $SPECIAL_CASE_ARCHIVES; do
-	if echo $1 | grep "${sac}$" > /dev/null 2>&1; then
-		HAVE_SPECIAL_CASE=yes
-		break
-	fi
-done
-
-if [ "$HAVE_SPECIAL_CASE" == "no" ]; then
-	# This weird syntax is necessary because some zip archives do not contain a separate
-	# entry for the root directory but merely a collection of its subdirectories (for instance
-	# platform-tools). The very first entry in the archive is retrieved, then its path is read and
-	# finally the part up to the first '/' of the path is retrieved as the root directory of
-	# the archive. With platform-tools the last part is necessary because otherwise the root directory
-	# would end up being reported as `platform-tools/adb` as this is the first entry in the archive and
-	# there's no `platform-tools/` entry
-	ZIP_ROOT_DIR=$(unzip -qql "$1" | head -n1 | tr -s ' ' | cut -d' ' -f5- | tr '/' ' ' | cut -d' ' -f1)
-fi
-
-# We need a temporary directory because some archives (emulator) have their root directory named the
-# same as a file/directory inside it (emulator has emulator/emulator executable for instance) and
-# moving such a file/directory to .. wouldn't work
-ARCHIVE_TEMP_DIR=$(mktemp -d -t unzip_android_archive_XXXXXXXX)
-
-unzip "$1" -d "$ARCHIVE_TEMP_DIR"
-mkdir -p "$2"
-
-if [ -z "$ZIP_ROOT_DIR" ]; then
-	mv -f "$ARCHIVE_TEMP_DIR"/* "$2"
-else
-	find "$ARCHIVE_TEMP_DIR/$ZIP_ROOT_DIR/" -maxdepth 1 -not \( -name "$ZIP_ROOT_DIR" -and -type d \) -and -not -name . -and -not -name .. -exec mv -f '{}' "$2" ';'
-fi

+ 0 - 240
sdks/builds/wasm.mk

@@ -1,240 +0,0 @@
-#emcc has lots of bash'isms
-SHELL:=/bin/bash
-
-EMSCRIPTEN_VERSION=2.0.12
-EMSCRIPTEN_LOCAL_SDK_DIR=$(TOP)/sdks/builds/toolchains/emsdk
-
-EMSCRIPTEN_SDK_DIR ?= $(EMSCRIPTEN_LOCAL_SDK_DIR)
-
-ifeq ($(UNAME),Darwin)
-WASM_LIBCLANG=$(EMSCRIPTEN_SDK_DIR)/upstream/lib/libclang.dylib
-else ifeq ($(UNAME),Linux)
-WASM_LIBCLANG=$(EMSCRIPTEN_SDK_DIR)/upstream/lib/libclang.so
-endif
-
-.stamp-wasm-install-and-select-$(EMSCRIPTEN_VERSION):
-	rm -rf $(EMSCRIPTEN_LOCAL_SDK_DIR)
-	git clone https://github.com/emscripten-core/emsdk.git $(EMSCRIPTEN_LOCAL_SDK_DIR)
-	cd $(EMSCRIPTEN_LOCAL_SDK_DIR) && git checkout $(EMSCRIPTEN_VERSION)
-	cd $(EMSCRIPTEN_LOCAL_SDK_DIR) && ./emsdk install $(EMSCRIPTEN_VERSION)
-	cd $(EMSCRIPTEN_LOCAL_SDK_DIR) && ./emsdk activate --embedded $(EMSCRIPTEN_VERSION)
-	touch $@
-
-.PHONY: provision-wasm
-
-ifeq ($(EMSCRIPTEN_SDK_DIR),$(EMSCRIPTEN_LOCAL_SDK_DIR))
-provision-wasm: .stamp-wasm-install-and-select-$(EMSCRIPTEN_VERSION)
-else
-provision-wasm:
-endif
-
-WASM_RUNTIME_AC_VARS= \
-	ac_cv_func_shm_open_working_with_mmap=no
-
-WASM_RUNTIME_BASE_CFLAGS=-fexceptions $(if $(RELEASE),-Os -g,-O0 -ggdb3 -fno-omit-frame-pointer)
-WASM_RUNTIME_BASE_CXXFLAGS=$(WASM_RUNTIME_BASE_CFLAGS) -s DISABLE_EXCEPTION_CATCHING=0
-
-WASM_DISABLED_FEATURES=ssa,com,jit,reflection_emit_save,portability,assembly_remapping,attach,verifier,full_messages,appdomains,security,sgen_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,logging,remoting,shared_perfcounters,sgen_debug_helpers,soft_debug,interpreter,assert_messages,cleanup,mdb,gac
-
-WASM_RUNTIME_BASE_CONFIGURE_FLAGS = \
-	--disable-mcs-build \
-	--disable-nls \
-	--disable-boehm \
-	--disable-btls \
-	--with-lazy-gc-thread-creation=yes \
-	--with-libgc=none \
-	--disable-executables \
-	--disable-support-build \
-	--disable-visibility-hidden \
-	--enable-maintainer-mode	\
-	--host=wasm32 \
-	--enable-llvm-runtime \
-	--enable-icall-export \
-	--disable-icall-tables \
-	--disable-crash-reporting \
-	--with-bitcode=yes \
-	$(if $(ENABLE_CXX),--enable-cxx) \
-	$(if $(RELEASE),,--enable-checked-build=private_types)
-
-# $(1) - target
-define WasmRuntimeTemplate
-
-_wasm_$(1)_CONFIGURE_FLAGS = \
-	$(WASM_RUNTIME_BASE_CONFIGURE_FLAGS) \
-	--enable-minimal=$(WASM_DISABLED_FEATURES)$$(wasm_$(1)_DISABLED_FEATURES) \
-	--cache-file=$(TOP)/sdks/builds/wasm-$(1)-$(CONFIGURATION).config.cache \
-	--prefix=$(TOP)/sdks/out/wasm-$(1)-$(CONFIGURATION) \
-	$$(wasm_$(1)_CONFIGURE_FLAGS) \
-	CFLAGS="$(WASM_RUNTIME_BASE_CFLAGS) $$(wasm_$(1)_CFLAGS)" \
-	CXXFLAGS="$(WASM_RUNTIME_BASE_CXXFLAGS) $$(wasm_$(1)_CXXFLAGS)"
-
-ifeq ($$(wasm_$(1)_SRCDIR),)
-_wasm_$(1)_SRCDIR = $(TOP)
-else
-_wasm_$(1)_SRCDIR = $$(wasm_$(1)_SRCDIR)
-
-$$(_wasm_$(1)_SRCDIR)/configure:
-	cd $$(_wasm_$(1)_SRCDIR) && NOCONFIGURE=1 ./autogen.sh
-endif
-
-.stamp-wasm-$(1)-toolchain:
-	touch $$@
-
-.stamp-wasm-$(1)-$(CONFIGURATION)-configure: $$(_wasm_$(1)_SRCDIR)/configure | $(if $(IGNORE_PROVISION_WASM),,provision-wasm)
-	mkdir -p $(TOP)/sdks/builds/wasm-$(1)-$(CONFIGURATION)
-	cd $(TOP)/sdks/builds/wasm-$(1)-$(CONFIGURATION) && source $(EMSCRIPTEN_SDK_DIR)/emsdk_env.sh && emconfigure $$(_wasm_$(1)_SRCDIR)/configure $(WASM_RUNTIME_AC_VARS) $$(_wasm_$(1)_CONFIGURE_FLAGS)
-	touch $$@
-
-.PHONY: .stamp-wasm-$(1)-configure
-.stamp-wasm-$(1)-configure: .stamp-wasm-$(1)-$(CONFIGURATION)-configure
-
-.PHONY: build-custom-wasm-$(1)
-build-custom-wasm-$(1):
-	source $(EMSCRIPTEN_SDK_DIR)/emsdk_env.sh && $(MAKE) -C wasm-$(1)-$(CONFIGURATION)
-
-.PHONY: setup-custom-wasm-$(1)
-setup-custom-wasm-$(1):
-	mkdir -p $(TOP)/sdks/out/wasm-$(1)-$(CONFIGURATION)
-
-.PHONY: package-wasm-$(1)
-package-wasm-$(1):
-	source $(EMSCRIPTEN_SDK_DIR)/emsdk_env.sh && $(MAKE) -C $(TOP)/sdks/builds/wasm-$(1)-$(CONFIGURATION)/mono install
-
-.PHONY: clean-wasm-$(1)
-clean-wasm-$(1):
-	rm -rf .stamp-wasm-$(1)-toolchain .stamp-wasm-$(1)-$(CONFIGURATION)-configure $(TOP)/sdks/builds/wasm-$(1)-$(CONFIGURATION) $(TOP)/sdks/out/wasm-$(1)-$(CONFIGURATION)
-ifeq ($(KEEP_CONFIG_CACHE),)
-	rm -rf $(TOP)/sdks/builds/wasm-$(1)-$(CONFIGURATION).config.cache
-endif
-
-clean-wasm-$(1)-cache:
-	rm -rf $(TOP)/sdks/builds/wasm-$(1)-$(CONFIGURATION).config.cache
-
-$(eval $(call TargetTemplate,wasm,$(1)))
-
-.PHONY: configure-wasm
-configure-wasm: configure-wasm-$(1)
-
-.PHONY: build-wasm
-build-wasm: build-wasm-$(1)
-
-.PHONY: archive-wasm
-archive-wasm: package-wasm-$(1)
-
-wasm_ARCHIVE += wasm-$(1)-$(CONFIGURATION)
-
-endef
-
-wasm_runtime_DISABLED_FEATURES=,threads
-wasm_runtime-threads_CFLAGS=-s USE_PTHREADS=1 -pthread
-wasm_runtime-threads_CXXFLAGS=-s USE_PTHREADS=1 -pthread
-
-wasm_runtime-dynamic_CFLAGS=-s WASM_OBJECT_FILES=0
-wasm_runtime-dynamic_CXXFLAGS=-s WASM_OBJECT_FILES=0
-
-$(eval $(call WasmRuntimeTemplate,runtime))
-ifdef ENABLE_WASM_THREADS
-$(eval $(call WasmRuntimeTemplate,runtime-threads))
-endif
-ifdef ENABLE_WASM_DYNAMIC_RUNTIME
-$(eval $(call WasmRuntimeTemplate,runtime-dynamic))
-endif
-
-WASM_CROSS_BASE_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-btls \
-	--disable-mcs-build \
-	--disable-nls \
-	--disable-support-build \
-	--enable-maintainer-mode \
-	--enable-minimal=appdomains,com,remoting \
-	--enable-icall-symbol-map \
-	--with-cooperative-gc=no \
-	--enable-hybrid-suspend=no \
-	--with-cross-offsets=wasm32-unknown-none.h
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): target arch
-#  $(4): device target
-#  $(5): llvm
-#  $(6): offsets dumper abi
-define WasmCrossTemplate
-
-_wasm-$(1)_OFFSETS_DUMPER_ARGS=--emscripten-sdk="$$(EMSCRIPTEN_SDK_DIR)/upstream/emscripten" --libclang="$$(WASM_LIBCLANG)"
-
-_wasm-$(1)_CONFIGURE_FLAGS= \
-	$(WASM_CROSS_BASE_CONFIGURE_FLAGS) \
-	$$(wasm_$(1)_CONFIGURE_FLAGS)
-
-$$(eval $$(call CrossRuntimeTemplate,wasm,$(1),$$(if $$(filter $$(UNAME),Darwin),$(2)-apple-darwin10,$$(if $$(filter $$(UNAME),Linux),$(2)-linux-gnu,$(2)-unknown)),$(3)-unknown-none,$(4),$(5),$(6)))
-
-endef
-
-$(eval $(call WasmCrossTemplate,cross,x86_64,wasm32,runtime,llvm-llvm64,wasm32-unknown-unknown))
-
-##
-# Parameters
-#  $(1): target
-#  $(2): host arch
-#  $(3): target arch
-#  $(4): device target
-#  $(5): llvm
-#  $(6): offsets dumper abi
-define WasmCrossMXETemplate
-
-_wasm-$(1)_OFFSETS_DUMPER_ARGS=--emscripten-sdk="$$(EMSCRIPTEN_SDK_DIR)/upstream/emscripten" --libclang="$$(WASM_LIBCLANG)"
-
-_wasm-$(1)_PATH=$$(MXE_PREFIX)/bin
-
-_wasm-$(1)_AR=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-ar
-_wasm-$(1)_AS=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-as
-_wasm-$(1)_CC=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-gcc
-_wasm-$(1)_CXX=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-g++
-_wasm-$(1)_DLLTOOL=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-dlltool
-_wasm-$(1)_LD=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-ld
-_wasm-$(1)_OBJDUMP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-objdump
-_wasm-$(1)_RANLIB=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-ranlib
-_wasm-$(1)_STRIP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $$(UNAME),Darwin),.static)-strip
-
-_wasm-$(1)_CFLAGS= \
-	$$(if $$(RELEASE),,-DDEBUG_CROSS) \
-	-static \
-	-static-libgcc
-
-_wasm-$(1)_CXXFLAGS= \
-	$$(if $$(RELEASE),,-DDEBUG_CROSS) \
-	-static \
-	-static-libgcc \
-	-static-libstdc++
-
-_wasm-$(1)_LDFLAGS= \
-	-static \
-	-static-libgcc
-
-_wasm-$(1)_CONFIGURE_FLAGS= \
-	--disable-boehm \
-	--disable-btls \
-	--disable-mcs-build \
-	--disable-nls \
-	--disable-nls \
-	--disable-support-build \
-	--enable-maintainer-mode \
-	--enable-minimal=appdomains,com,remoting \
-	--with-tls=pthread \
-	--enable-icall-symbol-map \
-	--with-cross-offsets=wasm32-unknown-none.h
-
-.stamp-wasm-$(1)-$$(CONFIGURATION)-configure: | $$(if $$(IGNORE_PROVISION_MXE),,provision-mxe)
-
-$$(eval $$(call CrossRuntimeTemplate,wasm,$(1),$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static),$(3)-unknown-none,$(4),$(5),$(6)))
-
-endef
-
-ifdef ENABLE_WINDOWS
-$(eval $(call WasmCrossMXETemplate,cross-win,x86_64,wasm32,runtime,llvm-llvmwin64,wasm32-unknown-unknown))
-endif
-
-$(eval $(call BclTemplate,wasm,wasm wasm_tools,wasm))

+ 0 - 67
sdks/builds/wrap-configure.sh

@@ -1,67 +0,0 @@
-#!/bin/bash -e
-
-START=$(date -u +"%s")
-
-# First argument is the directory where we'll execute configure
-# We assume the directory name is descriptive and use it in messages
-# and temporary file names.
-DIR="$1"
-D=$(basename "$DIR")
-shift
-
-# Check if a cache is being used
-if test -f "$D.config.cache"; then
-	HAS_CACHE=1
-fi
-
-mkdir -p "$D"
-echo "Configuring $D"
-cd "$DIR"
-
-# The rest of the arguments is the command to execute.
-#
-# We capture the output to a log (to make the output more quiet), and only
-# print it if something goes wrong (in which case we print config.log as well,
-# which can be quite useful when looking at configure problems on bots where
-# there's much information in that file).
-#
-# If a cache was used and configure failed, we remove the cache and then try
-# again.
-#
-if ! "$@" > ".stamp-configure-$D.log" 2>&1; then
-	FAILED=1
-	if [[ x"$HAS_CACHE" == "x1" ]]; then
-		echo "Configuring $D failed, but a cache was used. Will try to configure without the cache."
-		rm "../$D.config.cache"
-		if ! "$@" > ".stamp-configure-$D.log" 2>&1; then
-			echo "Configuring $D failed without cache as well."
-		else
-			FAILED=
-		fi
-	fi
-
-	if [[ x"$FAILED" == "x1" ]]; then
-		echo "Configuring $D failed:"
-		sed "s/^/    /" < ".stamp-configure-$D.log"
-
-		# Only show config.log if building on CI (jenkins/wrench)
-		SHOW_CONFIG_LOG=0
-		if test -n "$JENKINS_HOME"; then
-			SHOW_CONFIG_LOG=1
-		elif test -n "$BUILD_REVISION"; then
-			SHOW_CONFIG_LOG=1
-		fi
-		if [[ x$SHOW_CONFIG_LOG == x1 ]]; then
-			echo
-			echo "    *** config.log *** "
-			echo
-			sed "s/^/    /" < config.log
-		fi
-		exit 1
-	fi
-fi
-
-END=$(date -u +"%s")
-DIFF=$((END-START))
-
-echo "Configured $D in $((DIFF/60))m $((DIFF%60))s"

+ 0 - 15
sdks/desktop/Makefile

@@ -1,15 +0,0 @@
-TOP=$(realpath $(CURDIR)/../..)
-include $(TOP)/sdks/paths.mk
-
-run: $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll $(TOP)/sdks/out/desktop-x86_64/bin/mono-sgen
-	MONO_TESTS_IN_PROGRESS="yes" MONO_PATH="$(CURDIR)/../out/desktop-bcl/net_4_x" $(TOP)/sdks/out/desktop-x86_64/bin/mono-sgen --debug $(CURDIR)/../out/desktop-bcl/net_4_x/nunit-lite-console.exe $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll -exclude=NotOnMac,NotWorking,CAS  -format:nunit2
-
-.PHONY: $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll
-$(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll: $(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll
-	cp $(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll
-	cp $(TOP)/mcs/class/lib/net_4_x/nunit* $(CURDIR)/../out/desktop-bcl/net_4_x
-
-.PHONY: $(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll
-$(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll:
-	$(MAKE) PROFILE='net_4_x' -C $(TOP)/mcs/class/Mono.Debugger.Soft test
-

+ 0 - 272
sdks/ios/Makefile

@@ -1,272 +0,0 @@
-TOP=$(realpath $(CURDIR)/../..)
--include $(TOP)/sdks/Make.config
-include $(TOP)/sdks/versions.mk
-include $(TOP)/sdks/paths.mk
-
-ALL_TARGETS = harness.exe appbuilder.exe
-
-ifndef DISABLE_CLASSIC
-ALL_TARGETS += test-runner.exe
-endif
-
-all: $(ALL_TARGETS)
-
-BCL_DIR = ../out/ios-bcl/monotouch
-
-NINJA_PATH:=$(or $(shell which ninja),$(error "ninja not found, install it using 'brew install ninja'."))
-IOS_DEPLOY_PATH:=$(or $(shell which ios-deploy),$(error "ios-deploy not found, install it using 'brew install ios-deploy'."))
-
-# Default to add-hoc signing
-IOS_SIGNING_IDENTITY ?= -
-
-TEST_SUITES = \
-	Mono.Runtime.Tests \
-	corlib \
-	System \
-	System.Core \
-	System.Data \
-	System.Net.Http \
-	System.Numerics \
-	System.Runtime.Serialization \
-	System.Transactions \
-	System.IO.Compression \
-	System.IO.Compression.FileSystem \
-	System.Json \
-	System.ComponentModel.DataAnnotations \
-	System.Security \
-	System.Xml \
-	System.Xml.Linq \
-	System.ServiceModel.Web \
-	System.Web.Services \
-	Mono.CSharp \
-	Mono.Data.Sqlite \
-	Mono.Data.Tds \
-	Mono.Security
-
-SIM_NAME = xamarin.ios-sdk.sim
-
-OPTIONS_CS = ../../mcs/class/Mono.Options//Mono.Options/Options.cs
-
-harness.exe: harness/harness.cs $(OPTIONS_CS)
-	csc /out:$@ -r:System.Json.dll $^
-
-appbuilder.exe: appbuilder/appbuilder.cs $(OPTIONS_CS)
-	csc /out:$@ $^
-
-test-runner.exe: test-runner/runner.cs obj/Xamarin.iOS.dll
-	csc /out:$@ /debug -r:$(BCL_DIR)/nunitlite.dll -r:$(BCL_DIR)/Mono.Security.dll test-runner/runner.cs
-
-obj/Xamarin.iOS.dll: test-runner/xi.cs test-runner/xi.snk
-	mkdir -p obj
-	csc /out:$@ /noconfig /nostdlib /keyfile:test-runner/xi.snk /optimize /deterministic /publicsign /target:library /r:$(BCL_DIR)/mscorlib.dll /r:$(BCL_DIR)/System.Net.Http.dll test-runner/xi.cs
-
-app/app-simulator app/app-device.a: app/*.h app/*.m app/Makefile
-	$(MAKE) -C app
-
-ifndef DISABLE_CLASSIC
-SIM_DEPS += test-runner.exe app/app-simulator
-endif
-
-# Build % from assemblies %_ASSEMBLIES
-# The end result is in bin/ios-sim/test-%.app
-
-build-ios-sim-%: appbuilder.exe $(SIM_DEPS)
-	mono appbuilder.exe $(APPBUILDER_ARGS) $($*_APPBUILDER_ARGS) --target ios-sim64 --mono-sdkdir $(abspath ../out) --appdir $(abspath bin/ios-sim/test-$*.app) --apptemplatedir $(abspath app) --builddir $(abspath obj/ios-sim/test-$*.app) --sysroot $(XCODE_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk --signing-identity - --bundle-executable test-$* --bundle-identifier com.xamarin.mono.ios.test-$* --bundle-name test-$* $(patsubst %,-r %,$($*_ASSEMBLIES))
-	mkdir -p bin/ios-sim/test-$*.app
-	ninja -C obj/ios-sim/test-$*.app -v
-
-ifdef LLVM
-APPBUILDER_ARGS += --llvm
-endif
-
-ifdef INTERP_ONLY
-APPBUILDER_ARGS += --interp-only
-endif
-
-ifdef INTERP_MIXED
-APPBUILDER_ARGS += --interp-mixed
-endif
-
-#
-# This enables caching of aot outputs between different apps.
-# Changes to the assemblies/runtimes etc. are not detected, so this should only
-# be used when compiling multiple apps with the same assemblies, i.e. the -all
-# targets.
-#
-ifdef ENABLE_AOT_CACHE
-APPBUILDER_ARGS += --aot-cachedir $(abspath aot-cache)
-endif
-
-ifndef DISABLE_CLASSIC
-DEV_DEPS += test-runner.exe app/app-device.a
-endif
-
-build-ios-dev-%: appbuilder.exe $(DEV_DEPS)
-ifndef SKIP_SIGNING_CHECKS
-ifeq ($(IOS_SIGNING_IDENTITY),-)
-	@echo "Error: Ad-hoc signing isn't valid for device builds, set IOS_SIGNING_IDENTITY." && exit 1
-endif
-ifeq ($(IOS_TEAM_IDENTIFIER),)
-	@echo "Error: Team identifier needs to be set for device builds, set IOS_TEAM_IDENTIFIER." && exit 1
-endif
-endif
-	mkdir -p aot-cache
-	mono appbuilder.exe $(APPBUILDER_ARGS) $($*_APPBUILDER_ARGS) --target ios-dev64 --mono-sdkdir $(abspath ../out) --appdir $(abspath bin/ios-dev/test-$*.app) --apptemplatedir $(abspath app) --builddir $(abspath obj/ios-dev/test-$*.app) --sysroot $(XCODE_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk --signing-identity "$(IOS_SIGNING_IDENTITY)" --team-identifier "$(IOS_TEAM_IDENTIFIER)" --bundle-executable test-$* --bundle-identifier com.xamarin.mono.ios.test-$* --bundle-name test-$* $(patsubst %,-r %,$($*_ASSEMBLIES))
-	mkdir -p bin/ios-dev/test-$*.app
-	ninja -C obj/ios-dev/test-$*.app -v
-
-# Clean %
-clean-ios-sim-%:
-	$(RM) -rf obj/ios-sim/test-$*.app bin/ios-sim/test-$*.app
-
-clean-ios-dev-%:
-	$(RM) -rf obj/ios-dev/test-$*.app bin/ios-dev/test-$*.app
-
-ifdef DEBUG
-APP_ARGS += --wait-for-debugger
-APPBUILDER_ARGS += --debug
-endif
-
-# Install and run % on the simulator with args $(APP_ARGS) %_ARGS
-run-ios-sim-%: harness.exe
-	mono harness.exe --start-sim
-	xcrun simctl install $(SIM_NAME) bin/ios-sim/test-$*.app
-	mono harness.exe --run-sim --logfile ios-sim-$*.log --bundle-id com.xamarin.mono.ios.test-$* --bundle-dir bin/ios-sim/test-$*.app $(APP_ARGS) $($*_ARGS)
-
-run-ios-dev-%: harness.exe
-	mono harness.exe --run-dev --logfile ios-dev-$*.log --bundle-id com.xamarin.mono.ios.test-$* --bundle-dir bin/ios-dev/test-$*.app $(APP_ARGS) $($*_ARGS)
-
-clean:
-	$(MAKE) -C app clean
-	$(RM) -rf bin obj *.exe *.log aot-cache
-
-build-ios-sim-all:
-	for suite in $(TEST_SUITES); do $(MAKE) build-ios-sim-$$suite || exit 1; done
-
-run-ios-sim-all:
-	for suite in $(TEST_SUITES); do $(MAKE) run-ios-sim-$$suite || exit 1; done
-
-build-ios-dev-all:
-	rm -rf aot-cache
-	for suite in $(TEST_SUITES); do $(MAKE) clean-ios-dev-$$suite; $(MAKE) build-ios-dev-$$suite ENABLE_AOT_CACHE=1 || exit 1; done
-
-build-ios-dev-llvm-all:
-	rm -rf aot-cache
-	for suite in $(TEST_SUITES); do echo "*** $$suite ***"; $(MAKE) clean-ios-dev-$$suite; $(MAKE) build-ios-dev-$$suite LLVM=1 ENABLE_AOT_CACHE=1 || exit 1; done
-
-build-ios-dev-interp-only-all:
-	rm -rf aot-cache
-	for suite in $(TEST_SUITES); do echo "*** $$suite ***"; $(MAKE) clean-ios-dev-$$suite; $(MAKE) build-ios-dev-$$suite INTERP_ONLY=1 ENABLE_AOT_CACHE=1 || exit 1; done
-
-build-ios-dev-interp-mixed-all:
-	rm -rf aot-cache
-	for suite in $(TEST_SUITES); do echo "*** $$suite ***"; $(MAKE) clean-ios-dev-$$suite; $(MAKE) build-ios-dev-$$suite INTERP_MIXED=1 ENABLE_AOT_CACHE=1 || exit 1; done
-
-run-ios-dev-all:
-	for suite in $(TEST_SUITES); do $(MAKE) run-ios-dev-$$suite || exit 1; done
-
-# Developer targets, ignore
-# 'launch' doesn't propagate the error code
-# With ios11, --console doesn't work any more, it makes the app deadlock
-# Install % on the simulator
-install-ios-sim-%:
-	xcrun simctl install $(SIM_NAME) bin/ios-sim/test-$*.app
-
-run-ios-sim-direct-%:
-	xcrun simctl terminate $(SIM_NAME) com.xamarin.mono.ios.test-$*
-	xcrun simctl launch $(SIM_NAME) com.xamarin.mono.ios.test-$* $(APP_ARGS) $($*_ARGS)
-	log stream --level debug --predicate 'senderImagePath contains "$*"' --style compact
-
-create-sim:
-	xcrun simctl create $(SIM_NAME) 'iPhone 7' com.apple.CoreSimulator.SimRuntime.iOS-11-1
-
-start-sim:
-	xcrun simctl boot $(SIM_NAME)
-
-stop-sim:
-	xcrun simctl shutdown $(SIM_NAME)
-
-ifndef DISABLE_CLASSIC
-
-CLASSIC_TEST_ASSEMBLIES = $(BCL_DIR)/mscorlib.dll \
-	$(BCL_DIR)/System.dll \
-	$(BCL_DIR)/System.Xml.dll \
-	$(BCL_DIR)/System.Core.dll \
-	$(BCL_DIR)/I18N.dll \
-	$(BCL_DIR)/I18N.West.dll \
-	$(BCL_DIR)/Mono.Simd.dll \
-	$(BCL_DIR)/Mono.Security.dll \
-	$(BCL_DIR)/System.Numerics.dll \
-	$(BCL_DIR)/System.Numerics.Vectors.dll \
-	$(BCL_DIR)/nunitlite.dll \
-	test-runner.exe
-
-# Parameters:
-#  $(1): test assembly name (no .dll suffix)
-#  $(2): additional BCL assembly dependencies not included in $(CLASSIC_TEST_ASSEMBLIES)
-define ClassicTestTemplate
-
-$(1)_ASSEMBLIES =  \
-	$(CLASSIC_TEST_ASSEMBLIES) \
-	$(BCL_DIR)/tests/monotouch_$(1)_test.dll \
-	$(addprefix $(BCL_DIR)/,$(2))
-
-# CONNSTR will be replace by the harness with the real connection string
-$(1)_ARGS = test-runner.exe CONNSTR monotouch_$(1)_test.dll $(if $(TESTNAME),-test:$(TESTNAME))
-$(1)_APPBUILDER_ARGS += --content="$(abspath $(BCL_DIR)/tests/nunit-excludes.txt)"
-
-endef
-
-$(eval $(call ClassicTestTemplate,Mono.Runtime.Tests))
-$(eval $(call ClassicTestTemplate,corlib))
-$(eval $(call ClassicTestTemplate,System.Core))
-$(eval $(call ClassicTestTemplate,System))
-$(eval $(call ClassicTestTemplate,System.Data,System.Data.dll System.Transactions.dll))
-$(eval $(call ClassicTestTemplate,System.Net.Http,System.Net.Http.dll))
-$(eval $(call ClassicTestTemplate,System.Numerics))
-$(eval $(call ClassicTestTemplate,System.Runtime.Serialization,System.ServiceModel.dll System.ServiceModel.Internals.dll))
-$(eval $(call ClassicTestTemplate,System.Transactions,System.Transactions.dll))
-$(eval $(call ClassicTestTemplate,System.IO.Compression,System.IO.Compression.dll))
-$(eval $(call ClassicTestTemplate,System.IO.Compression.FileSystem,System.IO.Compression.FileSystem.dll System.IO.Compression.dll))
-$(eval $(call ClassicTestTemplate,Mono.CSharp,Mono.CSharp.dll))
-$(eval $(call ClassicTestTemplate,System.Json,System.Json.dll))
-$(eval $(call ClassicTestTemplate,System.ComponentModel.DataAnnotations,System.ComponentModel.DataAnnotations.dll))
-$(eval $(call ClassicTestTemplate,Mono.Data.Sqlite,System.Data.dll System.Transactions.dll Mono.Data.Sqlite.dll))
-$(eval $(call ClassicTestTemplate,Mono.Data.Tds,Mono.Data.Tds.dll))
-$(eval $(call ClassicTestTemplate,System.Security,System.Security.dll))
-$(eval $(call ClassicTestTemplate,System.Xml,System.Data.dll System.Transactions.dll))
-$(eval $(call ClassicTestTemplate,System.Xml.Linq,System.Xml.Linq.dll))
-$(eval $(call ClassicTestTemplate,Mono.Security))
-$(eval $(call ClassicTestTemplate,System.ServiceModel.Web,System.ServiceModel.Web.dll System.ServiceModel.dll System.ServiceModel.Internals.dll System.IdentityModel.dll System.Runtime.Serialization.dll))
-$(eval $(call ClassicTestTemplate,System.Web.Services,System.Web.Services.dll))
-
-System.Net.Http_ASSEMBLIES += obj/Xamarin.iOS.dll
-
-AllTests_ASSEMBLIES =  \
-	$(CLASSIC_TEST_ASSEMBLIES) \
-	obj/Xamarin.iOS.dll \
-	$(BCL_DIR)/System.Data.dll \
-	$(BCL_DIR)/System.Transactions.dll \
-	$(BCL_DIR)/System.Net.Http.dll \
-	$(BCL_DIR)/System.IO.Compression.dll \
-	$(BCL_DIR)/System.IO.Compression.FileSystem.dll \
-	$(BCL_DIR)/Mono.CSharp.dll \
-	$(BCL_DIR)/System.Json.dll \
-	$(BCL_DIR)/System.ComponentModel.DataAnnotations.dll \
-	$(BCL_DIR)/Mono.Data.Sqlite.dll \
-	$(BCL_DIR)/Mono.Data.Tds.dll \
-	$(BCL_DIR)/System.Security.dll \
-	$(BCL_DIR)/System.Xml.Linq.dll \
-	$(BCL_DIR)/System.ServiceModel.dll \
-	$(BCL_DIR)/System.ServiceModel.Internals.dll \
-	$(BCL_DIR)/System.ServiceModel.Web.dll \
-	$(BCL_DIR)/System.IdentityModel.dll \
-	$(BCL_DIR)/System.Runtime.Serialization.dll \
-	$(BCL_DIR)/System.Web.Services.dll \
-	$(foreach test,$(TEST_SUITES),$(BCL_DIR)/tests/monotouch_$(test)_test.dll ) \
-	$(addprefix $(BCL_DIR)/,$(2))
-
-AllTests_ARGS = test-runner.exe CONNSTR monotouch_$(TESTASSEMBLY)_test.dll $(if $(TESTNAME),-test:$(TESTNAME))
-AllTests_APPBUILDER_ARGS += --content="$(abspath $(BCL_DIR)/tests/nunit-excludes.txt)"
-
-endif

+ 0 - 71
sdks/ios/README.md

@@ -1,71 +0,0 @@
-# The test runner
-
-The test runner is an objective-c app which embeds the runtime. It has a command line interface similar to the mono runtime, i.e. `<exe> <arguments>`.
-
-# The test harness
-
-The test harness is a C# app which automates running a test suite. It
-install the app on the simulator, runs it, and collects output into
-a log file.
-
-# The app builder
-
-This is a C# app which is used to create an ios .app bundle.
-
-# Make targets
-
-Similar to the ones in xamarin-macios/tests
-
-	* *action*-*what*-*where*-*project*
-
-* Action
-
-	* build-
-	* install-
-	* run-
-
-* What
-
-	* -ios-
-
-* Where
-
-	* -sim-
-	* -dev-
-
-* Project
-
-	* corlib etc.
-
-The test apps require the corresponding test assembly to be already
-built, i.e. by running make PROFILE=monotouch test in mcs/class/corlib
-etc.
-
-# Running tests on device
-
-* The test apps need to be signed using a real signing identity instead
-of the default ad-hoc signing. It also needs to include a provisioning
-profile. This can be done using:
-
-```
-make build-ios-dev-<app> IOS_SIGNING_IDENTITY="iPhone Developer: XXX" IOS_TEAM_IDENTIFIER="XXXX"
-```
-
-* The certificates/provisioning profiles need to be installed on the
-host/device. Check `$HOME/Library/MobileDevice/Provisioning Profiles/*.mobileprovision` for a team identifier you can use.
-
-* The app is installed/run using 'ios-deploy', make sure it is installed.
-
-* The host and the device needs to be on the same network. This is
-needed because the test results are sent back over a tcp connection.
-
-Other possible approaches for returning results:
-
-* Using the ios os_log facility. Unfortunately, the command line 'log' tool cannot
-seem to read the device logs, only the graphical Console app can.
-* Using `idevicesyslog` from `libimobiledevice`.
-* Have the app listen on a port, and have the test harness connect to it using
-`libimobiledevice`, i.e. https://github.com/rsms/peertalk.
-* Use a publish-subscribe pattern by uploading test results to some cloud service like
-Azure EventHub. This only requires client side internet access on the device and
-the test harness.

+ 0 - 2
sdks/ios/app/.gitignore

@@ -1,2 +0,0 @@
-/app-*device.a
-/app-*simulator

+ 0 - 12
sdks/ios/app/Entitlements.plist.in

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>get-task-allow</key>
-	<true/>
-	<key>application-identifier</key>
-	<string>TEAM_IDENTIFIER.com.xamarin.mono.ios</string>
-	<key>com.apple.developer.team-identifier</key>
-	<string>TEAM_IDENTIFIER</string>
-</dict>
-</plist>

+ 0 - 55
sdks/ios/app/Info.plist.in

@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>en</string>
-	<key>CFBundleExecutable</key>
-	<string>BUNDLE_EXECUTABLE</string>
-	<key>CFBundleIdentifier</key>
-	<string>BUNDLE_IDENTIFIER</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>BUNDLE_NAME</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
-	<key>CFBundleSupportedPlatforms</key>
-	<array>
-		<string>BUNDLE_PLATFORM</string>
-	</array>
-	<key>CFBundleVersion</key>
-	<string>1</string>
-	<key>DTPlatformName</key>
-	<string>BUNDLE_DTPLATFORMNAME</string>
-	<key>LSRequiresIPhoneOS</key>
-	<true/>
-	<key>MinimumOSVersion</key>
-	<string>10.1</string>
-	<key>UIDeviceFamily</key>
-	<array>
-		<integer>1</integer>
-		<integer>2</integer>
-		<integer>3</integer>
-	</array>
-	<key>UIRequiredDeviceCapabilities</key>
-	<array>
-		<string>armv7</string>
-	</array>
-	<key>UISupportedInterfaceOrientations</key>
-	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
-	</array>
-	<key>UISupportedInterfaceOrientations~ipad</key>
-	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationPortraitUpsideDown</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
-	</array>
-</dict>
-</plist>

+ 0 - 80
sdks/ios/app/Makefile

@@ -1,80 +0,0 @@
-TOP=$(realpath $(CURDIR)/../../..)
--include $(TOP)/sdks/Make.config
-include $(TOP)/sdks/versions.mk
-include $(TOP)/sdks/paths.mk
-
-ifndef DISABLE_CLASSIC
-ALL_TARGETS += app-simulator app-device.a
-endif
-
-all: $(ALL_TARGETS)
-
-CONFIGURATION?=release
-
-UNREFERENCED_SYMBOLS_COMMON = \
-        _xamarin_log \
-        _xamarin_timezone_get_data \
-        _xamarin_timezone_get_names
-
-UNREFERENCED_SYMBOLS_CLASSIC = \
-        _CloseZStream \
-        _CreateZStream \
-        _Flush \
-        _ReadZStream \
-        _WriteZStream
-
-CC = $(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-SIM_SYSROOT = $(XCODE_DIR)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
-SIM_ARCH = x86_64
-SIM_CLASSIC_SDK_DIR = ../../out/ios-sim64-$(CONFIGURATION)
-SIM_CFLAGS = \
-	-std=gnu11 \
-	-fobjc-arc \
-	-isysroot $(SIM_SYSROOT) \
-	-mios-simulator-version-min=10.1 \
-	-g
-
-SIM_LDFLAGS = \
-	-isysroot $(SIM_SYSROOT) \
-	-mios-simulator-version-min=10.1 \
-	 -framework Foundation \
-	 -framework UIKit \
-	 -framework GSS \
-	-liconv -lz
-
-ifndef DISABLE_CLASSIC
-SIM_CLASSIC_LDFLAGS = \
-	$(foreach u,$(UNREFERENCED_SYMBOLS_COMMON) $(UNREFERENCED_SYMBOLS_CLASSIC),-u $u)  \
-	$(SIM_CLASSIC_SDK_DIR)/lib/libmonosgen-2.0.a \
-	-force_load $(SIM_CLASSIC_SDK_DIR)/lib/libmono-native-unified.a \
-	-force_load $(SIM_CLASSIC_SDK_DIR)/lib/libMonoPosixHelper.a
-
-sim-%.o: %.m
-	$(ENV) $(CC) -arch $(SIM_ARCH) $(SIM_CFLAGS) -I$(SIM_CLASSIC_SDK_DIR)/include/mono-2.0 -c -o $@ $^
-
-app-simulator: sim-main.o sim-runtime.o
-	$(ENV) $(CC) -arch $(SIM_ARCH) $(SIM_LDFLAGS) $(SIM_CLASSIC_LDFLAGS) -o $@ $^
-endif
-
-DEV_ARCH = arm64
-DEV_CLASSIC_SDK_DIR = ../../out/ios-target64-$(CONFIGURATION)
-DEV_SYSROOT = $(XCODE_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/
-DEV_CFLAGS = \
-	-isysroot $(DEV_SYSROOT) \
-	-std=gnu11 \
-	-fobjc-arc \
-	-mios-simulator-version-min=10.1 \
-	-g \
-	-fPIC \
-	-DDEVICE=1
-
-ifndef DISABLE_CLASSIC
-dev-%.o: %.m
-	$(ENV) $(CC) -arch $(DEV_ARCH) $(DEV_CFLAGS) -I$(DEV_CLASSIC_SDK_DIR)/include/mono-2.0 -c -o $@ $^
-
-app-device.a: dev-main.o dev-runtime.o
-	libtool -static -o $@ $^
-endif
-
-clean:
-	$(RM) -rf app-simulator *.o *.a

+ 0 - 142
sdks/ios/app/main.m

@@ -1,142 +0,0 @@
-//
-//  main.m
-//  test-runner
-//
-//  Created by Zoltan Varga on 11/12/17.
-//  Copyright © 2017 Zoltan Varga. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import <sys/utsname.h>
-#import "runtime.h"
-
-@interface ViewController : UIViewController
-
-@end
-
-@interface AppDelegate : UIResponder <UIApplicationDelegate>
-
-@property (strong, nonatomic) UIWindow *window;
-@property (strong, nonatomic) ViewController *controller;
-
-@end
-
-// ------------------------------------------
-
-@implementation AppDelegate
-
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-	self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-	self.controller = [[ViewController alloc] initWithNibName:nil bundle:nil];
-	self.window.rootViewController = self.controller;
-	[self.window makeKeyAndVisible];
-	return YES;
-}
-
-- (void)applicationWillResignActive:(UIApplication *)application {
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application {
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application {
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application {
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application {
-}
-
-
-@end
-
-
-@implementation ViewController
-
-UILabel *lblTestResults, *lblSummary;
-int passed = 0, skipped = 0, failed = 0;
-char* summaryMessage = nil;
-
-- (void)viewDidLoad {
-	[super viewDidLoad];
-	self.view.backgroundColor = [UIColor whiteColor];
-
-	//
-	// construct UI
-	//
-	UIStackView *mainStackView = [[UIStackView alloc] init];
-	mainStackView.translatesAutoresizingMaskIntoConstraints = NO;
-	mainStackView.axis = UILayoutConstraintAxisVertical;
-	mainStackView.alignment = UIStackViewAlignmentFill;
-	mainStackView.distribution = UIStackViewDistributionFill;
-	mainStackView.spacing = 8;
-
-	struct utsname systemInfo;
-	uname(&systemInfo);
-	UILabel *lblHeader = [[UILabel alloc] init];
-	lblHeader.textColor = [UIColor blueColor];
-	lblHeader.font = [UIFont boldSystemFontOfSize: 18];
-	lblHeader.text = [NSString stringWithFormat:@"Mono iOS SDK on %s", systemInfo.machine];
-
-	UILabel *lblInfo = [[UILabel alloc] init];
-	lblInfo.font = [UIFont boldSystemFontOfSize: 15];
-	lblInfo.text = @"Test results:";
-
-	lblTestResults = [[UILabel alloc] init];
-	lblTestResults.text = @"";
-	lblTestResults.numberOfLines = 3;
-
-	lblSummary = [[UILabel alloc] init];
-	lblSummary.accessibilityIdentifier = @"SummaryLabel";
-	lblSummary.text = @"Waiting for test to start.";
-
-	[mainStackView addArrangedSubview:lblHeader];
-	[mainStackView addArrangedSubview:lblInfo];
-	[mainStackView addArrangedSubview:lblTestResults];
-	[mainStackView addArrangedSubview:lblSummary];
-
-	[self.view addSubview:mainStackView];
-
-	[mainStackView.topAnchor constraintEqualToAnchor:self.view.topAnchor constant:25.0].active = YES;
-	[mainStackView.rightAnchor constraintEqualToAnchor:self.view.rightAnchor constant:-15.0].active = YES;
-	[mainStackView.leftAnchor constraintEqualToAnchor:self.view.leftAnchor constant:15.0].active = YES;
-
-	NSTimer* timer = [NSTimer timerWithTimeInterval:0.5f target:self selector:@selector(updateTestResults) userInfo:nil repeats:YES];
-	[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
-
-	//
-	// Launch Mono runtime
-	//
-	dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-		[self startRuntime];
-	});
-}
-
-- (void)updateTestResults {
-	dispatch_async(dispatch_get_main_queue(), ^{
-		lblTestResults.text = [NSString stringWithFormat: @"Passed: %i\nSkipped: %i\nFailed: %i", passed, skipped, failed];
-
-		if (failed > 0) {
-			lblTestResults.textColor = [UIColor redColor];
-		}
-
-		if (summaryMessage != nil) {
-			lblSummary.text = [[NSString alloc] initWithUTF8String:summaryMessage];
-		}
-	});
-}
-
-- (void)startRuntime {
-	mono_sdks_ui_register_test_result_fields (&passed, &skipped, &failed, &summaryMessage);
-	mono_ios_runtime_init ();
-}
-
-@end
-
-int main(int argc, char * argv[]) {
-	@autoreleasepool {
-		return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
-	}
-}

+ 0 - 16
sdks/ios/app/runtime.h

@@ -1,16 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-//
-//  runtime.h
-//  test-runner
-//
-//  Created by Zoltan Varga on 11/12/17.
-//  Copyright © 2017 Zoltan Varga. All rights reserved.
-//
-
-#ifndef runtime_h
-#define runtime_h
-
-void mono_sdks_ui_register_test_result_fields (int*, int*, int*, char**);
-void mono_ios_runtime_init (void);
-
-#endif /* runtime_h */

+ 0 - 492
sdks/ios/app/runtime.m

@@ -1,492 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-//
-//  runtime.m
-//
-
-#import <Foundation/Foundation.h>
-#import <os/log.h>
-#include <mono/utils/mono-publib.h>
-#include <mono/utils/mono-logger.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/mono-debug.h>
-#include <mono/metadata/mono-gc.h>
-#include <mono/metadata/exception.h>
-#include <mono/jit/jit.h>
-#include <mono/jit/mono-private-unstable.h>
-
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-// no-op for iOS and tvOS.
-// watchOS is not supported yet.
-#define MONO_ENTER_GC_UNSAFE
-#define MONO_EXIT_GC_UNSAFE
-
-#include "runtime.h"
-
-//
-// Based on runtime/ in xamarin-macios
-//
-
-static os_log_t stdout_log;
-
-bool
-file_exists (const char *path)
-{
-	struct stat buffer;
-	return stat (path, &buffer) == 0;
-}
-
-static char *bundle_path;
-
-const char *
-get_bundle_path (void)
-{
-	if (bundle_path)
-		return bundle_path;
-
-	NSBundle *main_bundle = [NSBundle mainBundle];
-	NSString *path;
-	char *result;
-
-	path = [main_bundle bundlePath];
-	bundle_path = strdup ([path UTF8String]);
-
-	return bundle_path;
-}
-
-static unsigned char *
-load_aot_data (MonoAssembly *assembly, int size, void *user_data, void **out_handle)
-{
-	*out_handle = NULL;
-
-	char path [1024];
-	int res;
-
-	MonoAssemblyName *assembly_name = mono_assembly_get_name (assembly);
-	const char *aname = mono_assembly_name_get_name (assembly_name);
-	const char *bundle = get_bundle_path ();
-
-	os_log_info (OS_LOG_DEFAULT, "Looking for aot data for assembly '%s'.", aname);
-	res = snprintf (path, sizeof (path) - 1, "%s/%s.aotdata", bundle, aname);
-	assert (res > 0);
-
-	int fd = open (path, O_RDONLY);
-	if (fd < 0) {
-		os_log_info (OS_LOG_DEFAULT, "Could not load the aot data for %s from %s: %s\n", aname, path, strerror (errno));
-		return NULL;
-	}
-
-	void *ptr = mmap (NULL, size, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0);
-	if (ptr == MAP_FAILED) {
-		os_log_info (OS_LOG_DEFAULT, "Could not map the aot file for %s: %s\n", aname, strerror (errno));
-		close (fd);
-		return NULL;
-	}
-
-	close (fd);
-
-	os_log_info (OS_LOG_DEFAULT, "Loaded aot data for %s.\n", aname);
-
-	*out_handle = ptr;
-
-	return (unsigned char *) ptr;
-}
-
-static void
-free_aot_data (MonoAssembly *assembly, int size, void *user_data, void *handle)
-{
-	munmap (handle, size);
-}
-
-static MonoAssembly*
-load_assembly (const char *name, const char *culture)
-{
-	const char *bundle = get_bundle_path ();
-	char filename [1024];
-	char path [1024];
-	int res;
-
-	os_log_info (OS_LOG_DEFAULT, "assembly_preload_hook: %{public}s %{public}s %{public}s\n", name, culture, bundle);
-
-	int len = strlen (name);
-	int has_extension = len > 3 && name [len - 4] == '.' && (!strcmp ("exe", name + (len - 3)) || !strcmp ("dll", name + (len - 3)));
-
-	// add extensions if required.
-	strlcpy (filename, name, sizeof (filename));
-	if (!has_extension) {
-		strlcat (filename, ".dll", sizeof (filename));
-	}
-
-	if (culture && strcmp (culture, ""))
-		res = snprintf (path, sizeof (path) - 1, "%s/%s/%s", bundle, culture, filename);
-	else
-		res = snprintf (path, sizeof (path) - 1, "%s/%s", bundle, filename);
-	assert (res > 0);
-
-	if (file_exists (path)) {
-		MonoAssembly *assembly = mono_assembly_open (path, NULL);
-		assert (assembly);
-		return assembly;
-	}
-	return NULL;
-}
-
-static MonoAssembly*
-assembly_preload_hook (MonoAssemblyName *aname, char **assemblies_path, void* user_data)
-{
-	const char *name = mono_assembly_name_get_name (aname);
-	const char *culture = mono_assembly_name_get_culture (aname);
-
-	return load_assembly (name, culture);
-}
-
-char *
-strdup_printf (const char *msg, ...)
-{
-	va_list args;
-	char *formatted = NULL;
-
-	va_start (args, msg);
-	vasprintf (&formatted, msg, args);
-	va_end (args);
-
-	return formatted;
-}
-
-static MonoObject *
-fetch_exception_property (MonoObject *obj, const char *name, bool is_virtual)
-{
-	MonoMethod *get = NULL;
-	MonoMethod *get_virt = NULL;
-	MonoObject *exc = NULL;
-
-	get = mono_class_get_method_from_name (mono_get_exception_class (), name, 0);
-	if (get) {
-		if (is_virtual) {
-			get_virt = mono_object_get_virtual_method (obj, get);
-			if (get_virt)
-				get = get_virt;
-		}
-
-		return (MonoObject *) mono_runtime_invoke (get, obj, NULL, &exc);
-	} else {
-		os_log_error (OS_LOG_DEFAULT, "Could not find the property System.Exception.%{public}s.", name);
-	}
-
-	return NULL;
-}
-
-static char *
-fetch_exception_property_string (MonoObject *obj, const char *name, bool is_virtual)
-{
-	MonoString *str = (MonoString *) fetch_exception_property (obj, name, is_virtual);
-	return str ? mono_string_to_utf8 (str) : NULL;
-}
-
-void
-unhandled_exception_handler (MonoObject *exc, void *user_data)
-{
-	NSMutableString *msg = [[NSMutableString alloc] init];
-
-	MonoClass *type = mono_object_get_class (exc);
-	char *type_name = strdup_printf ("%s.%s", mono_class_get_namespace (type), mono_class_get_name (type));
-	char *trace = fetch_exception_property_string (exc, "get_StackTrace", true);
-	char *message = fetch_exception_property_string (exc, "get_Message", true);
-
-	[msg appendString:@"Unhandled managed exception:\n"];
-	[msg appendFormat: @"%s (%s)\n%s\n", message, type_name, trace ? trace : ""];
-
-	free (trace);
-	free (message);
-	free (type_name);
-
-	os_log_info (OS_LOG_DEFAULT, "%@", msg);
-	os_log_info (OS_LOG_DEFAULT, "Exit code: %d.", 1);
-	exit (1);
-}
-
-void
-log_callback (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data)
-{
-	os_log_info (OS_LOG_DEFAULT, "(%s %s) %s", log_domain, log_level, message);
-	//NSLog (@"(%s %s) %s", log_domain, log_level, message);
-	if (fatal) {
-		os_log_info (OS_LOG_DEFAULT, "Exit code: %d.", 1);
-		exit (1);
-	}
-}
-
-static void
-register_dllmap (void)
-{
-	mono_dllmap_insert (NULL, "System.Native", NULL, "__Internal", NULL);
-	mono_dllmap_insert (NULL, "System.IO.Compression.Native", NULL, "__Internal", NULL);
-	mono_dllmap_insert (NULL, "System.Security.Cryptography.Native.Apple", NULL, "__Internal", NULL);
-}
-
-/* Implemented by generated code */
-void mono_ios_register_modules (void);
-void mono_ios_setup_execution_mode (void);
-
-void
-mono_ios_runtime_init (void)
-{
-	NSBundle *main_bundle = [NSBundle mainBundle];
-	NSString *path;
-	char *result;
-	int res, nargs, config_nargs;
-	char *executable;
-	char **args, **config_args = NULL;
-
-	//setenv ("MONO_LOG_LEVEL", "debug", TRUE);
-	//setenv ("MONO_LOG_MASK", "all", TRUE);
-
-	stdout_log = os_log_create ("com.xamarin", "stdout");
-
-	id args_array = [[NSProcessInfo processInfo] arguments];
-	nargs = [args_array count];
-
-	//
-	// Read executable name etc. from an embedded config file if its exists
-	//
-	path = [[NSString alloc] initWithFormat: @"%@/config.json", [main_bundle bundlePath]];
-	NSData *data = [NSData dataWithContentsOfFile: path];
-	if (data) {
-		NSError *error = nil;
-		id json = [NSJSONSerialization
-				   JSONObjectWithData:data
-				   options:0
-				   error:&error];
-		assert (!error);
-		assert ([json isKindOfClass:[NSDictionary class]]);
-		NSDictionary *dict = (NSDictionary*)json;
-		id val = dict [@"exe"];
-		assert (val);
-		executable = strdup ([((NSString*)val) UTF8String]);
-		config_nargs = 2;
-		config_args = malloc (nargs * sizeof (char*));
-		config_args [0] = strdup ([((NSString*)[args_array objectAtIndex: 0]) UTF8String]);
-		config_args [1] = executable;
-	}
-
-	if (nargs == 1) {
-		/* Use the args from the config file */
-		nargs = config_nargs;
-		args = config_args;
-	} else {
-		/* Use the real command line args */
-		args = malloc (nargs * sizeof (char*));
-		for (int i = 0; i < nargs; ++i)
-			args [i] = strdup ([((NSString*)[args_array objectAtIndex: i]) UTF8String]);
-	}
-
-	int aindex = 1;
-	bool wait_for_debugger = FALSE;
-	while (aindex < nargs) {
-		char *arg = args [aindex];
-		if (!(arg [0] == '-' && arg [1] == '-'))
-			break;
-		if (strstr (arg, "--setenv=") == arg) {
-			char *p = arg + strlen ("--setenv=");
-			char *eq = strstr (p, "=");
-			assert (eq);
-			*eq = '\0';
-			char *name = strdup (p);
-			char *val = strdup (eq + 1);
-			os_log_info (OS_LOG_DEFAULT, "%s=%s.", name, val);
-			setenv (name, val, TRUE);
-		}
-		else if (strstr (arg, "--wait-for-debugger") == arg) {
-			wait_for_debugger = TRUE;
-		}
-		aindex ++;
-	}
-
-	if (aindex == nargs) {
-		os_log_info (OS_LOG_DEFAULT, "Executable argument missing.");
-		exit (1);
-	}
-
-	executable = args [aindex];
-	aindex ++;
-
-	const char *bundle = get_bundle_path ();
-	chdir (bundle);
-
-	register_dllmap ();
-
-#ifdef DEVICE
-	mono_ios_register_modules ();
-	mono_ios_setup_execution_mode ();
-#endif
-
-	mono_debug_init (MONO_DEBUG_FORMAT_MONO);
-	mono_install_assembly_preload_hook (assembly_preload_hook, NULL);
-	mono_install_load_aot_data_hook (load_aot_data, free_aot_data, NULL);
-	mono_install_unhandled_exception_hook (unhandled_exception_handler, NULL);
-	mono_trace_set_log_handler (log_callback, NULL);
-	mono_set_signal_chaining (TRUE);
-	mono_set_crash_chaining (TRUE);
-
-	if (wait_for_debugger) {
-		char* options[] = { "--debugger-agent=transport=dt_socket,server=y,address=0.0.0.0:55555" };
-		mono_jit_parse_options (1, options);
-	} else {
-		//char* options[] = { "--trace=N:nothing" };
-		//mono_jit_parse_options (1, options);
-	}
-
-	mono_jit_init_version ("Mono.ios", "mobile");
-
-#ifdef DEVICE // device runtimes are configured to use lazy gc thread creation
-	MONO_ENTER_GC_UNSAFE;
-	mono_gc_init_finalizer_thread ();
-	MONO_EXIT_GC_UNSAFE;
-#endif
-
-	MonoAssembly *assembly = load_assembly (executable, NULL);
-	assert (assembly);
-
-	os_log_info (OS_LOG_DEFAULT, "Executable: %{public}s", executable);
-	int managed_argc = nargs - aindex;
-	char *managed_argv [128];
-	assert (managed_argc < 128 - 2);
-	int managed_aindex = 0;
-	managed_argv [managed_aindex ++] = executable;
-	for (int i = 0; i < managed_argc; ++i) {
-		managed_argv [managed_aindex] = args [aindex];
-		os_log_info (OS_LOG_DEFAULT, "Arg: %s", managed_argv [managed_aindex]);
-		managed_aindex ++;
-		aindex ++;
-	}
-	managed_argv [managed_aindex] = NULL;
-	managed_argc = managed_aindex;
-
-	res = mono_jit_exec (mono_domain_get (), assembly, managed_argc, managed_argv);
-	// Print this so apps parsing logs can detect when we exited
-	os_log_info (OS_LOG_DEFAULT, "Exit code: %d.", res);
-	exit (res);
-}
-
-static int *testPassed, *testSkipped, *testFailed;
-static char **testSummaryMessage;
-
-void
-mono_sdks_ui_register_test_result_fields (int *passed, int *skipped, int *failed, char **summaryMessage)
-{
-	testPassed = passed;
-	testSkipped = skipped;
-	testFailed = failed;
-	testSummaryMessage = summaryMessage;
-}
-
-void
-mono_sdks_ui_increment_testcase_result (int type)
-{
-	switch (type) {
-		case 0: (*testPassed)++; break;
-		case 1: (*testSkipped)++; break;
-		case 2: (*testFailed)++; break;
-	}
-}
-
-void
-mono_sdks_ui_set_test_summary_message (const char *summaryMessage)
-{
-	*testSummaryMessage = strdup (summaryMessage);
-}
-
-//
-// ICALLS used by the mobile profile of mscorlib
-//
-// NOTE: The timezone functions are duplicated in XI, so if you're going to modify here, you have to 
-// modify there. 
-//
-// See in XI runtime/xamarin-support.m
-
-void*
-xamarin_timezone_get_data (const char *name, uint32_t *size)
-{
-	NSTimeZone *tz = nil;
-	if (name) {
-		NSString *n = [[NSString alloc] initWithUTF8String: name];
-		tz = [[NSTimeZone alloc] initWithName:n];
-	} else {
-		tz = [NSTimeZone localTimeZone];
-	}
-	NSData *data = [tz data];
-	*size = [data length];
-	void* result = malloc (*size);
-	memcpy (result, data.bytes, *size);
-	return result;
-}
-
-//
-// Returns the geopolitical region ID of the local timezone.
-
-const char *
-xamarin_timezone_get_local_name ()
-{
-	NSTimeZone *tz = nil;
-	tz = [NSTimeZone localTimeZone];
-	NSString *name = [tz name];
-	return (name != nil) ? strdup ([name UTF8String]) : strdup ("Local");
-}
-
-char**
-xamarin_timezone_get_names (uint32_t *count)
-{
-	// COOP: no managed memory access: any mode.
-	NSArray *array = [NSTimeZone knownTimeZoneNames];
-	*count = array.count;
-	char** result = (char**) malloc (sizeof (char*) * (*count));
-	for (uint32_t i = 0; i < *count; i++) {
-		NSString *s = [array objectAtIndex: i];
-		result [i] = strdup (s.UTF8String);
-	}
-	return result;
-}
-
-// called from mono-extensions/mcs/class/corlib/System/Environment.iOS.cs
-const char *
-xamarin_GetFolderPath (int folder)
-{
-	// COOP: no managed memory access: any mode.
-	// NSUInteger-based enum (and we do not want corlib exposed to 32/64 bits differences)
-	NSSearchPathDirectory dd = (NSSearchPathDirectory) folder;
-	NSURL *url = [[[NSFileManager defaultManager] URLsForDirectory:dd inDomains:NSUserDomainMask] lastObject];
-	NSString *path = [url path];
-	return strdup ([path UTF8String]);
-}
-
-// mcs/class/System/System.Net/WebConnection.cs
-void
-xamarin_start_wwan (const char *uri)
-{
-	// let's ignore this
-}
-
-// mcs/class/corlib/System/Console.iOS.cs
-void
-xamarin_log (const unsigned short *unicodeMessage)
-{
-	// COOP: no managed memory access: any mode.
-	int length = 0;
-	const unsigned short *ptr = unicodeMessage;
-	while (*ptr++)
-		length += sizeof (unsigned short);
-	NSString *msg = [[NSString alloc] initWithBytes: unicodeMessage length: length encoding: NSUTF16LittleEndianStringEncoding];
-
-#if TARGET_OS_WATCH && defined (__arm__) // maybe make this configurable somehow?
-	const char *utf8 = [msg UTF8String];
-	int len = strlen (utf8);
-	fwrite (utf8, 1, len, stdout);
-	if (len == 0 || utf8 [len - 1] != '\n')
-		fwrite ("\n", 1, 1, stdout);
-	fflush (stdout);
-#else
-	os_log (stdout_log, "%{public}@", msg);
-	//NSLog (@"%@", msg);
-#endif
-}

+ 0 - 360
sdks/ios/appbuilder/appbuilder.cs

@@ -1,360 +0,0 @@
-using System;
-using System.IO;
-using System.Globalization;
-using System.Linq;
-using System.Reflection;
-using System.Collections.Generic;
-using Mono.Options;
-
-public class AppBuilder
-{
-	public static void Main (String[] args) {
-		new AppBuilder ().Run (args);
-	}
-
-	void GenMain (string builddir, List<string> assembly_names, bool isinterp) {
-		var symbols = new List<string> ();
-		foreach (var img in assembly_names) {
-			symbols.Add (String.Format ("mono_aot_module_{0}_info", img.Replace ('.', '_').Replace ('-', '_')));
-		}
-
-		var w = File.CreateText (Path.Combine (builddir, "modules.m"));
-
-		/* copy from <mono/mini/jit.h> */
-		w.WriteLine ("typedef enum {");
-		w.WriteLine ("	MONO_AOT_MODE_NONE,");
-		w.WriteLine ("	MONO_AOT_MODE_NORMAL,");
-		w.WriteLine ("	MONO_AOT_MODE_HYBRID,");
-		w.WriteLine ("	MONO_AOT_MODE_FULL,");
-		w.WriteLine ("	MONO_AOT_MODE_LLVMONLY,");
-		w.WriteLine ("	MONO_AOT_MODE_INTERP,");
-		w.WriteLine ("	MONO_AOT_MODE_INTERP_LLVMONLY");
-		w.WriteLine ("} MonoAotMode;");
-		w.WriteLine ();
-		w.WriteLine ("void mono_jit_set_aot_mode (MonoAotMode mode);");
-		w.WriteLine ();
-
-		w.WriteLine ("extern void mono_aot_register_module (char *name);");
-		w.WriteLine ();
-
-		if (isinterp) {
-			w.WriteLine ("extern void mono_ee_interp_init (const char *);");
-			w.WriteLine ("extern void mono_icall_table_init (void);");
-			w.WriteLine ("extern void mono_marshal_ilgen_init (void);");
-			w.WriteLine ("extern void mono_method_builder_ilgen_init (void);");
-			w.WriteLine ("extern void mono_sgen_mono_ilgen_init (void);");
-			w.WriteLine ();
-		}
-
-		foreach (var symbol in symbols) {
-			w.WriteLine ($"extern void *{symbol};");
-		}
-
-		w.WriteLine ();
-		w.WriteLine ("void mono_ios_register_modules (void)");
-		w.WriteLine ("{");
-		foreach (var symbol in symbols) {
-			w.WriteLine ($"\tmono_aot_register_module ({symbol});");
-		}
-		w.WriteLine ("}");
-
-		w.WriteLine ();
-		w.WriteLine ("void mono_ios_setup_execution_mode (void)");
-		w.WriteLine ("{");
-		if (isinterp) {
-			w.WriteLine ("\tmono_icall_table_init ();");
-			w.WriteLine ("\tmono_marshal_ilgen_init ();");
-			w.WriteLine ("\tmono_method_builder_ilgen_init ();");
-			w.WriteLine ("\tmono_sgen_mono_ilgen_init ();");
-			w.WriteLine ("\tmono_ee_interp_init (0);");
-		}
-		w.WriteLine ("\tmono_jit_set_aot_mode ({0});", isinterp ? "MONO_AOT_MODE_INTERP" : "MONO_AOT_MODE_FULL");
-		w.WriteLine ("}");
-
-		w.WriteLine ();
-		w.Close ();
-	}
-
-	void check_mandatory (string val, string name) {
-		if (val == null) {
-			Console.Error.WriteLine ($"The {name} argument is mandatory.");
-			Environment.Exit (1);
-		}
-	}
-
-	void Run (String[] args) {
-		string target = null;
-		string appdir = null;
-		string builddir = null;
-		string apptemplatedir = null;
-		string mono_sdkdir = null;
-		string bundle_identifier = null;
-		string bundle_name = null;
-		string bundle_executable = null;
-		string sysroot = null;
-		string aotdir = null;
-		string exe = null;
-		string signing_identity = null;
-		string team_identifier = null;
-		bool isdev = false;
-		bool isdebug = false;
-		bool isllvm = false;
-		bool isinterponly = false;
-		bool isinterpmixed = false;
-		var assemblies = new List<string> ();
-		var content_files = new List<string> ();
-		var p = new OptionSet () {
-				{ "target=", s => target = s },
-				{ "appdir=", s => appdir = s },
-				{ "builddir=", s => builddir = s },
-				{ "apptemplatedir=", s => apptemplatedir = s },
-				{ "mono-sdkdir=", s => mono_sdkdir = s },
-				{ "sysroot=", s => sysroot = s },
-				{ "aot-cachedir=", s => aotdir = s },
-				{ "bundle-identifier=", s => bundle_identifier = s },
-				{ "bundle-name=", s => bundle_name = s },
-				{ "bundle-executable=", s => bundle_executable = s },
-				{ "signing-identity=", s => signing_identity = s },
-				{ "team-identifier=", s => team_identifier = s },
-				{ "llvm", s => isllvm = true },
-				{ "debug", s => isdebug = true },
-				{ "interp-only", s => isinterponly = true },
-				{ "interp-mixed", s => isinterpmixed = true },
-				{ "exe=", s => exe = s },
-				{ "r=", s => assemblies.Add (s) },
-				{ "content=", s => content_files.Add (s) },
-			};
-
-		var new_args = p.Parse (args).ToArray ();
-
-		check_mandatory (target, "--target");
-		check_mandatory (apptemplatedir, "--apptemplatedir");
-		check_mandatory (appdir, "--appdir");
-		check_mandatory (mono_sdkdir, "--mono-sdkdir");
-		check_mandatory (sysroot, "--sysroot");
-		check_mandatory (signing_identity, "--signing-identity");
-
-		switch (target) {
-		case "ios-dev64":
-			isdev = true;
-			check_mandatory (team_identifier, "--team-identifier");
-			break;
-		case "ios-sim64":
-			break;
-		default:
-			Console.WriteLine ($"Possible values for the '--target=' argument are 'ios-dev64', 'ios-sim64', got {target}.");
-			Environment.Exit (1);
-			break;
-		}
-
-		string runtime = "ios-target64-release";
-		string cross_runtime = "ios-cross64-release";
-
-		bool isinterpany = isinterponly || isinterpmixed;
-
-		string aot_args = "";
-		string cross_runtime_args = "";
-
-		if (isinterponly) {
-			aot_args = "interp";
-		} else if (isinterpmixed) {
-			aot_args = "interp,full";
-		} else {
-			aot_args = "full";
-		}
-
-		if (isdebug)
-			aot_args += ",soft-debug";
-		if (isllvm) {
-			cross_runtime_args = "--llvm";
-			aot_args += ",llvm-path=$mono_sdkdir/llvm-llvm64/bin,llvm-outfile=$llvm_outfile";
-
-			if (isdebug) {
-				Console.WriteLine ("--debug can't be used together with --llvm");
-				Environment.Exit (1);
-			}
-		}
-
-		Directory.CreateDirectory (builddir);
-
-		// Create Info.plist file
-		var lines = File.ReadAllLines (Path.Combine (apptemplatedir, "Info.plist.in"));
-		for (int i = 0; i < lines.Length; ++i) {
-			string line = lines [i];
-			line = line.Replace ("BUNDLE_IDENTIFIER", bundle_identifier);
-			line = line.Replace ("BUNDLE_EXECUTABLE", bundle_executable);
-			line = line.Replace ("BUNDLE_NAME", bundle_name);
-			line = line.Replace ("BUNDLE_PLATFORM", isdev ? "iPhoneOS" : "iPhoneSimulator");
-			line = line.Replace ("BUNDLE_DTPLATFORMNAME", isdev ? "iphoneos" : "iphonesimulator");
-			lines [i] = line;
-		}
-		File.WriteAllLines (Path.Combine (builddir, "Info.plist"), lines);
-
-		// Create Entitlements.plist file
-		lines = File.ReadAllLines (Path.Combine (apptemplatedir, "Entitlements.plist.in"));
-		for (int i = 0; i < lines.Length; ++i) {
-			string line = lines [i];
-			line = line.Replace ("TEAM_IDENTIFIER", team_identifier);
-			lines [i] = line;
-		}
-		File.WriteAllLines (Path.Combine (builddir, "Entitlements.plist"), lines);
-
-		// Create config.json file
-		string config = "{ \"exe\" : \"" + exe + "\" }";
-		File.WriteAllLines (Path.Combine (builddir, "config.json"), new string [] { config });
-
-		var ninja = File.CreateText (Path.Combine (builddir, "build.ninja"));
-
-		// Defines
-		ninja.WriteLine ($"mono_sdkdir = {mono_sdkdir}");
-		ninja.WriteLine ($"apptemplate_dir = {apptemplatedir}");
-		ninja.WriteLine ($"appdir = {appdir}");
-		ninja.WriteLine ($"sysroot = {sysroot}");
-		ninja.WriteLine ($"cross = $mono_sdkdir/{cross_runtime}/bin/aarch64-darwin-mono-sgen");
-		ninja.WriteLine ($"builddir = .");
-		if (aotdir != null)
-			ninja.WriteLine ($"aotdir = {aotdir}");
-		ninja.WriteLine ($"signing_identity = {signing_identity}");
-		ninja.WriteLine ("entitlements = $builddir/Entitlements.plist");
-		// Rules
-		ninja.WriteLine ("rule aot");
-		ninja.WriteLine ($"  command = MONO_PATH=$mono_path $cross -O=gsharedvt,float32 --debug {cross_runtime_args} --aot=mtriple=arm64-ios,static,asmonly,direct-icalls,no-direct-calls,dwarfdebug,{aot_args},outfile=$outfile,data-outfile=$data_outfile $src_file");
-		ninja.WriteLine ("  description = [AOT] $src_file -> $outfile");
-		// ninja remakes files it hadn't seen before even if the timestamp is newer, so have to add a test ourselves
-		ninja.WriteLine ("rule aot-cached");
-		ninja.WriteLine ($"  command = if ! test -f $outfile; then MONO_PATH=$mono_path $cross -O=gsharedvt,float32 --debug {cross_runtime_args} --aot=mtriple=arm64-ios,static,asmonly,direct-icalls,no-direct-calls,dwarfdebug,{aot_args},outfile=$outfile,data-outfile=$data_outfile $src_file; fi");
-		ninja.WriteLine ("  description = [AOT] $src_file -> $outfile");
-		ninja.WriteLine ("rule assemble");
-		ninja.WriteLine ("  command = clang -isysroot $sysroot -miphoneos-version-min=10.1 -arch arm64 -c -o $out $in");
-		ninja.WriteLine ("  description = [ASM] $in -> $out");
-		ninja.WriteLine ("rule assemble-cached");
-		ninja.WriteLine ("  command = if ! test -f $out; then clang -isysroot $sysroot -miphoneos-version-min=10.1 -arch arm64 -c -o $out $in; fi");
-		ninja.WriteLine ("  description = [ASM] $in -> $out");
-		ninja.WriteLine ("rule cp");
-		ninja.WriteLine ("  command = cp $in $out");
-		ninja.WriteLine ("  description = [CP] $in -> $out");
-		ninja.WriteLine ("rule cp-recursive");
-		ninja.WriteLine ("  command = cp -r $in $out");
-		ninja.WriteLine ("rule cpifdiff");
-		ninja.WriteLine ("  command = if cmp -s $in $out ; then : ; else cp $in $out ; fi");
-		ninja.WriteLine ("  restat = true");
-		ninja.WriteLine ("rule plutil");
-		ninja.WriteLine ("  command = cp $in $out; plutil -convert binary1 $out");
-		ninja.WriteLine ("rule codesign");
-		ninja.WriteLine ("  command = codesign -v --force --sign \"$signing_identity\" --entitlements $entitlements --timestamp=none $in");
-		ninja.WriteLine ("rule codesign-sim");
-		ninja.WriteLine ("  command = codesign --force --sign - --timestamp=none $in");
-		ninja.WriteLine ("rule mkdir");
-		ninja.WriteLine ("  command = mkdir -p $out");
-		ninja.WriteLine ("rule compile-objc");
-		ninja.WriteLine ("  command = clang -isysroot $sysroot -miphoneos-version-min=10.1 -arch arm64 -c -o $out $in");
-		ninja.WriteLine ("rule gen-exe");
-		ninja.WriteLine ("  command = mkdir $appdir");
-		ninja.WriteLine ($"  command = clang -ObjC -isysroot $sysroot -miphoneos-version-min=10.1 -arch arm64 -framework Foundation -framework UIKit -framework GSS -o $appdir/{bundle_executable} $in -liconv -lz $forcelibs");
-	
-		var ofiles = "";
-		var assembly_names = new List<string> ();
-		var cultures = CultureInfo.GetCultures (CultureTypes.AllCultures).Where (x => !String.IsNullOrEmpty (x.IetfLanguageTag)).Select (x => x.IetfLanguageTag).Distinct ();
-		foreach (var assembly in assemblies) {
-			string filename = Path.GetFileName (assembly);
-			var filename_noext = Path.GetFileNameWithoutExtension (filename);
-
-			File.Copy (assembly, Path.Combine (builddir, filename), true);
-			if (aotdir != null && !File.Exists (Path.Combine (aotdir, filename)))
-				/* Don't overwrite to avoid changing the timestamp */
-				File.Copy (assembly, Path.Combine (aotdir, filename), false);
-
-			ninja.WriteLine ($"build $appdir/{filename}: cpifdiff $builddir/{filename}");
-
-			string pdb = Path.ChangeExtension (assembly, ".pdb");
-			if (isdebug && File.Exists (pdb)) {
-				File.Copy (pdb, Path.Combine (builddir, filename_noext + ".pdb"), true);
-				ninja.WriteLine ($"build $appdir/{filename_noext}.pdb: cpifdiff $builddir/{filename_noext}.pdb");
-			}
-
-			var assembly_dir = Path.GetDirectoryName (assembly);
-			var resource_filename = filename.Replace (".dll", ".resources.dll");
-			foreach (var culture in cultures) {
-				var resource_assembly = Path.Combine (assembly_dir, culture, resource_filename);
-				if (!File.Exists(resource_assembly)) continue;
-
-				Directory.CreateDirectory (Path.Combine (builddir, culture));
-				File.Copy (resource_assembly, Path.Combine (builddir, culture, resource_filename), true);
-				ninja.WriteLine ($"build $appdir/{culture}/{resource_filename}: cpifdiff $builddir/{culture}/{resource_filename}");
-			}
-
-			if (isinterpany && filename_noext != "mscorlib")
-				continue;
-
-			if (isdev) {
-				string destdir = null;
-				string srcfile = null;
-				string assemble_rule = null;
-				if (aotdir != null) {
-					destdir = "$aotdir";
-					srcfile = Path.Combine (aotdir, filename);
-					assemble_rule = "assemble-cached";
-				} else {
-					destdir = "$builddir";
-					srcfile = $"{filename}";
-					assemble_rule = "assemble";
-				}
-				string outputs = $"{destdir}/{filename}.s {destdir}/{filename_noext}.aotdata";
-				if (isllvm)
-					outputs += $" {destdir}/{filename}.llvm.s";
-				if (aotdir != null)
-					ninja.WriteLine ($"build {outputs}: aot-cached {srcfile}");
-				else
-					ninja.WriteLine ($"build {outputs}: aot {srcfile}");
-				ninja.WriteLine ($"  src_file={srcfile}");
-				ninja.WriteLine ($"  outfile={destdir}/{filename}.s");
-				ninja.WriteLine ($"  data_outfile={destdir}/{filename_noext}.aotdata");
-				ninja.WriteLine ($"  mono_path={destdir}");
-				if (isllvm)
-					ninja.WriteLine ($"  llvm_outfile={destdir}/{filename}.llvm.s");
-				ninja.WriteLine ($"build {destdir}/{filename}.o: {assemble_rule} {destdir}/{filename}.s");
-				if (isllvm)
-					ninja.WriteLine ($"build {destdir}/{filename}.llvm.o: {assemble_rule} {destdir}/{filename}.llvm.s");
-				ninja.WriteLine ($"build $appdir/{filename_noext}.aotdata: cp {destdir}/{filename_noext}.aotdata");
-
-				ofiles += " " + ($"{destdir}/{filename}.o");
-				if (isllvm)
-					ofiles += " " + ($"{destdir}/{filename}.llvm.o");
-			}
-			var aname = AssemblyName.GetAssemblyName (assembly);
-			assembly_names.Add (aname.Name);
-		}
-
-		foreach (var file in content_files) {
-			string filename = Path.GetFileName (file);
-			ninja.WriteLine ($"build $appdir/{filename}: cpifdiff {file}");
-		}
-
-		ninja.WriteLine ("build $appdir: mkdir");
-
-		if (isdev) {
-			string libs = $"$mono_sdkdir/{runtime}/lib/libmonosgen-2.0.a";
-			if (isinterpany) {
-				libs += $" $mono_sdkdir/{runtime}/lib/libmono-ee-interp.a";
-				libs += $" $mono_sdkdir/{runtime}/lib/libmono-icall-table.a";
-				libs += $" $mono_sdkdir/{runtime}/lib/libmono-ilgen.a";
-			}
-			ninja.WriteLine ($"build $appdir/{bundle_executable}: gen-exe {ofiles} $builddir/modules.o " + libs + " $apptemplate_dir/app-device.a");
-			ninja.WriteLine ($"    forcelibs = -force_load $mono_sdkdir/{runtime}/lib/libmono-native-unified.a");
-			ninja.WriteLine ("build $builddir/modules.o: compile-objc $builddir/modules.m");
-		} else {
-			ninja.WriteLine ($"build $appdir/{bundle_executable}: cp " + "$apptemplate_dir/app-simulator");
-		}
-		ninja.WriteLine ("build $builddir/Info.plist.binary: plutil $builddir/Info.plist");
-		ninja.WriteLine ("build $appdir/Info.plist: cpifdiff $builddir/Info.plist.binary");
-		ninja.WriteLine ("build $appdir/config.json: cpifdiff $builddir/config.json");
-		if (isdev)
-			ninja.WriteLine ($"build $appdir/_CodeSignature: codesign $appdir/{bundle_executable}");
-		else
-			ninja.WriteLine ($"build $appdir/_CodeSignature: codesign-sim $appdir/{bundle_executable}");
-
-		ninja.Close ();
-
-		GenMain (builddir, assembly_names, isinterpany);
-	}
-}

+ 0 - 319
sdks/ios/harness/harness.cs

@@ -1,319 +0,0 @@
-using System;
-using System.IO;
-using System.Json;
-using System.Threading;
-using System.Diagnostics;
-using System.Net;
-using System.Net.Sockets;
-using Mono.Options;
-
-public class Harness
-{
-	public const string SIM_NAME = "xamarin.ios-sdk.sim";
-
-	static void Usage () {
-		Console.WriteLine ("Usage: mono harness.exe <options> <app dir>");
-		Console.WriteLine ("Where options are:");
-		Console.WriteLine ("\t--run-sim");
-		Console.WriteLine ("\t--app=<app bundle id>");
-		Console.WriteLine ("\t--logfile=<log file name>");
-	}
-
-	public static int Main (string[] args) {
-		new Harness ().Run (args);
-		return 0;
-	}
-
-	string bundle_id;
-	string bundle_dir;
-	string logfile_name;
-	string[] new_args;
-
-	public void Run (string[] args) {
-		string action = "";
-		bundle_id = "";
-		bundle_dir = "";
-		logfile_name = "";
-
-		var p = new OptionSet () {
-		  { "start-sim", s => action = "start-sim" },
-		  { "run-sim", s => action = "run-sim" },
-		  { "run-dev", s => action = "run-dev" },
-		  { "bundle-id=", s => bundle_id = s },
-		  { "bundle-dir=", s => bundle_dir = s },
-		  { "logfile=", s => logfile_name = s },
-		};
-		new_args = p.Parse (args).ToArray ();
-
-		if (action == "start-sim") {
-			StartSim ();
-		} else if (action == "run-sim") {
-			if (bundle_id == "" || bundle_dir == "") {
-				Console.WriteLine ("The --bundle-id and --bundle-dir arguments are mandatory.");
-				Environment.Exit (1);
-			}
-			RunSim ();
-		} else if (action == "run-dev") {
-			if (bundle_dir == "") {
-				Console.WriteLine ("The --bundle-dir argument is mandatory.");
-				Environment.Exit (1);
-			}
-			RunDev ();
-		} else {
-			Usage ();
-			Environment.Exit (1);
-		}
-	}
-
-	void StartSim () {
-		// Check whenever our simulator instance exists
-		string state_line = "";
-		{
-			var args = "simctl list devices";
-			Console.WriteLine ("Running: " + "xcrun " + args);
-			var start_info = new ProcessStartInfo ("xcrun", args);
-			start_info.RedirectStandardOutput = true;
-			start_info.UseShellExecute = false;
-			var process = Process.Start (start_info);
-			var stream = process.StandardOutput;
-			string line = "";
-			while (true) {
-				line = stream.ReadLine ();
-				if (line == null)
-					break;
-				if (line.Contains (SIM_NAME)) {
-					state_line = line;
-					break;
-				}
-			}
-			process.WaitForExit ();
-			if (process.ExitCode != 0)
-				Environment.Exit (1);
-		}
-
-		if (state_line.Contains ("unavailable")) {
-			// Created for an older version of xcode
-			var args = "simctl delete unavailable";
-			Console.WriteLine ("Running: " + "xcrun " + args);
-			var process = Process.Start ("xcrun", args);
-			process.WaitForExit ();
-			state_line = "";
-		}
-
-		bool need_start = false;
-		if (state_line == "") {
-			// Get the runtime type
-			var args = "simctl list -j runtimes";
-			Console.WriteLine ("Running: " + "xcrun " + args);
-			var start_info = new ProcessStartInfo ("xcrun", args);
-			start_info.RedirectStandardOutput = true;
-			start_info.UseShellExecute = false;
-			var process = Process.Start (start_info);
-			var stream = process.StandardOutput;
-			JsonObject value = JsonValue.Parse (stream.ReadToEnd ()) as JsonObject;
-			string runtime = value ["runtimes"][0]["identifier"];
-
-			// Create the simulator
-			args = "simctl create " + SIM_NAME + " 'iPhone 7' " + runtime;
-			Console.WriteLine ("Running: " + "xcrun " + args);
-			process = Process.Start ("xcrun", args);
-			process.WaitForExit ();
-			if (process.ExitCode != 0)
-				Environment.Exit (1);
-			need_start = true;
-		} else if (state_line.Contains ("(Shutdown)")) {
-			need_start = true;
-		}
-
-		if (need_start) {
-			var args = "simctl boot " + SIM_NAME;
-			Console.WriteLine ("Running: " + "xcrun " + args);
-			var process = Process.Start ("xcrun", args);
-			process.WaitForExit ();
-			if (process.ExitCode != 0)
-				Environment.Exit (1);
-		}
-	}
-
-	void RunSim () {
-		Console.WriteLine ("App: " + bundle_id);
-
-		StartSim ();
-
-		// Install the app
-		// We do this all the time since its cheap
-		string exe = "xcrun";
-		string args = "simctl install " + SIM_NAME + " " + bundle_dir;
-		Console.WriteLine ("Running: " + exe + " " + args);
-		var process = Process.Start (exe, args);
-		process.WaitForExit ();
-		if (process.ExitCode != 0)
-			Environment.Exit (1);
-
-		//
-		// Test results are returned using an socket connection.
-		//
-		var server = new TcpListener (System.Net.IPAddress.Loopback, 0);
-		server.Start ();
-		int port = ((IPEndPoint)server.LocalEndpoint).Port;
-
-		string app_args = "";
-		foreach (var a in new_args)
-			app_args += a + " ";
-		if (!app_args.Contains ("CONNSTR"))
-			throw new Exception ();
-		app_args = app_args.Replace ("CONNSTR", $"tcp:localhost:{port}");
-
-		// Terminate previous app
-		exe = "xcrun";
-		args = "simctl terminate " + SIM_NAME + " " + bundle_id;
-		Console.WriteLine ("Running: " + exe + " " + args);
-		process = Process.Start (exe, args);
-		process.WaitForExit ();
-		if (process.ExitCode != 0)
-			Environment.Exit (1);
-
-		// Launch new app
-		exe = "xcrun";
-		args = "simctl launch " + SIM_NAME + " " + bundle_id + " " + app_args;
-		Console.WriteLine ("Running: " + exe + " " + args);
-		process = Process.Start (exe, args);
-		process.WaitForExit ();
-		if (process.ExitCode != 0)
-			Environment.Exit (1);
-
-		//
-		// Read test results from the tcp connection
-		//
-		TextWriter w = new StreamWriter (logfile_name);
-		string result_line = null;
-		TextWriter xml_results_file = null;
-		var client = server.AcceptTcpClient ();
-		var stream = client.GetStream ();
-		var reader = new StreamReader (stream);
-		while (true) {
-			var line = reader.ReadLine ();
-			if (line == null)
-				break;
-			if (line.Contains ("STARTRESULTXML")) {
-				Console.Write ("Getting test result XML data...");
-				xml_results_file = File.CreateText (Path.Combine (Path.GetDirectoryName (bundle_dir), $"TestResult_{bundle_id}.xml"));
-				continue;
-			} else if (line.Contains ("ENDRESULTXML")) {
-				Console.WriteLine ("done");
-				xml_results_file.Close ();
-				xml_results_file = null;
-				continue;
-			}
-			if (xml_results_file != null) {
-				xml_results_file.WriteLine (line);
-				continue;
-			}
-			Console.WriteLine (line);
-			w.WriteLine (line);
-			if (line.Contains ("Tests run:"))
-				result_line = line;
-			// Printed by the runtime
-			if (line.Contains ("Exit code:"))
-				break;
-		}
-		w.Close ();
-
-		if (result_line != null && result_line.Contains ("Errors: 0") && result_line.Contains ("Failures: 0"))
-			Environment.Exit (0);
-		else
-			Environment.Exit (1);
-	}
-
-	void RunDev () {
-		Console.WriteLine ("App: " + bundle_dir);
-
-		//
-		// Test results are returned using an socket connection.
-		//
-		var host = Dns.GetHostEntry (Dns.GetHostName ());
-		var hostip = host.AddressList [0].ToString ();
-		Console.WriteLine ("Host ip: " + hostip);
-		var server = new TcpListener (host.AddressList [0], 0);
-		server.Start ();
-		int port = ((IPEndPoint)server.LocalEndpoint).Port;
-
-		string app_args = "";
-		foreach (var a in new_args)
-			app_args += a + " ";
-		if (!app_args.Contains ("CONNSTR"))
-			throw new Exception ();
-		app_args = app_args.Replace ("CONNSTR", $"tcp:{hostip}:{port}");
-
-		// Launch new app
-		//
-		// -v be verbose
-		// -b bundle dir
-		// -a args
-		// -u unbuffered stdout
-		// -L launch app
-		//
-		string exe = "ios-deploy";
-		string args = "-v -L -u -b " + bundle_dir + " -a '" + app_args + "'";
-		Console.WriteLine ("Running: " + exe + " " + args);
-		var process = Process.Start (exe, args);
-		process.WaitForExit ();
-		if (process.ExitCode != 0)
-			Environment.Exit (1);
-
-		//
-		// Read test results from the tcp connection
-		//
-		TextWriter w = new StreamWriter (logfile_name);
-		string result_line = null;
-		TextWriter xml_results_file = null;
-
-		Console.WriteLine ("*** test-runner output ***");
-
-		int wait_time = 0;
-		while (!server.Pending ()) {
-			wait_time += 100;
-			if (wait_time == 30 * 1000) {
-				Console.Error.WriteLine ("Timed out waiting for test runner to connect.");
-				Environment.Exit (1);
-			}
-			Thread.Sleep (100);
-		}
-		var client = server.AcceptTcpClient ();
-		var stream = client.GetStream ();
-		var reader = new StreamReader (stream);
-
-		while (true) {
-			var line = reader.ReadLine ();
-			if (line == null)
-				break;
-			if (line.Contains ("STARTRESULTXML")) {
-				Console.Write ("Getting test result XML data...");
-				xml_results_file = File.CreateText (Path.Combine (Path.GetDirectoryName (bundle_dir), $"TestResult_{bundle_id}.xml"));
-				continue;
-			} else if (line.Contains ("ENDRESULTXML")) {
-				Console.WriteLine ("done");
-				xml_results_file.Close ();
-				xml_results_file = null;
-				continue;
-			}
-			if (xml_results_file != null) {
-				xml_results_file.WriteLine (line);
-				continue;
-			}
-			Console.WriteLine (line);
-			w.WriteLine (line);
-			if (line.Contains ("Tests run:"))
-				result_line = line;
-			// Printed by the runtime
-			if (line.Contains ("Exit code:"))
-				break;
-		}
-		w.Close ();
-
-		if (result_line != null && result_line.Contains ("Errors: 0") && result_line.Contains ("Failures: 0"))
-			Environment.Exit (0);
-		else
-			Environment.Exit (1);
-	}
-}

+ 0 - 295
sdks/ios/test-runner/runner.cs

@@ -1,295 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Net.Sockets;
-#if XUNIT_RUNNER
-using Xunit;
-using Xunit.Abstractions;
-using Xunit.Sdk;
-using System.Xml.Linq;
-#else
-using NUnitLite.Runner;
-using NUnit.Framework.Api;
-using NUnit.Framework.Internal;
-using Mono.Security.Interface;
-#endif
-
-class TcpWriter : TextWriter
-{
-	private static object locker = new object ();
-	private string hostName;
-	private int port;
-
-	private TcpClient client;
-	private NetworkStream stream;
-	private StreamWriter writer;
-
-	public TcpWriter (string hostName, int port)
-	{
-		this.hostName = hostName;
-		this.port = port;
-		this.client = new TcpClient (hostName, port);
-		this.stream = client.GetStream ();
-		this.writer = new StreamWriter (stream);
-	}
-
-	public NetworkStream RawStream { get { return stream; } }
-
-	public override void Write (char value)
-	{
-		lock (locker)
-			writer.Write (value);
-	}
-
-	public override void Write (string value)
-	{
-		lock (locker)
-			writer.Write (value);
-	}
-
-	public override void WriteLine (string value)
-	{
-		lock (locker) {
-			writer.WriteLine (value);
-			writer.Flush ();
-		}
-	}
-
-	public override System.Text.Encoding Encoding
-	{
-		get { return System.Text.Encoding.Default; }
-	}
-}
-
-#if XUNIT_RUNNER
-class DiagnosticTextWriterMessageSink : LongLivedMarshalByRefObject, IMessageSink
-{
-	TextWriter writer;
-
-	public DiagnosticTextWriterMessageSink(TextWriter wr)
-	{
-		writer = wr;
-	}
-
-	public bool OnMessage(IMessageSinkMessage message)
-	{
-		if (message is IDiagnosticMessage diagnosticMessage)
-			writer.WriteLine (diagnosticMessage.Message);
-
-		return true;
-	}
-}
-
-class XunitArgumentsParser
-{
-	public static XunitFilters ParseArgumentsToFilter (Stack<string> arguments)
-	{
-		var filters = new XunitFilters ();
-
-		while (arguments.Count > 0)
-		{
-			var option = arguments.Pop ();
-			if (option.StartsWith ("@")) {  // response file handling
-				var fileName = option.Substring (1);
-				var fileContent = File.ReadAllLines (fileName);
-				foreach (var line in fileContent)
-				{
-					if (line.StartsWith ("#") || String.IsNullOrWhiteSpace (line)) continue;
-
-					var parts = line.Split (" ", StringSplitOptions.RemoveEmptyEntries);
-					for (var i = parts.Length - 1; i >= 0; i--)
-						arguments.Push (parts[i]);
-				}
-				continue;
-			}
-
-			switch (option)
-			{
-				case "-nomethod": filters.ExcludedMethods.Add (arguments.Pop ()); break;
-				case "-noclass": filters.ExcludedClasses.Add (arguments.Pop ()); break;
-				case "-nonamespace": filters.ExcludedNamespaces.Add (arguments.Pop ()); break;
-				case "-notrait": ParseEqualSeparatedArgument (filters.ExcludedTraits, arguments.Pop ()); break;
-				default: throw new ArgumentException ($"Not supported option: '{option}'");
-			};
-		}
-
-		return filters;
-	}
-
-	static void ParseEqualSeparatedArgument (Dictionary<string, List<string>> targetDictionary, string argument)
-	{
-		var parts = argument.Split ('=');
-		if (parts.Length != 2 || string.IsNullOrEmpty (parts[0]) || string.IsNullOrEmpty (parts[1]))
-			throw new ArgumentException (argument);
-
-		var name = parts[0];
-		var value = parts[1];
-		if (targetDictionary.TryGetValue (name, out List<string> excludedTraits)) {
-			excludedTraits.Add (value);
-		} else {
-			targetDictionary[name] = new List<string> { value };
-		}
-	}
-}
-#else
-class MonoSdksTextUI : TextUI,ITestListener
-{
-	public MonoSdksTextUI () : base ()
-	{
-	}
-
-	public MonoSdksTextUI (TextWriter writer) : base (writer)
-	{
-	}
-
-	void ITestListener.TestFinished(ITestResult result)
-	{
-		if (!result.Test.IsSuite) {
-			switch (result.ResultState.Status)
-			{
-				case TestStatus.Passed: Interop.mono_sdks_ui_increment_testcase_result (0); break;
-				case TestStatus.Inconclusive:
-				case TestStatus.Skipped: Interop.mono_sdks_ui_increment_testcase_result (1); break;
-				case TestStatus.Failed: Interop.mono_sdks_ui_increment_testcase_result (2); break;
-			}
-		}
-	}
-}
-#endif
-
-class Interop
-{
-	[System.Runtime.InteropServices.DllImport ("__Internal")]
-	public extern static void mono_sdks_ui_increment_testcase_result (int resultType);
-
-	[System.Runtime.InteropServices.DllImport ("__Internal")]
-	public extern static void mono_sdks_ui_set_test_summary_message (string summaryMessage);
-}
-
-public class TestRunner
-{
-	public static int Main(string[] args) {
-		var arguments = new Stack<string> ();
-		string host = null;
-		int port = 0;
-		bool closeAfterTestRun;
-		bool failed;
-
-		for (var i = args.Length - 1; i >= 0; i--)
-			arguments.Push (args[i]);
-
-		// First argument is the connection string if we're driven by harness.exe, otherwise we're driven by UITests
-		if (arguments.Count > 0 && arguments.Peek ().StartsWith("tcp:", StringComparison.Ordinal)) {
-			var parts = arguments.Pop ().Split (':');
-			if (parts.Length != 3)
-				throw new Exception ();
-			host = parts [1];
-			port = Int32.Parse (parts [2]);
-			closeAfterTestRun = true;
-		} else {
-			closeAfterTestRun = false;
-		}
-
-		// Make sure the TLS subsystem including the DependencyInjector is initialized.
-		// This would normally happen on system startup in
-		// `xamarin-macios/src/ObjcRuntime/Runtime.cs`.
-		MonoTlsProviderFactory.Initialize ();
-
-		// some tests assert having a SynchronizationContext for MONOTOUCH, provide a default one
-		SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ());
-
-#if XUNIT_RUNNER
-		var writer = new TcpWriter (host, port);
-		var assemblyFileName = arguments.Pop ();
-		var filters = XunitArgumentsParser.ParseArgumentsToFilter (arguments);
-		var configuration = new TestAssemblyConfiguration () { ShadowCopy = false };
-		var discoveryOptions = TestFrameworkOptions.ForDiscovery (configuration);
-		var discoverySink = new TestDiscoverySink ();
-		var diagnosticSink = new DiagnosticTextWriterMessageSink (writer);
-		var testOptions = TestFrameworkOptions.ForExecution (configuration);
-		var testSink = new TestMessageSink ();
-		var controller = new XunitFrontController (AppDomainSupport.Denied, assemblyFileName, configFileName: null, shadowCopy: false, diagnosticMessageSink: diagnosticSink);
-
-		Interop.mono_sdks_ui_set_test_summary_message ($"Running {assemblyFileName}...");
-
-		writer.WriteLine ($"Discovering tests for {assemblyFileName}");
-		controller.Find (includeSourceInformation: false, discoverySink, discoveryOptions);
-		discoverySink.Finished.WaitOne ();
-		var testCasesToRun = discoverySink.TestCases.Where (filters.Filter).ToList ();
-		writer.WriteLine ($"Discovery finished.");
-
-		var summarySink = new DelegatingExecutionSummarySink (testSink, () => false, (completed, summary) => { writer.WriteLine ($"Tests run: {summary.Total}, Errors: 0, Failures: {summary.Failed}, Skipped: {summary.Skipped}{Environment.NewLine}Time: {TimeSpan.FromSeconds ((double)summary.Time).TotalSeconds}s"); });
-		var resultsXmlAssembly = new XElement ("assembly");
-		var resultsSink = new DelegatingXmlCreationSink (summarySink, resultsXmlAssembly);
-
-		testSink.Execution.TestPassedEvent  += args => { writer.WriteLine ($"[PASS] {args.Message.Test.DisplayName}"); Interop.mono_sdks_ui_increment_testcase_result (0); };
-		testSink.Execution.TestSkippedEvent += args => { writer.WriteLine ($"[SKIP] {args.Message.Test.DisplayName}"); Interop.mono_sdks_ui_increment_testcase_result (1); };
-		testSink.Execution.TestFailedEvent  += args => { writer.WriteLine ($"[FAIL] {args.Message.Test.DisplayName}{Environment.NewLine}{ExceptionUtility.CombineMessages (args.Message)}{Environment.NewLine}{ExceptionUtility.CombineStackTraces (args.Message)}"); Interop.mono_sdks_ui_increment_testcase_result (2); };
-
-		testSink.Execution.TestAssemblyStartingEvent += args => { writer.WriteLine ($"Running tests for {args.Message.TestAssembly.Assembly}"); };
-		testSink.Execution.TestAssemblyFinishedEvent += args => { writer.WriteLine ($"Finished {args.Message.TestAssembly.Assembly}{Environment.NewLine}"); };
-
-		controller.RunTests (testCasesToRun, resultsSink, testOptions);
-		resultsSink.Finished.WaitOne ();
-
-		var resultsXml = new XElement ("assemblies");
-		resultsXml.Add (resultsXmlAssembly);
-		resultsXml.Save (resultsXmlPath);
-
-		if (host != null) {
-			writer.WriteLine ($"STARTRESULTXML");
-			resultsXml.Save (((TcpWriter)writer).RawStream);
-			writer.WriteLine ();
-			writer.WriteLine ($"ENDRESULTXML");
-		}
-
-		failed = resultsSink.ExecutionSummary.Failed > 0 || resultsSink.ExecutionSummary.Errors > 0;
-#else
-		MonoSdksTextUI runner;
-		TextWriter writer = null;
-		string resultsXmlPath = Path.GetTempFileName ();
-		string assemblyFileName = arguments.Peek ();
-
-		if (File.Exists ("nunit-excludes.txt")) {
-			var excludes = File.ReadAllLines ("nunit-excludes.txt");
-			arguments.Push ("-exclude:" + String.Join (",", excludes));
-		}
-
-		arguments.Push ("-labels");
-		arguments.Push ("-format:xunit");
-		arguments.Push ($"-result:{resultsXmlPath}");
-
-		if (host != null) {
-			Console.WriteLine ($"Connecting to harness at {host}:{port}.");
-			writer = new TcpWriter (host, port);
-		} else {
-			writer = ConsoleWriter.Out;
-		}
-
-		Interop.mono_sdks_ui_set_test_summary_message ($"Running {assemblyFileName}...");
-
-		runner = new MonoSdksTextUI (writer);
-		runner.Execute (arguments.ToArray ());
-
-		if (host != null) {
-			writer.WriteLine ($"STARTRESULTXML");
-			using (var resultsXmlStream = File.OpenRead (resultsXmlPath)) resultsXmlStream.CopyTo (((TcpWriter)writer).RawStream);
-			writer.WriteLine ();
-			writer.WriteLine ($"ENDRESULTXML");
-		}
-
-		failed = runner.Failure;
-#endif
-
-		Interop.mono_sdks_ui_set_test_summary_message ($"Summary: {(failed ? "Failed" : "Succeeded")} for {assemblyFileName}.");
-
-		if (!closeAfterTestRun) {
-			Thread.Sleep (Int32.MaxValue);
-		}
-
-		return failed ? 1 : 0;
-	}
-}

+ 0 - 15
sdks/ios/test-runner/xi.cs

@@ -1,15 +0,0 @@
-// Stub Xamarin.iOS.dll assembly to enable System.Net.Http unit tests in Mono SDKs
-
-[assembly:System.Reflection.AssemblyVersionAttribute ("0.0.0.0")]
-[assembly:System.Runtime.CompilerServices.InternalsVisibleTo ("System.Net.Http, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
-
-namespace ObjCRuntime
-{
-	internal class RuntimeOptions
-	{
-		internal static System.Net.Http.HttpMessageHandler GetHttpMessageHandler ()
-		{
-			return new System.Net.Http.HttpClientHandler ();
-		}
-	}
-}

BIN
sdks/ios/test-runner/xi.snk


+ 0 - 17
sdks/paths.mk

@@ -1,17 +0,0 @@
-
-ifneq ($(or $(ENABLE_IOS),$(ENABLE_MAC),$(ENABLE_MACCAT)),)
-
-CheckXcodeDir=$(or $(and $(wildcard $(1))),$(warning Could not find Xcode in "$(1)"))
-
-ifeq ($(call CheckXcodeDir,$(XCODE_DIR)),)
-$(error Could not find Xcode at $(XCODE_DIR))
-endif
-
-endif
-
-ifdef ENABLE_ANDROID
-
-ANDROID_TOOLCHAIN_DIR?=$(HOME)/android-toolchain
-ANDROID_TOOLCHAIN_CACHE_DIR?=$(HOME)/android-archives
-
-endif

+ 0 - 41
sdks/versions.mk

@@ -1,41 +0,0 @@
-
-# MXE
-
-MXE_HASH?=b9cbb53541a0e10fe4fe81f22bd586cb9cdc922a
-
-# Android
-
-ANDROID_BUILD_TOOLS_VERSION?=27
-ANDROID_BUILD_TOOLS_DIR?=28.0.3
-ANDROID_PLATFORM_TOOLS_VERSION?=28.0.2
-ANDROID_NDK_VERSION?=r19c
-ANDROID_CMAKE_VERSION?=3.6.4111459
-ANDROID_SDKTOOLS_VERSION?=4333796
-ANDROID_SDK_VERSION_armeabi?=16
-ANDROID_SDK_VERSION_armeabi-v7a?=16
-ANDROID_SDK_VERSION_arm64-v8a?=21
-ANDROID_SDK_VERSION_x86?=16
-ANDROID_SDK_VERSION_x86_64?=21
-
-# iOS
-
-XCODE_DIR?=/Applications/Xcode.app/Contents/Developer
-XCODE_VERSION:=$(shell /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" $(XCODE_DIR)/../version.plist)
-XCODE_MAJOR_VERSION:=$(word 1, $(subst ., ,$(XCODE_VERSION)))
-
-# min versions of the targets
-MACOS_VERSION_MIN?=10.9
-MACCAT_IOS_VERSION_MIN?=13.0
-IOS_VERSION_MIN?=7.0
-TVOS_VERSION_MIN?=9.0
-WATCHOS_VERSION_MIN?=2.0
-WATCHOS64_32_VERSION_MIN?=5.1
-
-# versions of the platform SDKs, these ship inside of Xcode
-#MACOS_VERSION?=10.13
-#IOS_VERSION?=11.1
-#TVOS_VERSION?=11.1
-#WATCHOS_VERSION?=4.1
-#WATCHOS64_32_VERSION?=5.1
-
-# WebAssembly

+ 0 - 12
sdks/wasm/.gitignore

@@ -1,12 +0,0 @@
-node_modules
-package-lock.json
-.stamp*
-*.wasm
-dotnet.js
-Mono.Cecil*
-emsdk_env.sh
-builds/threads-debug
-builds/threads-release
-.configured
-!DebuggerTestSuite
-nuget.config

+ 0 - 13
sdks/wasm/BrowserDebugHost/BrowserDebugHost.csproj

@@ -1,13 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.0</TargetFramework>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\BrowserDebugProxy\BrowserDebugProxy.csproj" />
-  </ItemGroup>
-
-  <Target Name="GetFilesToPackage" />
-
-</Project>

+ 0 - 40
sdks/wasm/BrowserDebugHost/Program.cs

@@ -1,40 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    public class ProxyOptions
-    {
-        public Uri DevToolsUrl { get; set; } = new Uri("http://localhost:9222");
-    }
-
-    public class Program
-    {
-        public static void Main(string[] args)
-        {
-            var host = new WebHostBuilder()
-                .UseSetting("UseIISIntegration", false.ToString())
-                .UseKestrel()
-                .UseContentRoot(Directory.GetCurrentDirectory())
-                .UseStartup<Startup>()
-                .ConfigureAppConfiguration((hostingContext, config) =>
-                {
-                    config.AddCommandLine(args);
-                })
-                .UseUrls("http://localhost:9300")
-                .Build();
-
-            host.Run();
-        }
-    }
-}

+ 0 - 27
sdks/wasm/BrowserDebugHost/Properties/launchSettings.json

@@ -1,27 +0,0 @@
-{
-  "iisSettings": {
-    "windowsAuthentication": false,
-    "anonymousAuthentication": true,
-    "iisExpress": {
-      "applicationUrl": "http://localhost:58012/",
-      "sslPort": 0
-    }
-  },
-  "profiles": {
-    "IIS Express": {
-      "commandName": "IISExpress",
-      "launchBrowser": true,
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      }
-    },
-    "BrowserDebugHost": {
-      "commandName": "Project",
-      "launchBrowser": true,
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      },
-      "applicationUrl": "http://localhost:58013/"
-    }
-  }
-}

+ 0 - 164
sdks/wasm/BrowserDebugHost/Startup.cs

@@ -1,164 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net.Http;
-using System.Text.Json;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Routing;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    internal class Startup
-    {
-        // This method gets called by the runtime. Use this method to add services to the container.
-        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
-        public void ConfigureServices(IServiceCollection services) =>
-            services.AddRouting()
-            .Configure<ProxyOptions>(Configuration);
-
-        public Startup(IConfiguration configuration) =>
-            Configuration = configuration;
-
-        public IConfiguration Configuration { get; }
-
-        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
-        public void Configure(IApplicationBuilder app, IOptionsMonitor<ProxyOptions> optionsAccessor, IWebHostEnvironment env)
-        {
-            var options = optionsAccessor.CurrentValue;
-            app.UseDeveloperExceptionPage()
-                .UseWebSockets()
-                .UseDebugProxy(options);
-        }
-    }
-
-    static class DebugExtensions
-    {
-        public static Dictionary<string, string> MapValues(Dictionary<string, string> response, HttpContext context, Uri debuggerHost)
-        {
-            var filtered = new Dictionary<string, string>();
-            var request = context.Request;
-
-            foreach (var key in response.Keys)
-            {
-                switch (key)
-                {
-                    case "devtoolsFrontendUrl":
-                        var front = response[key];
-                        filtered[key] = $"{debuggerHost.Scheme}://{debuggerHost.Authority}{front.Replace($"ws={debuggerHost.Authority}", $"ws={request.Host}")}";
-                        break;
-                    case "webSocketDebuggerUrl":
-                        var page = new Uri(response[key]);
-                        filtered[key] = $"{page.Scheme}://{request.Host}{page.PathAndQuery}";
-                        break;
-                    default:
-                        filtered[key] = response[key];
-                        break;
-                }
-            }
-            return filtered;
-        }
-
-        public static IApplicationBuilder UseDebugProxy(this IApplicationBuilder app, ProxyOptions options) =>
-            UseDebugProxy(app, options, MapValues);
-
-        public static IApplicationBuilder UseDebugProxy(
-            this IApplicationBuilder app,
-            ProxyOptions options,
-            Func<Dictionary<string, string>, HttpContext, Uri, Dictionary<string, string>> mapFunc)
-        {
-            var devToolsHost = options.DevToolsUrl;
-            app.UseRouter(router =>
-            {
-                router.MapGet("/", Copy);
-                router.MapGet("/favicon.ico", Copy);
-                router.MapGet("json", RewriteArray);
-                router.MapGet("json/list", RewriteArray);
-                router.MapGet("json/version", RewriteSingle);
-                router.MapGet("json/new", RewriteSingle);
-                router.MapGet("devtools/page/{pageId}", ConnectProxy);
-                router.MapGet("devtools/browser/{pageId}", ConnectProxy);
-
-                string GetEndpoint(HttpContext context)
-                {
-                    var request = context.Request;
-                    var requestPath = request.Path;
-                    return $"{devToolsHost.Scheme}://{devToolsHost.Authority}{request.Path}{request.QueryString}";
-                }
-
-                async Task Copy(HttpContext context)
-                {
-                    using (var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) })
-                    {
-                        var response = await httpClient.GetAsync(GetEndpoint(context));
-                        context.Response.ContentType = response.Content.Headers.ContentType.ToString();
-                        if ((response.Content.Headers.ContentLength ?? 0) > 0)
-                            context.Response.ContentLength = response.Content.Headers.ContentLength;
-                        var bytes = await response.Content.ReadAsByteArrayAsync();
-                        await context.Response.Body.WriteAsync(bytes);
-
-                    }
-                }
-
-                async Task RewriteSingle(HttpContext context)
-                {
-                    var version = await ProxyGetJsonAsync<Dictionary<string, string>>(GetEndpoint(context));
-                    context.Response.ContentType = "application/json";
-                    await context.Response.WriteAsync(
-                        JsonSerializer.Serialize(mapFunc(version, context, devToolsHost)));
-                }
-
-                async Task RewriteArray(HttpContext context)
-                {
-                    var tabs = await ProxyGetJsonAsync<Dictionary<string, string>[]>(GetEndpoint(context));
-                    var alteredTabs = tabs.Select(t => mapFunc(t, context, devToolsHost)).ToArray();
-                    context.Response.ContentType = "application/json";
-                    await context.Response.WriteAsync(JsonSerializer.Serialize(alteredTabs));
-                }
-
-                async Task ConnectProxy(HttpContext context)
-                {
-                    if (!context.WebSockets.IsWebSocketRequest)
-                    {
-                        context.Response.StatusCode = 400;
-                        return;
-                    }
-
-                    var endpoint = new Uri($"ws://{devToolsHost.Authority}{context.Request.Path.ToString()}");
-                    try
-                    {
-                        using var loggerFactory = LoggerFactory.Create(
-                            builder => builder.AddConsole().AddFilter(null, LogLevel.Information));
-                        var proxy = new DebuggerProxy(loggerFactory);
-                        var ideSocket = await context.WebSockets.AcceptWebSocketAsync();
-
-                        await proxy.Run(endpoint, ideSocket);
-                    }
-                    catch (Exception e)
-                    {
-                        Console.WriteLine("got exception {0}", e);
-                    }
-                }
-            });
-            return app;
-        }
-
-        static async Task<T> ProxyGetJsonAsync<T>(string url)
-        {
-            using (var httpClient = new HttpClient())
-            {
-                var response = await httpClient.GetAsync(url);
-                return await JsonSerializer.DeserializeAsync<T>(await response.Content.ReadAsStreamAsync());
-            }
-        }
-    }
-}

+ 0 - 15
sdks/wasm/BrowserDebugProxy/BrowserDebugProxy.csproj

@@ -1,15 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.0</TargetFramework>
-    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.2" />
-    <PackageReference Include="Mono.Cecil" Version="0.11.2" />
-    <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
-    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.5.0" />
-  </ItemGroup>
-
-</Project>

+ 0 - 31
sdks/wasm/BrowserDebugProxy/BrowserDebugProxy.sln

@@ -1,31 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28407.52
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserDebugHost", "..\BrowserDebugHost\BrowserDebugHost.csproj", "{954F768A-23E6-4B14-90E0-27EA6B41FBCC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserDebugProxy", "BrowserDebugProxy.csproj", "{490128B6-9F21-46CA-878A-F22BCF51EF3C}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{954F768A-23E6-4B14-90E0-27EA6B41FBCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{954F768A-23E6-4B14-90E0-27EA6B41FBCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{954F768A-23E6-4B14-90E0-27EA6B41FBCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{954F768A-23E6-4B14-90E0-27EA6B41FBCC}.Release|Any CPU.Build.0 = Release|Any CPU
-		{490128B6-9F21-46CA-878A-F22BCF51EF3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{490128B6-9F21-46CA-878A-F22BCF51EF3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{490128B6-9F21-46CA-878A-F22BCF51EF3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{490128B6-9F21-46CA-878A-F22BCF51EF3C}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {F8BA2C2D-8F28-4F9E-9C54-51E394EF941E}
-	EndGlobalSection
-EndGlobal

+ 0 - 883
sdks/wasm/BrowserDebugProxy/DebugStore.cs

@@ -1,883 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net.Http;
-using System.Runtime.CompilerServices;
-using System.Security.Cryptography;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-using Mono.Cecil.Pdb;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    internal class BreakpointRequest
-    {
-        public string Id { get; private set; }
-        public string Assembly { get; private set; }
-        public string File { get; private set; }
-        public int Line { get; private set; }
-        public int Column { get; private set; }
-        public MethodInfo Method { get; private set; }
-
-        JObject request;
-
-        public bool IsResolved => Assembly != null;
-        public List<Breakpoint> Locations { get; } = new List<Breakpoint>();
-
-        public override string ToString() => $"BreakpointRequest Assembly: {Assembly} File: {File} Line: {Line} Column: {Column}";
-
-        public object AsSetBreakpointByUrlResponse(IEnumerable<object> jsloc) => new { breakpointId = Id, locations = Locations.Select(l => l.Location.AsLocation()).Concat(jsloc) };
-
-        public BreakpointRequest()
-        { }
-
-        public BreakpointRequest(string id, MethodInfo method)
-        {
-            Id = id;
-            Method = method;
-        }
-
-        public BreakpointRequest(string id, JObject request)
-        {
-            Id = id;
-            this.request = request;
-        }
-
-        public static BreakpointRequest Parse(string id, JObject args)
-        {
-            return new BreakpointRequest(id, args);
-        }
-
-        public BreakpointRequest Clone() => new BreakpointRequest { Id = Id, request = request };
-
-        public bool IsMatch(SourceFile sourceFile)
-        {
-            var url = request?["url"]?.Value<string>();
-            if (url == null)
-            {
-                var urlRegex = request?["urlRegex"].Value<string>();
-                var regex = new Regex(urlRegex);
-                return regex.IsMatch(sourceFile.Url.ToString()) || regex.IsMatch(sourceFile.DocUrl);
-            }
-
-            return sourceFile.Url.ToString() == url || sourceFile.DotNetUrl == url;
-        }
-
-        public bool TryResolve(SourceFile sourceFile)
-        {
-            if (!IsMatch(sourceFile))
-                return false;
-
-            var line = request?["lineNumber"]?.Value<int>();
-            var column = request?["columnNumber"]?.Value<int>();
-
-            if (line == null || column == null)
-                return false;
-
-            Assembly = sourceFile.AssemblyName;
-            File = sourceFile.DebuggerFileName;
-            Line = line.Value;
-            Column = column.Value;
-            return true;
-        }
-
-        public bool TryResolve(DebugStore store)
-        {
-            if (request == null || store == null)
-                return false;
-
-            return store.AllSources().FirstOrDefault(source => TryResolve(source)) != null;
-        }
-    }
-
-    internal class VarInfo
-    {
-        public VarInfo(VariableDebugInformation v)
-        {
-            this.Name = v.Name;
-            this.Index = v.Index;
-        }
-
-        public VarInfo(ParameterDefinition p)
-        {
-            this.Name = p.Name;
-            this.Index = (p.Index + 1) * -1;
-        }
-
-        public string Name { get; }
-        public int Index { get; }
-
-        public override string ToString() => $"(var-info [{Index}] '{Name}')";
-    }
-
-    internal class CliLocation
-    {
-        public CliLocation(MethodInfo method, int offset)
-        {
-            Method = method;
-            Offset = offset;
-        }
-
-        public MethodInfo Method { get; }
-        public int Offset { get; }
-    }
-
-    internal class SourceLocation
-    {
-        SourceId id;
-        int line;
-        int column;
-        CliLocation cliLoc;
-
-        public SourceLocation(SourceId id, int line, int column)
-        {
-            this.id = id;
-            this.line = line;
-            this.column = column;
-        }
-
-        public SourceLocation(MethodInfo mi, SequencePoint sp)
-        {
-            this.id = mi.SourceId;
-            this.line = sp.StartLine - 1;
-            this.column = sp.StartColumn - 1;
-            this.cliLoc = new CliLocation(mi, sp.Offset);
-        }
-
-        public SourceId Id { get => id; }
-        public int Line { get => line; }
-        public int Column { get => column; }
-        public CliLocation CliLocation => this.cliLoc;
-
-        public override string ToString() => $"{id}:{Line}:{Column}";
-
-        public static SourceLocation Parse(JObject obj)
-        {
-            if (obj == null)
-                return null;
-
-            if (!SourceId.TryParse(obj["scriptId"]?.Value<string>(), out var id))
-                return null;
-
-            var line = obj["lineNumber"]?.Value<int>();
-            var column = obj["columnNumber"]?.Value<int>();
-            if (id == null || line == null || column == null)
-                return null;
-
-            return new SourceLocation(id, line.Value, column.Value);
-        }
-
-        internal class LocationComparer : EqualityComparer<SourceLocation>
-        {
-            public override bool Equals(SourceLocation l1, SourceLocation l2)
-            {
-                if (l1 == null && l2 == null)
-                    return true;
-                else if (l1 == null || l2 == null)
-                    return false;
-
-                return (l1.Line == l2.Line &&
-                    l1.Column == l2.Column &&
-                    l1.Id == l2.Id);
-            }
-
-            public override int GetHashCode(SourceLocation loc)
-            {
-                int hCode = loc.Line ^ loc.Column;
-                return loc.Id.GetHashCode() ^ hCode.GetHashCode();
-            }
-        }
-
-        internal object AsLocation() => new
-        {
-            scriptId = id.ToString(),
-            lineNumber = line,
-            columnNumber = column
-        };
-    }
-
-    internal class SourceId
-    {
-        const string Scheme = "dotnet://";
-
-        readonly int assembly, document;
-
-        public int Assembly => assembly;
-        public int Document => document;
-
-        internal SourceId(int assembly, int document)
-        {
-            this.assembly = assembly;
-            this.document = document;
-        }
-
-        public SourceId(string id)
-        {
-            if (!TryParse(id, out assembly, out document))
-                throw new ArgumentException("invalid source identifier", nameof(id));
-        }
-
-        public static bool TryParse(string id, out SourceId source)
-        {
-            source = null;
-            if (!TryParse(id, out var assembly, out var document))
-                return false;
-
-            source = new SourceId(assembly, document);
-            return true;
-        }
-
-        static bool TryParse(string id, out int assembly, out int document)
-        {
-            assembly = document = 0;
-            if (id == null || !id.StartsWith(Scheme, StringComparison.Ordinal))
-                return false;
-
-            var sp = id.Substring(Scheme.Length).Split('_');
-            if (sp.Length != 2)
-                return false;
-
-            if (!int.TryParse(sp[0], out assembly))
-                return false;
-
-            if (!int.TryParse(sp[1], out document))
-                return false;
-
-            return true;
-        }
-
-        public override string ToString() => $"{Scheme}{assembly}_{document}";
-
-        public override bool Equals(object obj)
-        {
-            if (obj == null)
-                return false;
-            SourceId that = obj as SourceId;
-            return that.assembly == this.assembly && that.document == this.document;
-        }
-
-        public override int GetHashCode() => assembly.GetHashCode() ^ document.GetHashCode();
-
-        public static bool operator ==(SourceId a, SourceId b) => ((object)a == null) ? (object)b == null : a.Equals(b);
-
-        public static bool operator !=(SourceId a, SourceId b) => !a.Equals(b);
-    }
-
-    internal class MethodInfo
-    {
-        MethodDefinition methodDef;
-        SourceFile source;
-
-        public SourceId SourceId => source.SourceId;
-
-        public string Name => methodDef.Name;
-        public MethodDebugInformation DebugInformation => methodDef.DebugInformation;
-
-        public SourceLocation StartLocation { get; }
-        public SourceLocation EndLocation { get; }
-        public AssemblyInfo Assembly { get; }
-        public uint Token => methodDef.MetadataToken.RID;
-
-        public MethodInfo(AssemblyInfo assembly, MethodDefinition methodDef, SourceFile source)
-        {
-            this.Assembly = assembly;
-            this.methodDef = methodDef;
-            this.source = source;
-
-            var sps = DebugInformation.SequencePoints;
-            if (sps == null || sps.Count() < 1)
-                return;
-
-            SequencePoint start = sps[0];
-            SequencePoint end = sps[0];
-
-            foreach (var sp in sps)
-            {
-                if (sp.StartLine < start.StartLine)
-                    start = sp;
-                else if (sp.StartLine == start.StartLine && sp.StartColumn < start.StartColumn)
-                    start = sp;
-
-                if (sp.EndLine > end.EndLine)
-                    end = sp;
-                else if (sp.EndLine == end.EndLine && sp.EndColumn > end.EndColumn)
-                    end = sp;
-            }
-
-            StartLocation = new SourceLocation(this, start);
-            EndLocation = new SourceLocation(this, end);
-        }
-
-        public SourceLocation GetLocationByIl(int pos)
-        {
-            SequencePoint prev = null;
-            foreach (var sp in DebugInformation.SequencePoints)
-            {
-                if (sp.Offset > pos)
-                    break;
-                prev = sp;
-            }
-
-            if (prev != null)
-                return new SourceLocation(this, prev);
-
-            return null;
-        }
-
-        public VarInfo[] GetLiveVarsAt(int offset)
-        {
-            var res = new List<VarInfo>();
-
-            res.AddRange(methodDef.Parameters.Select(p => new VarInfo(p)));
-            res.AddRange(methodDef.DebugInformation.GetScopes()
-                .Where(s => s.Start.Offset <= offset && (s.End.IsEndOfMethod || s.End.Offset > offset))
-                .SelectMany(s => s.Variables)
-                .Where(v => !v.IsDebuggerHidden)
-                .Select(v => new VarInfo(v)));
-
-            return res.ToArray();
-        }
-
-        public override string ToString() => "MethodInfo(" + methodDef.FullName + ")";
-    }
-
-    internal class TypeInfo
-    {
-        AssemblyInfo assembly;
-        TypeDefinition type;
-        List<MethodInfo> methods;
-
-        public TypeInfo(AssemblyInfo assembly, TypeDefinition type)
-        {
-            this.assembly = assembly;
-            this.type = type;
-            methods = new List<MethodInfo>();
-        }
-
-        public string Name => type.Name;
-        public string FullName => type.FullName;
-        public List<MethodInfo> Methods => methods;
-
-        public override string ToString() => "TypeInfo('" + FullName + "')";
-    }
-
-    class AssemblyInfo
-    {
-        static int next_id;
-        ModuleDefinition image;
-        readonly int id;
-        readonly ILogger logger;
-        Dictionary<uint, MethodInfo> methods = new Dictionary<uint, MethodInfo>();
-        Dictionary<string, string> sourceLinkMappings = new Dictionary<string, string>();
-        Dictionary<string, TypeInfo> typesByName = new Dictionary<string, TypeInfo>();
-        readonly List<SourceFile> sources = new List<SourceFile>();
-        internal string Url { get; }
-
-        public AssemblyInfo(IAssemblyResolver resolver, string url, byte[] assembly, byte[] pdb)
-        {
-            this.id = Interlocked.Increment(ref next_id);
-
-            try
-            {
-                Url = url;
-                ReaderParameters rp = new ReaderParameters( /*ReadingMode.Immediate*/ );
-                rp.AssemblyResolver = resolver;
-                // set ReadSymbols = true unconditionally in case there
-                // is an embedded pdb then handle ArgumentException
-                // and assume that if pdb == null that is the cause
-                rp.ReadSymbols = true;
-                rp.SymbolReaderProvider = new PdbReaderProvider();
-                if (pdb != null)
-                    rp.SymbolStream = new MemoryStream(pdb);
-                rp.ReadingMode = ReadingMode.Immediate;
-
-                this.image = ModuleDefinition.ReadModule(new MemoryStream(assembly), rp);
-            }
-            catch (BadImageFormatException ex)
-            {
-                logger.LogWarning($"Failed to read assembly as portable PDB: {ex.Message}");
-            }
-            catch (ArgumentException)
-            {
-                // if pdb == null this is expected and we
-                // read the assembly without symbols below
-                if (pdb != null)
-                    throw;
-            }
-
-            if (this.image == null)
-            {
-                ReaderParameters rp = new ReaderParameters( /*ReadingMode.Immediate*/ );
-                rp.AssemblyResolver = resolver;
-                if (pdb != null)
-                {
-                    rp.ReadSymbols = true;
-                    rp.SymbolReaderProvider = new PdbReaderProvider();
-                    rp.SymbolStream = new MemoryStream(pdb);
-                }
-
-                rp.ReadingMode = ReadingMode.Immediate;
-
-                this.image = ModuleDefinition.ReadModule(new MemoryStream(assembly), rp);
-            }
-
-            Populate();
-        }
-
-        public AssemblyInfo(ILogger logger)
-        {
-            this.logger = logger;
-        }
-
-        void Populate()
-        {
-            ProcessSourceLink();
-
-            var d2s = new Dictionary<Document, SourceFile>();
-
-            SourceFile FindSource(Document doc)
-            {
-                if (doc == null)
-                    return null;
-
-                if (d2s.TryGetValue(doc, out var source))
-                    return source;
-
-                var src = new SourceFile(this, sources.Count, doc, GetSourceLinkUrl(doc.Url));
-                sources.Add(src);
-                d2s[doc] = src;
-                return src;
-            };
-
-            foreach (var type in image.GetTypes())
-            {
-                var typeInfo = new TypeInfo(this, type);
-                typesByName[type.FullName] = typeInfo;
-
-                foreach (var method in type.Methods)
-                {
-                    foreach (var sp in method.DebugInformation.SequencePoints)
-                    {
-                        var source = FindSource(sp.Document);
-                        var methodInfo = new MethodInfo(this, method, source);
-                        methods[method.MetadataToken.RID] = methodInfo;
-                        if (source != null)
-                            source.AddMethod(methodInfo);
-
-                        typeInfo.Methods.Add(methodInfo);
-                    }
-                }
-            }
-        }
-
-        private void ProcessSourceLink()
-        {
-            var sourceLinkDebugInfo = image.CustomDebugInformations.FirstOrDefault(i => i.Kind == CustomDebugInformationKind.SourceLink);
-
-            if (sourceLinkDebugInfo != null)
-            {
-                var sourceLinkContent = ((SourceLinkDebugInformation)sourceLinkDebugInfo).Content;
-
-                if (sourceLinkContent != null)
-                {
-                    var jObject = JObject.Parse(sourceLinkContent)["documents"];
-                    sourceLinkMappings = JsonConvert.DeserializeObject<Dictionary<string, string>>(jObject.ToString());
-                }
-            }
-        }
-
-        private Uri GetSourceLinkUrl(string document)
-        {
-            if (sourceLinkMappings.TryGetValue(document, out string url))
-                return new Uri(url);
-
-            foreach (var sourceLinkDocument in sourceLinkMappings)
-            {
-                string key = sourceLinkDocument.Key;
-
-                if (Path.GetFileName(key) != "*")
-                {
-                    continue;
-                }
-
-                var keyTrim = key.TrimEnd('*');
-
-                if (document.StartsWith(keyTrim, StringComparison.OrdinalIgnoreCase))
-                {
-                    var docUrlPart = document.Replace(keyTrim, "");
-                    return new Uri(sourceLinkDocument.Value.TrimEnd('*') + docUrlPart);
-                }
-            }
-
-            return null;
-        }
-
-        public IEnumerable<SourceFile> Sources => this.sources;
-
-        public Dictionary<string, TypeInfo> TypesByName => this.typesByName;
-        public int Id => id;
-        public string Name => image.Name;
-
-        public SourceFile GetDocById(int document)
-        {
-            return sources.FirstOrDefault(s => s.SourceId.Document == document);
-        }
-
-        public MethodInfo GetMethodByToken(uint token)
-        {
-            methods.TryGetValue(token, out var value);
-            return value;
-        }
-
-        public TypeInfo GetTypeByName(string name)
-        {
-            typesByName.TryGetValue(name, out var res);
-            return res;
-        }
-    }
-
-    internal class SourceFile
-    {
-        Dictionary<uint, MethodInfo> methods;
-        AssemblyInfo assembly;
-        int id;
-        Document doc;
-
-        internal SourceFile(AssemblyInfo assembly, int id, Document doc, Uri sourceLinkUri)
-        {
-            this.methods = new Dictionary<uint, MethodInfo>();
-            this.SourceLinkUri = sourceLinkUri;
-            this.assembly = assembly;
-            this.id = id;
-            this.doc = doc;
-            this.DebuggerFileName = doc.Url.Replace("\\", "/").Replace(":", "");
-
-            this.SourceUri = new Uri((Path.IsPathRooted(doc.Url) ? "file://" : "") + doc.Url, UriKind.RelativeOrAbsolute);
-            if (SourceUri.IsFile && File.Exists(SourceUri.LocalPath))
-            {
-                this.Url = this.SourceUri.ToString();
-            }
-            else
-            {
-                this.Url = DotNetUrl;
-            }
-        }
-
-        internal void AddMethod(MethodInfo mi)
-        {
-            if (!this.methods.ContainsKey(mi.Token))
-                this.methods[mi.Token] = mi;
-        }
-
-        public string DebuggerFileName { get; }
-        public string Url { get; }
-        public string AssemblyName => assembly.Name;
-        public string DotNetUrl => $"dotnet://{assembly.Name}/{DebuggerFileName}";
-
-        public SourceId SourceId => new SourceId(assembly.Id, this.id);
-        public Uri SourceLinkUri { get; }
-        public Uri SourceUri { get; }
-
-        public IEnumerable<MethodInfo> Methods => this.methods.Values;
-
-        public string DocUrl => doc.Url;
-
-        public (int startLine, int startColumn, int endLine, int endColumn) GetExtents()
-        {
-            var start = Methods.OrderBy(m => m.StartLocation.Line).ThenBy(m => m.StartLocation.Column).First();
-            var end = Methods.OrderByDescending(m => m.EndLocation.Line).ThenByDescending(m => m.EndLocation.Column).First();
-            return (start.StartLocation.Line, start.StartLocation.Column, end.EndLocation.Line, end.EndLocation.Column);
-        }
-
-        async Task<MemoryStream> GetDataAsync(Uri uri, CancellationToken token)
-        {
-            var mem = new MemoryStream();
-            try
-            {
-                if (uri.IsFile && File.Exists(uri.LocalPath))
-                {
-                    using (var file = File.Open(SourceUri.LocalPath, FileMode.Open))
-                    {
-                        await file.CopyToAsync(mem, token).ConfigureAwait(false);
-                        mem.Position = 0;
-                    }
-                }
-                else if (uri.Scheme == "http" || uri.Scheme == "https")
-                {
-                    var client = new HttpClient();
-                    using (var stream = await client.GetStreamAsync(uri))
-                    {
-                        await stream.CopyToAsync(mem, token).ConfigureAwait(false);
-                        mem.Position = 0;
-                    }
-                }
-            }
-            catch (Exception)
-            {
-                return null;
-            }
-            return mem;
-        }
-
-        static HashAlgorithm GetHashAlgorithm(DocumentHashAlgorithm algorithm)
-        {
-            switch (algorithm)
-            {
-                case DocumentHashAlgorithm.SHA1:
-                    return SHA1.Create();
-                case DocumentHashAlgorithm.SHA256:
-                    return SHA256.Create();
-                case DocumentHashAlgorithm.MD5:
-                    return MD5.Create();
-            }
-            return null;
-        }
-
-        bool CheckPdbHash(byte[] computedHash)
-        {
-            if (computedHash.Length != doc.Hash.Length)
-                return false;
-
-            for (var i = 0; i < computedHash.Length; i++)
-                if (computedHash[i] != doc.Hash[i])
-                    return false;
-
-            return true;
-        }
-
-        byte[] ComputePdbHash(Stream sourceStream)
-        {
-            var algorithm = GetHashAlgorithm(doc.HashAlgorithm);
-            if (algorithm != null)
-                using (algorithm)
-                    return algorithm.ComputeHash(sourceStream);
-
-            return Array.Empty<byte>();
-        }
-
-        public async Task<Stream> GetSourceAsync(bool checkHash, CancellationToken token = default(CancellationToken))
-        {
-            if (doc.EmbeddedSource.Length > 0)
-                return new MemoryStream(doc.EmbeddedSource, false);
-
-            foreach (var url in new[] { SourceUri, SourceLinkUri })
-            {
-                var mem = await GetDataAsync(url, token).ConfigureAwait(false);
-                if (mem != null && (!checkHash || CheckPdbHash(ComputePdbHash(mem))))
-                {
-                    mem.Position = 0;
-                    return mem;
-                }
-            }
-
-            return MemoryStream.Null;
-        }
-
-        public object ToScriptSource(int executionContextId, object executionContextAuxData)
-        {
-            return new
-            {
-                scriptId = SourceId.ToString(),
-                url = Url,
-                executionContextId,
-                executionContextAuxData,
-                //hash:  should be the v8 hash algo, managed implementation is pending
-                dotNetUrl = DotNetUrl,
-            };
-        }
-    }
-
-    internal class DebugStore
-    {
-        List<AssemblyInfo> assemblies = new List<AssemblyInfo>();
-        readonly HttpClient client;
-        readonly ILogger logger;
-
-        public DebugStore(ILogger logger, HttpClient client)
-        {
-            this.client = client;
-            this.logger = logger;
-        }
-
-        public DebugStore(ILogger logger) : this(logger, new HttpClient())
-        { }
-
-        class DebugItem
-        {
-            public string Url { get; set; }
-            public Task<byte[][]> Data { get; set; }
-        }
-
-        public async IAsyncEnumerable<SourceFile> Load(SessionId sessionId, string[] loaded_files, [EnumeratorCancellation] CancellationToken token)
-        {
-            static bool MatchPdb(string asm, string pdb) => Path.ChangeExtension(asm, "pdb") == pdb;
-
-            var asm_files = new List<string>();
-            var pdb_files = new List<string>();
-            foreach (var file_name in loaded_files)
-            {
-                if (file_name.EndsWith(".pdb", StringComparison.OrdinalIgnoreCase))
-                    pdb_files.Add(file_name);
-                else
-                    asm_files.Add(file_name);
-            }
-
-            List<DebugItem> steps = new List<DebugItem>();
-            foreach (var url in asm_files)
-            {
-                try
-                {
-                    var pdb = pdb_files.FirstOrDefault(n => MatchPdb(url, n));
-                    steps.Add(
-                        new DebugItem
-                        {
-                            Url = url,
-                            Data = Task.WhenAll(client.GetByteArrayAsync(url), pdb != null ? client.GetByteArrayAsync(pdb) : Task.FromResult<byte[]>(null))
-                        });
-                }
-                catch (Exception e)
-                {
-                    logger.LogDebug($"Failed to read {url} ({e.Message})");
-                }
-            }
-
-            var resolver = new DefaultAssemblyResolver();
-            foreach (var step in steps)
-            {
-                AssemblyInfo assembly = null;
-                try
-                {
-                    var bytes = await step.Data.ConfigureAwait(false);
-                    assembly = new AssemblyInfo(resolver, step.Url, bytes[0], bytes[1]);
-                }
-                catch (Exception e)
-                {
-                    logger.LogDebug($"Failed to load {step.Url} ({e.Message})");
-                }
-                if (assembly == null)
-                    continue;
-
-                assemblies.Add(assembly);
-                foreach (var source in assembly.Sources)
-                    yield return source;
-            }
-        }
-
-        public IEnumerable<SourceFile> AllSources() => assemblies.SelectMany(a => a.Sources);
-
-        public SourceFile GetFileById(SourceId id) => AllSources().SingleOrDefault(f => f.SourceId.Equals(id));
-
-        public AssemblyInfo GetAssemblyByName(string name) => assemblies.FirstOrDefault(a => a.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
-
-        /*
-        V8 uses zero based indexing for both line and column.
-        PPDBs uses one based indexing for both line and column.
-        */
-        static bool Match(SequencePoint sp, SourceLocation start, SourceLocation end)
-        {
-            var spStart = (Line: sp.StartLine - 1, Column: sp.StartColumn - 1);
-            var spEnd = (Line: sp.EndLine - 1, Column: sp.EndColumn - 1);
-
-            if (start.Line > spEnd.Line)
-                return false;
-
-            if (start.Column > spEnd.Column && start.Line == spEnd.Line)
-                return false;
-
-            if (end.Line < spStart.Line)
-                return false;
-
-            if (end.Column < spStart.Column && end.Line == spStart.Line)
-                return false;
-
-            return true;
-        }
-
-        public List<SourceLocation> FindPossibleBreakpoints(SourceLocation start, SourceLocation end)
-        {
-            //XXX FIXME no idea what todo with locations on different files
-            if (start.Id != end.Id)
-            {
-                logger.LogDebug($"FindPossibleBreakpoints: documents differ (start: {start.Id}) (end {end.Id}");
-                return null;
-            }
-
-            var sourceId = start.Id;
-
-            var doc = GetFileById(sourceId);
-
-            var res = new List<SourceLocation>();
-            if (doc == null)
-            {
-                logger.LogDebug($"Could not find document {sourceId}");
-                return res;
-            }
-
-            foreach (var method in doc.Methods)
-            {
-                foreach (var sequencePoint in method.DebugInformation.SequencePoints)
-                {
-                    if (!sequencePoint.IsHidden && Match(sequencePoint, start, end))
-                        res.Add(new SourceLocation(method, sequencePoint));
-                }
-            }
-            return res;
-        }
-
-        /*
-        V8 uses zero based indexing for both line and column.
-        PPDBs uses one based indexing for both line and column.
-        */
-        static bool Match(SequencePoint sp, int line, int column)
-        {
-            var bp = (line: line + 1, column: column + 1);
-
-            if (sp.StartLine > bp.line || sp.EndLine < bp.line)
-                return false;
-
-            //Chrome sends a zero column even if getPossibleBreakpoints say something else
-            if (column == 0)
-                return true;
-
-            if (sp.StartColumn > bp.column && sp.StartLine == bp.line)
-                return false;
-
-            if (sp.EndColumn < bp.column && sp.EndLine == bp.line)
-                return false;
-
-            return true;
-        }
-
-        public IEnumerable<SourceLocation> FindBreakpointLocations(BreakpointRequest request)
-        {
-            request.TryResolve(this);
-
-            var asm = assemblies.FirstOrDefault(a => a.Name.Equals(request.Assembly, StringComparison.OrdinalIgnoreCase));
-            var sourceFile = asm?.Sources?.SingleOrDefault(s => s.DebuggerFileName.Equals(request.File, StringComparison.OrdinalIgnoreCase));
-
-            if (sourceFile == null)
-                yield break;
-
-            foreach (var method in sourceFile.Methods)
-            {
-                foreach (var sequencePoint in method.DebugInformation.SequencePoints)
-                {
-                    if (!sequencePoint.IsHidden && Match(sequencePoint, request.Line, request.Column))
-                        yield return new SourceLocation(method, sequencePoint);
-                }
-            }
-        }
-
-        public string ToUrl(SourceLocation location) => location != null ? GetFileById(location.Id).Url : "";
-    }
-}

+ 0 - 29
sdks/wasm/BrowserDebugProxy/DebuggerProxy.cs

@@ -1,29 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Net.WebSockets;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-
-    // This type is the public entrypoint that allows external code to attach the debugger proxy
-    // to a given websocket listener. Everything else in this package can be internal.
-
-    public class DebuggerProxy
-    {
-        private readonly MonoProxy proxy;
-
-        public DebuggerProxy(ILoggerFactory loggerFactory)
-        {
-            proxy = new MonoProxy(loggerFactory);
-        }
-
-        public Task Run(Uri browserUri, WebSocket ideSocket)
-        {
-            return proxy.Run(browserUri, ideSocket);
-        }
-    }
-}

+ 0 - 329
sdks/wasm/BrowserDebugProxy/DevToolsHelper.cs

@@ -1,329 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-
-    public struct SessionId
-    {
-        public readonly string sessionId;
-
-        public SessionId(string sessionId)
-        {
-            this.sessionId = sessionId;
-        }
-
-        // hashset treats 0 as unset
-        public override int GetHashCode() => sessionId?.GetHashCode() ?? -1;
-
-        public override bool Equals(object obj) => (obj is SessionId) ? ((SessionId)obj).sessionId == sessionId : false;
-
-        public static bool operator ==(SessionId a, SessionId b) => a.sessionId == b.sessionId;
-
-        public static bool operator !=(SessionId a, SessionId b) => a.sessionId != b.sessionId;
-
-        public static SessionId Null { get; } = new SessionId();
-
-        public override string ToString() => $"session-{sessionId}";
-    }
-
-    public struct MessageId
-    {
-        public readonly string sessionId;
-        public readonly int id;
-
-        public MessageId(string sessionId, int id)
-        {
-            this.sessionId = sessionId;
-            this.id = id;
-        }
-
-        public static implicit operator SessionId(MessageId id) => new SessionId(id.sessionId);
-
-        public override string ToString() => $"msg-{sessionId}:::{id}";
-
-        public override int GetHashCode() => (sessionId?.GetHashCode() ?? 0) ^ id.GetHashCode();
-
-        public override bool Equals(object obj) => (obj is MessageId) ? ((MessageId)obj).sessionId == sessionId && ((MessageId)obj).id == id : false;
-    }
-
-    internal class DotnetObjectId
-    {
-        public string Scheme { get; }
-        public string Value { get; }
-
-        public static bool TryParse(JToken jToken, out DotnetObjectId objectId) => TryParse(jToken?.Value<string>(), out objectId);
-
-        public static bool TryParse(string id, out DotnetObjectId objectId)
-        {
-            objectId = null;
-            if (id == null)
-                return false;
-
-            if (!id.StartsWith("dotnet:"))
-                return false;
-
-            var parts = id.Split(":", 3);
-
-            if (parts.Length < 3)
-                return false;
-
-            objectId = new DotnetObjectId(parts[1], parts[2]);
-
-            return true;
-        }
-
-        public DotnetObjectId(string scheme, string value)
-        {
-            Scheme = scheme;
-            Value = value;
-        }
-
-        public override string ToString() => $"dotnet:{Scheme}:{Value}";
-    }
-
-    public struct Result
-    {
-        public JObject Value { get; private set; }
-        public JObject Error { get; private set; }
-
-        public bool IsOk => Value != null;
-        public bool IsErr => Error != null;
-
-        Result(JObject result, JObject error)
-        {
-            if (result != null && error != null)
-                throw new ArgumentException($"Both {nameof(result)} and {nameof(error)} arguments cannot be non-null.");
-
-            bool resultHasError = String.Compare((result?["result"] as JObject)?["subtype"]?.Value<string>(), "error") == 0;
-            if (result != null && resultHasError)
-            {
-                this.Value = null;
-                this.Error = result;
-            }
-            else
-            {
-                this.Value = result;
-                this.Error = error;
-            }
-        }
-
-        public static Result FromJson(JObject obj)
-        {
-            //Log ("protocol", $"from result: {obj}");
-            return new Result(obj["result"] as JObject, obj["error"] as JObject);
-        }
-
-        public static Result Ok(JObject ok) => new Result(ok, null);
-
-        public static Result OkFromObject(object ok) => Ok(JObject.FromObject(ok));
-
-        public static Result Err(JObject err) => new Result(null, err);
-
-        public static Result Err(string msg) => new Result(null, JObject.FromObject(new { message = msg }));
-
-        public static Result Exception(Exception e) => new Result(null, JObject.FromObject(new { message = e.Message }));
-
-        public JObject ToJObject(MessageId target)
-        {
-            if (IsOk)
-            {
-                return JObject.FromObject(new
-                {
-                    target.id,
-                    target.sessionId,
-                    result = Value
-                });
-            }
-            else
-            {
-                return JObject.FromObject(new
-                {
-                    target.id,
-                    target.sessionId,
-                    error = Error
-                });
-            }
-        }
-
-        public override string ToString()
-        {
-            return $"[Result: IsOk: {IsOk}, IsErr: {IsErr}, Value: {Value?.ToString()}, Error: {Error?.ToString()} ]";
-        }
-    }
-
-    internal class MonoCommands
-    {
-        public string expression { get; set; }
-        public string objectGroup { get; set; } = "mono-debugger";
-        public bool includeCommandLineAPI { get; set; } = false;
-        public bool silent { get; set; } = false;
-        public bool returnByValue { get; set; } = true;
-
-        public MonoCommands(string expression) => this.expression = expression;
-
-        public static MonoCommands GetCallStack() => new MonoCommands("MONO.mono_wasm_get_call_stack()");
-
-        public static MonoCommands GetExceptionObject() => new MonoCommands("MONO.mono_wasm_get_exception_object()");
-
-        public static MonoCommands IsRuntimeReady() => new MonoCommands("MONO.mono_wasm_runtime_is_ready");
-
-        public static MonoCommands StartSingleStepping(StepKind kind) => new MonoCommands($"MONO.mono_wasm_start_single_stepping ({(int)kind})");
-
-        public static MonoCommands GetLoadedFiles() => new MonoCommands("MONO.mono_wasm_get_loaded_files()");
-
-        public static MonoCommands ClearAllBreakpoints() => new MonoCommands("MONO.mono_wasm_clear_all_breakpoints()");
-
-        public static MonoCommands GetDetails(DotnetObjectId objectId, JToken args = null) => new MonoCommands($"MONO.mono_wasm_get_details ('{objectId}', {(args ?? "{ }")})");
-
-        public static MonoCommands GetScopeVariables(int scopeId, params VarInfo[] vars)
-        {
-            var var_ids = vars.Select(v => new { index = v.Index, name = v.Name }).ToArray();
-            return new MonoCommands($"MONO.mono_wasm_get_variables({scopeId}, {JsonConvert.SerializeObject(var_ids)})");
-        }
-
-        public static MonoCommands EvaluateMemberAccess(int scopeId, string expr, params VarInfo[] vars)
-        {
-            var var_ids = vars.Select(v => new { index = v.Index, name = v.Name }).ToArray();
-            return new MonoCommands($"MONO.mono_wasm_eval_member_access({scopeId}, {JsonConvert.SerializeObject(var_ids)}, '', '{expr}')");
-        }
-
-        public static MonoCommands SetBreakpoint(string assemblyName, uint methodToken, int ilOffset) => new MonoCommands($"MONO.mono_wasm_set_breakpoint (\"{assemblyName}\", {methodToken}, {ilOffset})");
-
-        public static MonoCommands RemoveBreakpoint(int breakpointId) => new MonoCommands($"MONO.mono_wasm_remove_breakpoint({breakpointId})");
-
-        public static MonoCommands ReleaseObject(DotnetObjectId objectId) => new MonoCommands($"MONO.mono_wasm_release_object('{objectId}')");
-
-        public static MonoCommands CallFunctionOn(JToken args) => new MonoCommands($"MONO.mono_wasm_call_function_on ({args.ToString()})");
-
-        public static MonoCommands Resume() => new MonoCommands($"MONO.mono_wasm_debugger_resume ()");
-
-        public static MonoCommands SetPauseOnExceptions(string state) => new MonoCommands($"MONO.mono_wasm_set_pause_on_exceptions(\"{state}\")");
-    }
-
-    internal enum MonoErrorCodes
-    {
-        BpNotFound = 100000,
-    }
-
-    internal class MonoConstants
-    {
-        public const string RUNTIME_IS_READY = "mono_wasm_runtime_ready";
-    }
-
-    class Frame
-    {
-        public Frame(MethodInfo method, SourceLocation location, int id)
-        {
-            this.Method = method;
-            this.Location = location;
-            this.Id = id;
-        }
-
-        public MethodInfo Method { get; private set; }
-        public SourceLocation Location { get; private set; }
-        public int Id { get; private set; }
-    }
-
-    class Breakpoint
-    {
-        public SourceLocation Location { get; private set; }
-        public int RemoteId { get; set; }
-        public BreakpointState State { get; set; }
-        public string StackId { get; private set; }
-
-        public static bool TryParseId(string stackId, out int id)
-        {
-            id = -1;
-            if (stackId?.StartsWith("dotnet:", StringComparison.Ordinal) != true)
-                return false;
-
-            return int.TryParse(stackId.Substring("dotnet:".Length), out id);
-        }
-
-        public Breakpoint(string stackId, SourceLocation loc, BreakpointState state)
-        {
-            this.StackId = stackId;
-            this.Location = loc;
-            this.State = state;
-        }
-    }
-
-    enum BreakpointState
-    {
-        Active,
-        Disabled,
-        Pending
-    }
-
-    enum StepKind
-    {
-        Into,
-        Out,
-        Over
-    }
-
-    internal class ExecutionContext
-    {
-        public string DebuggerId { get; set; }
-        public Dictionary<string, BreakpointRequest> BreakpointRequests { get; } = new Dictionary<string, BreakpointRequest>();
-
-        public TaskCompletionSource<DebugStore> ready = null;
-        public bool IsRuntimeReady => ready != null && ready.Task.IsCompleted;
-
-        public int Id { get; set; }
-        public object AuxData { get; set; }
-
-        public List<Frame> CallStack { get; set; }
-
-        public string[] LoadedFiles { get; set; }
-        internal DebugStore store;
-        public TaskCompletionSource<DebugStore> Source { get; } = new TaskCompletionSource<DebugStore>();
-
-        Dictionary<int, PerScopeCache> perScopeCaches { get; } = new Dictionary<int, PerScopeCache>();
-
-        public DebugStore Store
-        {
-            get
-            {
-                if (store == null || !Source.Task.IsCompleted)
-                    return null;
-
-                return store;
-            }
-        }
-
-        public PerScopeCache GetCacheForScope(int scope_id)
-        {
-            if (perScopeCaches.TryGetValue(scope_id, out var cache))
-                return cache;
-
-            cache = new PerScopeCache();
-            perScopeCaches[scope_id] = cache;
-            return cache;
-        }
-
-        public void ClearState()
-        {
-            CallStack = null;
-            perScopeCaches.Clear();
-        }
-    }
-
-    internal class PerScopeCache
-    {
-        public Dictionary<string, JObject> Locals { get; } = new Dictionary<string, JObject>();
-        public Dictionary<string, JObject> MemberReferences { get; } = new Dictionary<string, JObject>();
-    }
-}

+ 0 - 381
sdks/wasm/BrowserDebugProxy/DevToolsProxy.cs

@@ -1,381 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net.WebSockets;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-
-    class DevToolsQueue
-    {
-        Task current_send;
-        List<byte[]> pending;
-
-        public WebSocket Ws { get; private set; }
-        public Task CurrentSend { get { return current_send; } }
-        public DevToolsQueue(WebSocket sock)
-        {
-            this.Ws = sock;
-            pending = new List<byte[]>();
-        }
-
-        public Task Send(byte[] bytes, CancellationToken token)
-        {
-            pending.Add(bytes);
-            if (pending.Count == 1)
-            {
-                if (current_send != null)
-                    throw new Exception("current_send MUST BE NULL IF THERE'S no pending send");
-                //logger.LogTrace ("sending {0} bytes", bytes.Length);
-                current_send = Ws.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Text, true, token);
-                return current_send;
-            }
-            return null;
-        }
-
-        public Task Pump(CancellationToken token)
-        {
-            current_send = null;
-            pending.RemoveAt(0);
-
-            if (pending.Count > 0)
-            {
-                if (current_send != null)
-                    throw new Exception("current_send MUST BE NULL IF THERE'S no pending send");
-
-                current_send = Ws.SendAsync(new ArraySegment<byte>(pending[0]), WebSocketMessageType.Text, true, token);
-                return current_send;
-            }
-            return null;
-        }
-    }
-
-    internal class DevToolsProxy
-    {
-        TaskCompletionSource<bool> side_exception = new TaskCompletionSource<bool>();
-        TaskCompletionSource<bool> client_initiated_close = new TaskCompletionSource<bool>();
-        Dictionary<MessageId, TaskCompletionSource<Result>> pending_cmds = new Dictionary<MessageId, TaskCompletionSource<Result>>();
-        ClientWebSocket browser;
-        WebSocket ide;
-        int next_cmd_id;
-        List<Task> pending_ops = new List<Task>();
-        List<DevToolsQueue> queues = new List<DevToolsQueue>();
-
-        protected readonly ILogger logger;
-
-        public DevToolsProxy(ILoggerFactory loggerFactory)
-        {
-            logger = loggerFactory.CreateLogger<DevToolsProxy>();
-        }
-
-        protected virtual Task<bool> AcceptEvent(SessionId sessionId, string method, JObject args, CancellationToken token)
-        {
-            return Task.FromResult(false);
-        }
-
-        protected virtual Task<bool> AcceptCommand(MessageId id, string method, JObject args, CancellationToken token)
-        {
-            return Task.FromResult(false);
-        }
-
-        async Task<string> ReadOne(WebSocket socket, CancellationToken token)
-        {
-            byte[] buff = new byte[4000];
-            var mem = new MemoryStream();
-            while (true)
-            {
-
-                if (socket.State != WebSocketState.Open)
-                {
-                    Log("error", $"DevToolsProxy: Socket is no longer open.");
-                    client_initiated_close.TrySetResult(true);
-                    return null;
-                }
-
-                var result = await socket.ReceiveAsync(new ArraySegment<byte>(buff), token);
-                if (result.MessageType == WebSocketMessageType.Close)
-                {
-                    client_initiated_close.TrySetResult(true);
-                    return null;
-                }
-
-                mem.Write(buff, 0, result.Count);
-
-                if (result.EndOfMessage)
-                    return Encoding.UTF8.GetString(mem.GetBuffer(), 0, (int)mem.Length);
-            }
-        }
-
-        DevToolsQueue GetQueueForSocket(WebSocket ws)
-        {
-            return queues.FirstOrDefault(q => q.Ws == ws);
-        }
-
-        DevToolsQueue GetQueueForTask(Task task)
-        {
-            return queues.FirstOrDefault(q => q.CurrentSend == task);
-        }
-
-        void Send(WebSocket to, JObject o, CancellationToken token)
-        {
-            var sender = browser == to ? "Send-browser" : "Send-ide";
-
-            var method = o["method"]?.ToString();
-            //if (method != "Debugger.scriptParsed" && method != "Runtime.consoleAPICalled")
-            Log("protocol", $"{sender}: " + JsonConvert.SerializeObject(o));
-            var bytes = Encoding.UTF8.GetBytes(o.ToString());
-
-            var queue = GetQueueForSocket(to);
-
-            var task = queue.Send(bytes, token);
-            if (task != null)
-                pending_ops.Add(task);
-        }
-
-        async Task OnEvent(SessionId sessionId, string method, JObject args, CancellationToken token)
-        {
-            try
-            {
-                if (!await AcceptEvent(sessionId, method, args, token))
-                {
-                    //logger.LogDebug ("proxy browser: {0}::{1}",method, args);
-                    SendEventInternal(sessionId, method, args, token);
-                }
-            }
-            catch (Exception e)
-            {
-                side_exception.TrySetException(e);
-            }
-        }
-
-        async Task OnCommand(MessageId id, string method, JObject args, CancellationToken token)
-        {
-            try
-            {
-                if (!await AcceptCommand(id, method, args, token))
-                {
-                    var res = await SendCommandInternal(id, method, args, token);
-                    SendResponseInternal(id, res, token);
-                }
-            }
-            catch (Exception e)
-            {
-                side_exception.TrySetException(e);
-            }
-        }
-
-        void OnResponse(MessageId id, Result result)
-        {
-            //logger.LogTrace ("got id {0} res {1}", id, result);
-            // Fixme
-            if (pending_cmds.Remove(id, out var task))
-            {
-                task.SetResult(result);
-                return;
-            }
-            logger.LogError("Cannot respond to command: {id} with result: {result} - command is not pending", id, result);
-        }
-
-        void ProcessBrowserMessage(string msg, CancellationToken token)
-        {
-            var res = JObject.Parse(msg);
-
-            var method = res["method"]?.ToString();
-            //if (method != "Debugger.scriptParsed" && method != "Runtime.consoleAPICalled")
-            Log("protocol", $"browser: {msg}");
-
-            if (res["id"] == null)
-                pending_ops.Add(OnEvent(new SessionId(res["sessionId"]?.Value<string>()), res["method"].Value<string>(), res["params"] as JObject, token));
-            else
-                OnResponse(new MessageId(res["sessionId"]?.Value<string>(), res["id"].Value<int>()), Result.FromJson(res));
-        }
-
-        void ProcessIdeMessage(string msg, CancellationToken token)
-        {
-            Log("protocol", $"ide: {msg}");
-            if (!string.IsNullOrEmpty(msg))
-            {
-                var res = JObject.Parse(msg);
-                pending_ops.Add(OnCommand(
-                    new MessageId(res["sessionId"]?.Value<string>(), res["id"].Value<int>()),
-                    res["method"].Value<string>(),
-                    res["params"] as JObject, token));
-            }
-        }
-
-        internal async Task<Result> SendCommand(SessionId id, string method, JObject args, CancellationToken token)
-        {
-            //Log ("verbose", $"sending command {method}: {args}");
-            return await SendCommandInternal(id, method, args, token);
-        }
-
-        Task<Result> SendCommandInternal(SessionId sessionId, string method, JObject args, CancellationToken token)
-        {
-            int id = Interlocked.Increment(ref next_cmd_id);
-
-            var o = JObject.FromObject(new
-            {
-                id,
-                method,
-                @params = args
-            });
-            if (sessionId.sessionId != null)
-                o["sessionId"] = sessionId.sessionId;
-            var tcs = new TaskCompletionSource<Result>();
-
-            var msgId = new MessageId(sessionId.sessionId, id);
-            //Log ("verbose", $"add cmd id {sessionId}-{id}");
-            pending_cmds[msgId] = tcs;
-
-            Send(this.browser, o, token);
-            return tcs.Task;
-        }
-
-        public void SendEvent(SessionId sessionId, string method, JObject args, CancellationToken token)
-        {
-            //Log ("verbose", $"sending event {method}: {args}");
-            SendEventInternal(sessionId, method, args, token);
-        }
-
-        void SendEventInternal(SessionId sessionId, string method, JObject args, CancellationToken token)
-        {
-            var o = JObject.FromObject(new
-            {
-                method,
-                @params = args
-            });
-            if (sessionId.sessionId != null)
-                o["sessionId"] = sessionId.sessionId;
-
-            Send(this.ide, o, token);
-        }
-
-        internal void SendResponse(MessageId id, Result result, CancellationToken token)
-        {
-            SendResponseInternal(id, result, token);
-        }
-
-        void SendResponseInternal(MessageId id, Result result, CancellationToken token)
-        {
-            JObject o = result.ToJObject(id);
-            if (result.IsErr)
-                logger.LogError($"sending error response for id: {id} -> {result}");
-
-            Send(this.ide, o, token);
-        }
-
-        // , HttpContext context)
-        public async Task Run(Uri browserUri, WebSocket ideSocket)
-        {
-            Log("info", $"DevToolsProxy: Starting on {browserUri}");
-            using (this.ide = ideSocket)
-            {
-                Log("verbose", $"DevToolsProxy: IDE waiting for connection on {browserUri}");
-                queues.Add(new DevToolsQueue(this.ide));
-                using (this.browser = new ClientWebSocket())
-                {
-                    this.browser.Options.KeepAliveInterval = Timeout.InfiniteTimeSpan;
-                    await this.browser.ConnectAsync(browserUri, CancellationToken.None);
-                    queues.Add(new DevToolsQueue(this.browser));
-
-                    Log("verbose", $"DevToolsProxy: Client connected on {browserUri}");
-                    var x = new CancellationTokenSource();
-
-                    pending_ops.Add(ReadOne(browser, x.Token));
-                    pending_ops.Add(ReadOne(ide, x.Token));
-                    pending_ops.Add(side_exception.Task);
-                    pending_ops.Add(client_initiated_close.Task);
-
-                    try
-                    {
-                        while (!x.IsCancellationRequested)
-                        {
-                            var task = await Task.WhenAny(pending_ops.ToArray());
-                            //logger.LogTrace ("pump {0} {1}", task, pending_ops.IndexOf (task));
-                            if (task == pending_ops[0])
-                            {
-                                var msg = ((Task<string>)task).Result;
-                                if (msg != null)
-                                {
-                                    pending_ops[0] = ReadOne(browser, x.Token); //queue next read
-                                    ProcessBrowserMessage(msg, x.Token);
-                                }
-                            }
-                            else if (task == pending_ops[1])
-                            {
-                                var msg = ((Task<string>)task).Result;
-                                if (msg != null)
-                                {
-                                    pending_ops[1] = ReadOne(ide, x.Token); //queue next read
-                                    ProcessIdeMessage(msg, x.Token);
-                                }
-                            }
-                            else if (task == pending_ops[2])
-                            {
-                                var res = ((Task<bool>)task).Result;
-                                throw new Exception("side task must always complete with an exception, what's going on???");
-                            }
-                            else if (task == pending_ops[3])
-                            {
-                                var res = ((Task<bool>)task).Result;
-                                Log("verbose", $"DevToolsProxy: Client initiated close from {browserUri}");
-                                x.Cancel();
-                            }
-                            else
-                            {
-                                //must be a background task
-                                pending_ops.Remove(task);
-                                var queue = GetQueueForTask(task);
-                                if (queue != null)
-                                {
-                                    var tsk = queue.Pump(x.Token);
-                                    if (tsk != null)
-                                        pending_ops.Add(tsk);
-                                }
-                            }
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        Log("error", $"DevToolsProxy::Run: Exception {e}");
-                        //throw;
-                    }
-                    finally
-                    {
-                        if (!x.IsCancellationRequested)
-                            x.Cancel();
-                    }
-                }
-            }
-        }
-
-        protected void Log(string priority, string msg)
-        {
-            switch (priority)
-            {
-                case "protocol":
-                    logger.LogTrace(msg);
-                    break;
-                case "verbose":
-                    logger.LogDebug(msg);
-                    break;
-                case "info":
-                case "warning":
-                case "error":
-                default:
-                    logger.LogDebug(msg);
-                    break;
-            }
-        }
-    }
-}

+ 0 - 352
sdks/wasm/BrowserDebugProxy/EvaluateExpression.cs

@@ -1,352 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Microsoft.CodeAnalysis.Emit;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-
-    internal class EvaluateExpression
-    {
-        class FindVariableNMethodCall : CSharpSyntaxWalker
-        {
-            public List<IdentifierNameSyntax> identifiers = new List<IdentifierNameSyntax>();
-            public List<InvocationExpressionSyntax> methodCall = new List<InvocationExpressionSyntax>();
-            public List<MemberAccessExpressionSyntax> memberAccesses = new List<MemberAccessExpressionSyntax>();
-            public List<object> argValues = new List<Object>();
-
-            public override void Visit(SyntaxNode node)
-            {
-                // TODO: PointerMemberAccessExpression
-                if (node is MemberAccessExpressionSyntax maes
-                    && node.Kind() == SyntaxKind.SimpleMemberAccessExpression
-                    && !(node.Parent is MemberAccessExpressionSyntax))
-                {
-                    memberAccesses.Add(maes);
-                }
-
-                if (node is IdentifierNameSyntax identifier
-                    && !(identifier.Parent is MemberAccessExpressionSyntax)
-                    && !identifiers.Any(x => x.Identifier.Text == identifier.Identifier.Text))
-                {
-                    identifiers.Add(identifier);
-                }
-
-                if (node is InvocationExpressionSyntax)
-                {
-                    methodCall.Add(node as InvocationExpressionSyntax);
-                    throw new Exception("Method Call is not implemented yet");
-                }
-                if (node is AssignmentExpressionSyntax)
-                    throw new Exception("Assignment is not implemented yet");
-                base.Visit(node);
-            }
-
-            public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable<JObject> ma_values, IEnumerable<JObject> id_values)
-            {
-                CompilationUnitSyntax root = syntaxTree.GetCompilationUnitRoot();
-                var memberAccessToParamName = new Dictionary<string, string>();
-
-                // 1. Replace all this.a occurrences with this_a_ABDE
-                root = root.ReplaceNodes(memberAccesses, (maes, _) =>
-                {
-                    var ma_str = maes.ToString();
-                    if (!memberAccessToParamName.TryGetValue(ma_str, out var id_name))
-                    {
-                        // Generate a random suffix
-                        string suffix = Guid.NewGuid().ToString().Substring(0, 5);
-                        string prefix = ma_str.Trim().Replace(".", "_");
-                        id_name = $"{prefix}_{suffix}";
-
-                        memberAccessToParamName[ma_str] = id_name;
-                    }
-
-                    return SyntaxFactory.IdentifierName(id_name);
-                });
-
-                var paramsSet = new HashSet<string>();
-
-                // 2. For every unique member ref, add a corresponding method param
-                foreach (var (maes, value) in memberAccesses.Zip(ma_values))
-                {
-                    var node_str = maes.ToString();
-                    if (!memberAccessToParamName.TryGetValue(node_str, out var id_name))
-                    {
-                        throw new Exception($"BUG: Expected to find an id name for the member access string: {node_str}");
-                    }
-
-                    root = UpdateWithNewMethodParam(root, id_name, value);
-                }
-
-                foreach (var (idns, value) in identifiers.Zip(id_values))
-                {
-                    root = UpdateWithNewMethodParam(root, idns.Identifier.Text, value);
-                }
-
-                return syntaxTree.WithRootAndOptions(root, syntaxTree.Options);
-
-                CompilationUnitSyntax UpdateWithNewMethodParam(CompilationUnitSyntax root, string id_name, JObject value)
-                {
-                    var classDeclaration = root.Members.ElementAt(0) as ClassDeclarationSyntax;
-                    var method = classDeclaration.Members.ElementAt(0) as MethodDeclarationSyntax;
-
-                    if (paramsSet.Contains(id_name))
-                    {
-                        // repeated member access expression
-                        // eg. this.a + this.a
-                        return root;
-                    }
-
-                    argValues.Add(ConvertJSToCSharpType(value));
-
-                    var updatedMethod = method.AddParameterListParameters(
-                        SyntaxFactory.Parameter(
-                            SyntaxFactory.Identifier(id_name))
-                            .WithType(SyntaxFactory.ParseTypeName(GetTypeFullName(value))));
-
-                    paramsSet.Add(id_name);
-                    root = root.ReplaceNode(method, updatedMethod);
-
-                    return root;
-                }
-            }
-
-            private object ConvertJSToCSharpType(JToken variable)
-            {
-                var value = variable["value"];
-                var type = variable["type"].Value<string>();
-                var subType = variable["subtype"]?.Value<string>();
-
-                switch (type)
-                {
-                    case "string":
-                        return value?.Value<string>();
-                    case "number":
-                        return value?.Value<double>();
-                    case "boolean":
-                        return value?.Value<bool>();
-                    case "object":
-                        if (subType == "null")
-                            return null;
-                        break;
-                }
-                throw new Exception($"Evaluate of this datatype {type} not implemented yet");//, "Unsupported");
-            }
-
-            private string GetTypeFullName(JToken variable)
-            {
-                var type = variable["type"].ToString();
-                var subType = variable["subtype"]?.Value<string>();
-                object value = ConvertJSToCSharpType(variable);
-
-                switch (type)
-                {
-                    case "object":
-                        {
-                            if (subType == "null")
-                                return variable["className"].Value<string>();
-                            break;
-                        }
-                    default:
-                        return value.GetType().FullName;
-                }
-                throw new ReturnAsErrorException($"GetTypefullName: Evaluate of this datatype {type} not implemented yet", "Unsupported");
-            }
-        }
-
-        static SyntaxNode GetExpressionFromSyntaxTree(SyntaxTree syntaxTree)
-        {
-            CompilationUnitSyntax root = syntaxTree.GetCompilationUnitRoot();
-            ClassDeclarationSyntax classDeclaration = root.Members.ElementAt(0) as ClassDeclarationSyntax;
-            MethodDeclarationSyntax methodDeclaration = classDeclaration.Members.ElementAt(0) as MethodDeclarationSyntax;
-            BlockSyntax blockValue = methodDeclaration.Body;
-            ReturnStatementSyntax returnValue = blockValue.Statements.ElementAt(0) as ReturnStatementSyntax;
-            ParenthesizedExpressionSyntax expressionParenthesized = returnValue.Expression as ParenthesizedExpressionSyntax;
-
-            return expressionParenthesized?.Expression;
-        }
-
-        private static async Task<IList<JObject>> ResolveMemberAccessExpressions(IEnumerable<MemberAccessExpressionSyntax> member_accesses,
-                                MemberReferenceResolver resolver, CancellationToken token)
-        {
-            var memberAccessValues = new List<JObject>();
-            foreach (var maes in member_accesses)
-            {
-                var memberAccessString = maes.ToString();
-                var value = await resolver.Resolve(memberAccessString, token);
-                if (value == null)
-                    throw new ReturnAsErrorException($"Failed to resolve member access for {memberAccessString}", "ReferenceError");
-
-                memberAccessValues.Add(value);
-            }
-
-            return memberAccessValues;
-        }
-
-        private static async Task<IList<JObject>> ResolveIdentifiers(IEnumerable<IdentifierNameSyntax> identifiers, MemberReferenceResolver resolver, CancellationToken token)
-        {
-            var values = new List<JObject>();
-            foreach (var var in identifiers)
-            {
-                JObject value = await resolver.Resolve(var.Identifier.Text, token);
-                if (value == null)
-                    throw new ReturnAsErrorException($"The name {var.Identifier.Text} does not exist in the current context", "ReferenceError");
-
-                values.Add(value);
-            }
-
-            return values;
-        }
-
-        internal static async Task<JObject> CompileAndRunTheExpression(string expression, MemberReferenceResolver resolver, CancellationToken token)
-        {
-            expression = expression.Trim();
-            SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(@"
-                using System;
-                public class CompileAndRunTheExpression
-                {
-                    public static object Evaluate()
-                    {
-                        return (" + expression + @");
-                    }
-                }");
-
-            var expressionTree = GetExpressionFromSyntaxTree(syntaxTree);
-            if (expressionTree == null)
-                throw new Exception($"BUG: Unable to evaluate {expression}, could not get expression from the syntax tree");
-
-            FindVariableNMethodCall findVarNMethodCall = new FindVariableNMethodCall();
-            findVarNMethodCall.Visit(expressionTree);
-
-            // this fails with `"a)"`
-            // because the code becomes: return (a));
-            // and the returned expression from GetExpressionFromSyntaxTree is `a`!
-            if (expressionTree.Kind() == SyntaxKind.IdentifierName || expressionTree.Kind() == SyntaxKind.ThisExpression)
-            {
-                var var_name = expressionTree.ToString();
-                var value = await resolver.Resolve(var_name, token);
-                if (value == null)
-                    throw new ReturnAsErrorException($"Cannot find member named '{var_name}'.", "ReferenceError");
-
-                return value;
-            }
-
-            var memberAccessValues = await ResolveMemberAccessExpressions(findVarNMethodCall.memberAccesses, resolver, token);
-
-            // eg. "this.dateTime", "  dateTime.TimeOfDay"
-            if (expressionTree.Kind() == SyntaxKind.SimpleMemberAccessExpression && findVarNMethodCall.memberAccesses.Count == 1)
-            {
-                return memberAccessValues[0];
-            }
-
-            var identifierValues = await ResolveIdentifiers(findVarNMethodCall.identifiers, resolver, token);
-
-            syntaxTree = findVarNMethodCall.ReplaceVars(syntaxTree, memberAccessValues, identifierValues);
-            expressionTree = GetExpressionFromSyntaxTree(syntaxTree);
-            if (expressionTree == null)
-                throw new Exception($"BUG: Unable to evaluate {expression}, could not get expression from the syntax tree");
-
-            MetadataReference[] references = new MetadataReference[]
-            {
-                MetadataReference.CreateFromFile(typeof(object).Assembly.Location),
-                MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location)
-            };
-
-            CSharpCompilation compilation = CSharpCompilation.Create(
-                "compileAndRunTheExpression",
-                syntaxTrees: new[] { syntaxTree },
-                references: references,
-                options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
-
-            var semanticModel = compilation.GetSemanticModel(syntaxTree);
-            var typeInfo = semanticModel.GetTypeInfo(expressionTree);
-
-            using (var ms = new MemoryStream())
-            {
-                EmitResult result = compilation.Emit(ms);
-                if (!result.Success)
-                {
-                    var sb = new StringBuilder();
-                    foreach (var d in result.Diagnostics)
-                        sb.Append(d.ToString());
-
-                    throw new ReturnAsErrorException(sb.ToString(), "CompilationError");
-                }
-
-                ms.Seek(0, SeekOrigin.Begin);
-                Assembly assembly = Assembly.Load(ms.ToArray());
-                Type type = assembly.GetType("CompileAndRunTheExpression");
-
-                var ret = type.InvokeMember("Evaluate",
-                    BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public,
-                    null,
-                    null,
-                    findVarNMethodCall.argValues.ToArray());
-
-                return JObject.FromObject(ConvertCSharpToJSType(ret, typeInfo.Type));
-            }
-        }
-
-        static readonly HashSet<Type> NumericTypes = new HashSet<Type>
-        {
-            typeof(decimal), typeof(byte), typeof(sbyte),
-            typeof(short), typeof(ushort),
-            typeof(int), typeof(uint),
-            typeof(float), typeof(double)
-        };
-
-        static object ConvertCSharpToJSType(object v, ITypeSymbol type)
-        {
-            if (v == null)
-                return new { type = "object", subtype = "null", className = type.ToString() };
-
-            if (v is string s)
-            {
-                return new { type = "string", value = s, description = s };
-            }
-            else if (NumericTypes.Contains(v.GetType()))
-            {
-                return new { type = "number", value = v, description = v.ToString() };
-            }
-            else
-            {
-                return new { type = "object", value = v, description = v.ToString(), className = type.ToString() };
-            }
-        }
-
-    }
-
-    class ReturnAsErrorException : Exception
-    {
-        public Result Error { get; }
-        public ReturnAsErrorException(JObject error)
-            => Error = Result.Err(error);
-
-        public ReturnAsErrorException(string message, string className)
-        {
-            Error = Result.Err(JObject.FromObject(new
-            {
-                result = new
-                {
-                    type = "object",
-                    subtype = "error",
-                    description = message,
-                    className
-                }
-            }));
-        }
-    }
-}

+ 0 - 75
sdks/wasm/BrowserDebugProxy/MemberReferenceResolver.cs

@@ -1,75 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    internal class MemberReferenceResolver
-    {
-        private MessageId messageId;
-        private int scopeId;
-        private MonoProxy proxy;
-        private ExecutionContext ctx;
-        private PerScopeCache scopeCache;
-        private VarInfo[] varIds;
-        private ILogger logger;
-        private bool locals_fetched = false;
-
-        public MemberReferenceResolver(MonoProxy proxy, ExecutionContext ctx, MessageId msg_id, int scope_id, ILogger logger)
-        {
-            messageId = msg_id;
-            scopeId = scope_id;
-            this.proxy = proxy;
-            this.ctx = ctx;
-            this.logger = logger;
-            scopeCache = ctx.GetCacheForScope(scope_id);
-        }
-
-        // Checks Locals, followed by `this`
-        public async Task<JObject> Resolve(string var_name, CancellationToken token)
-        {
-            if (scopeCache.Locals.Count == 0 && !locals_fetched)
-            {
-                var scope_res = await proxy.GetScopeProperties(messageId, scopeId, token);
-                if (scope_res.IsErr)
-                    throw new Exception($"BUG: Unable to get properties for scope: {scopeId}. {scope_res}");
-                locals_fetched = true;
-            }
-
-            if (scopeCache.Locals.TryGetValue(var_name, out var obj))
-            {
-                return obj["value"]?.Value<JObject>();
-            }
-
-            if (scopeCache.MemberReferences.TryGetValue(var_name, out var ret))
-                return ret;
-
-            if (varIds == null)
-            {
-                var scope = ctx.CallStack.FirstOrDefault(s => s.Id == scopeId);
-                varIds = scope.Method.GetLiveVarsAt(scope.Location.CliLocation.Offset);
-            }
-
-            var res = await proxy.SendMonoCommand(messageId, MonoCommands.EvaluateMemberAccess(scopeId, var_name, varIds), token);
-            if (res.IsOk)
-            {
-                ret = res.Value?["result"]?["value"]?["value"]?.Value<JObject>();
-                scopeCache.MemberReferences[var_name] = ret;
-            }
-            else
-            {
-                logger.LogDebug(res.Error.ToString());
-            }
-
-            return ret;
-        }
-
-    }
-}

+ 0 - 977
sdks/wasm/BrowserDebugProxy/MonoProxy.cs

@@ -1,977 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.CodeAnalysis;
-using Microsoft.Extensions.Logging;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-
-    internal class MonoProxy : DevToolsProxy
-    {
-        HashSet<SessionId> sessions = new HashSet<SessionId>();
-        Dictionary<SessionId, ExecutionContext> contexts = new Dictionary<SessionId, ExecutionContext>();
-
-        public MonoProxy(ILoggerFactory loggerFactory, bool hideWebDriver = true) : base(loggerFactory) { this.hideWebDriver = hideWebDriver; }
-
-        readonly bool hideWebDriver;
-
-        internal ExecutionContext GetContext(SessionId sessionId)
-        {
-            if (contexts.TryGetValue(sessionId, out var context))
-                return context;
-
-            throw new ArgumentException($"Invalid Session: \"{sessionId}\"", nameof(sessionId));
-        }
-
-        bool UpdateContext(SessionId sessionId, ExecutionContext executionContext, out ExecutionContext previousExecutionContext)
-        {
-            var previous = contexts.TryGetValue(sessionId, out previousExecutionContext);
-            contexts[sessionId] = executionContext;
-            return previous;
-        }
-
-        internal Task<Result> SendMonoCommand(SessionId id, MonoCommands cmd, CancellationToken token) => SendCommand(id, "Runtime.evaluate", JObject.FromObject(cmd), token);
-
-        protected override async Task<bool> AcceptEvent(SessionId sessionId, string method, JObject args, CancellationToken token)
-        {
-            switch (method)
-            {
-                case "Runtime.consoleAPICalled":
-                    {
-                        var type = args["type"]?.ToString();
-                        if (type == "debug")
-                        {
-                            var a = args["args"];
-                            if (a?[0]?["value"]?.ToString() == MonoConstants.RUNTIME_IS_READY &&
-                                a?[1]?["value"]?.ToString() == "fe00e07a-5519-4dfe-b35a-f867dbaf2e28")
-                            {
-                                if (a.Count() > 2)
-                                {
-                                    try
-                                    {
-                                        // The optional 3rd argument is the stringified assembly
-                                        // list so that we don't have to make more round trips
-                                        var context = GetContext(sessionId);
-                                        var loaded = a?[2]?["value"]?.ToString();
-                                        if (loaded != null)
-                                            context.LoadedFiles = JToken.Parse(loaded).ToObject<string[]>();
-                                    }
-                                    catch (InvalidCastException ice)
-                                    {
-                                        Log("verbose", ice.ToString());
-                                    }
-                                }
-                                await RuntimeReady(sessionId, token);
-                            }
-
-                        }
-                        break;
-                    }
-
-                case "Runtime.executionContextCreated":
-                    {
-                        SendEvent(sessionId, method, args, token);
-                        var ctx = args?["context"];
-                        var aux_data = ctx?["auxData"] as JObject;
-                        var id = ctx["id"].Value<int>();
-                        if (aux_data != null)
-                        {
-                            var is_default = aux_data["isDefault"]?.Value<bool>();
-                            if (is_default == true)
-                            {
-                                await OnDefaultContext(sessionId, new ExecutionContext { Id = id, AuxData = aux_data }, token);
-                            }
-                        }
-                        return true;
-                    }
-
-                case "Debugger.paused":
-                    {
-                        //TODO figure out how to stich out more frames and, in particular what happens when real wasm is on the stack
-                        var top_func = args?["callFrames"]?[0]?["functionName"]?.Value<string>();
-
-                        if (top_func == "mono_wasm_fire_bp" || top_func == "_mono_wasm_fire_bp" || top_func == "_mono_wasm_fire_exception")
-                        {
-                            return await OnPause(sessionId, args, token);
-                        }
-                        break;
-                    }
-
-                case "Debugger.breakpointResolved":
-                    {
-                        break;
-                    }
-
-                case "Debugger.scriptParsed":
-                    {
-                        var url = args?["url"]?.Value<string>() ?? "";
-
-                        switch (url)
-                        {
-                            case var _ when url == "":
-                            case var _ when url.StartsWith("wasm://", StringComparison.Ordinal):
-                                {
-                                    Log("verbose", $"ignoring wasm: Debugger.scriptParsed {url}");
-                                    return true;
-                                }
-                        }
-                        Log("verbose", $"proxying Debugger.scriptParsed ({sessionId.sessionId}) {url} {args}");
-                        break;
-                    }
-
-                case "Target.attachedToTarget":
-                    {
-                        if (args["targetInfo"]["type"]?.ToString() == "page")
-                            await DeleteWebDriver(new SessionId(args["sessionId"]?.ToString()), token);
-                        break;
-                    }
-
-            }
-
-            return false;
-        }
-
-        async Task<bool> IsRuntimeAlreadyReadyAlready(SessionId sessionId, CancellationToken token)
-        {
-            if (contexts.TryGetValue(sessionId, out var context) && context.IsRuntimeReady)
-                return true;
-
-            var res = await SendMonoCommand(sessionId, MonoCommands.IsRuntimeReady(), token);
-            return res.Value?["result"]?["value"]?.Value<bool>() ?? false;
-        }
-
-        protected override async Task<bool> AcceptCommand(MessageId id, string method, JObject args, CancellationToken token)
-        {
-            // Inspector doesn't use the Target domain or sessions
-            // so we try to init immediately
-            if (hideWebDriver && id == SessionId.Null)
-                await DeleteWebDriver(id, token);
-
-            if (!contexts.TryGetValue(id, out var context))
-                return false;
-
-            switch (method)
-            {
-                case "Target.attachToTarget":
-                    {
-                        var resp = await SendCommand(id, method, args, token);
-                        await DeleteWebDriver(new SessionId(resp.Value["sessionId"]?.ToString()), token);
-                        break;
-                    }
-
-                case "Debugger.enable":
-                    {
-                        System.Console.WriteLine("recebi o Debugger.enable");
-                        var resp = await SendCommand(id, method, args, token);
-
-                        context.DebuggerId = resp.Value["debuggerId"]?.ToString();
-
-                        if (await IsRuntimeAlreadyReadyAlready(id, token))
-                            await RuntimeReady(id, token);
-
-                        SendResponse(id, resp, token);
-                        return true;
-                    }
-
-                case "Debugger.getScriptSource":
-                    {
-                        var script = args?["scriptId"]?.Value<string>();
-                        return await OnGetScriptSource(id, script, token);
-                    }
-
-                case "Runtime.compileScript":
-                    {
-                        var exp = args?["expression"]?.Value<string>();
-                        if (exp.StartsWith("//dotnet:", StringComparison.Ordinal))
-                        {
-                            OnCompileDotnetScript(id, token);
-                            return true;
-                        }
-                        break;
-                    }
-
-                case "Debugger.getPossibleBreakpoints":
-                    {
-                        var resp = await SendCommand(id, method, args, token);
-                        if (resp.IsOk && resp.Value["locations"].HasValues)
-                        {
-                            SendResponse(id, resp, token);
-                            return true;
-                        }
-
-                        var start = SourceLocation.Parse(args?["start"] as JObject);
-                        //FIXME support variant where restrictToFunction=true and end is omitted
-                        var end = SourceLocation.Parse(args?["end"] as JObject);
-                        if (start != null && end != null && await GetPossibleBreakpoints(id, start, end, token))
-                            return true;
-
-                        SendResponse(id, resp, token);
-                        return true;
-                    }
-
-                case "Debugger.setBreakpoint":
-                    {
-                        break;
-                    }
-
-                case "Debugger.setBreakpointByUrl":
-                    {
-                        var resp = await SendCommand(id, method, args, token);
-                        if (!resp.IsOk)
-                        {
-                            SendResponse(id, resp, token);
-                            return true;
-                        }
-
-                        var bpid = resp.Value["breakpointId"]?.ToString();
-                        var locations = resp.Value["locations"]?.Values<object>();
-                        var request = BreakpointRequest.Parse(bpid, args);
-
-                        // is the store done loading?
-                        var loaded = context.Source.Task.IsCompleted;
-                        if (!loaded)
-                        {
-                            // Send and empty response immediately if not
-                            // and register the breakpoint for resolution
-                            context.BreakpointRequests[bpid] = request;
-                            SendResponse(id, resp, token);
-                        }
-
-                        if (await IsRuntimeAlreadyReadyAlready(id, token))
-                        {
-                            var store = await RuntimeReady(id, token);
-
-                            Log("verbose", $"BP req {args}");
-                            await SetBreakpoint(id, store, request, !loaded, token);
-                        }
-
-                        if (loaded)
-                        {
-                            // we were already loaded so we should send a response
-                            // with the locations included and register the request
-                            context.BreakpointRequests[bpid] = request;
-                            var result = Result.OkFromObject(request.AsSetBreakpointByUrlResponse(locations));
-                            SendResponse(id, result, token);
-
-                        }
-                        return true;
-                    }
-
-                case "Debugger.removeBreakpoint":
-                    {
-                        await RemoveBreakpoint(id, args, token);
-                        break;
-                    }
-
-                case "Debugger.resume":
-                    {
-                        await OnResume(id, token);
-                        break;
-                    }
-
-                case "Debugger.stepInto":
-                    {
-                        return await Step(id, StepKind.Into, token);
-                    }
-
-                case "Debugger.stepOut":
-                    {
-                        return await Step(id, StepKind.Out, token);
-                    }
-
-                case "Debugger.stepOver":
-                    {
-                        return await Step(id, StepKind.Over, token);
-                    }
-
-                case "Debugger.evaluateOnCallFrame":
-                    {
-                        if (!DotnetObjectId.TryParse(args?["callFrameId"], out var objectId))
-                            return false;
-
-                        switch (objectId.Scheme)
-                        {
-                            case "scope":
-                                return await OnEvaluateOnCallFrame(id,
-                                    int.Parse(objectId.Value),
-                                    args?["expression"]?.Value<string>(), token);
-                            default:
-                                return false;
-                        }
-                    }
-
-                case "Runtime.getProperties":
-                    {
-                        if (!DotnetObjectId.TryParse(args?["objectId"], out var objectId))
-                            break;
-
-                        var result = await RuntimeGetProperties(id, objectId, args, token);
-                        SendResponse(id, result, token);
-                        return true;
-                    }
-
-                case "Runtime.releaseObject":
-                    {
-                        if (!(DotnetObjectId.TryParse(args["objectId"], out var objectId) && objectId.Scheme == "cfo_res"))
-                            break;
-
-                        await SendMonoCommand(id, MonoCommands.ReleaseObject(objectId), token);
-                        SendResponse(id, Result.OkFromObject(new { }), token);
-                        return true;
-                    }
-
-                case "Debugger.setPauseOnExceptions":
-                    {
-                        string state = args["state"].Value<string>();
-                        await SendMonoCommand(id, MonoCommands.SetPauseOnExceptions(state), token);
-                        // Pass this on to JS too
-                        return false;
-                    }
-
-                // Protocol extensions
-                case "DotnetDebugger.getMethodLocation":
-                    {
-                        Console.WriteLine("set-breakpoint-by-method: " + id + " " + args);
-
-                        var store = await RuntimeReady(id, token);
-                        string aname = args["assemblyName"]?.Value<string>();
-                        string typeName = args["typeName"]?.Value<string>();
-                        string methodName = args["methodName"]?.Value<string>();
-                        if (aname == null || typeName == null || methodName == null)
-                        {
-                            SendResponse(id, Result.Err("Invalid protocol message '" + args + "'."), token);
-                            return true;
-                        }
-
-                        // GetAssemblyByName seems to work on file names
-                        var assembly = store.GetAssemblyByName(aname);
-                        if (assembly == null)
-                            assembly = store.GetAssemblyByName(aname + ".exe");
-                        if (assembly == null)
-                            assembly = store.GetAssemblyByName(aname + ".dll");
-                        if (assembly == null)
-                        {
-                            SendResponse(id, Result.Err("Assembly '" + aname + "' not found."), token);
-                            return true;
-                        }
-
-                        var type = assembly.GetTypeByName(typeName);
-                        if (type == null)
-                        {
-                            SendResponse(id, Result.Err($"Type '{typeName}' not found."), token);
-                            return true;
-                        }
-
-                        var methodInfo = type.Methods.FirstOrDefault(m => m.Name == methodName);
-                        if (methodInfo == null)
-                        {
-                            // Maybe this is an async method, in which case the debug info is attached
-                            // to the async method implementation, in class named:
-                            //      `{type_name}/<method_name>::MoveNext`
-                            methodInfo = assembly.TypesByName.Values.SingleOrDefault(t => t.FullName.StartsWith($"{typeName}/<{methodName}>"))?
-                                .Methods.FirstOrDefault(mi => mi.Name == "MoveNext");
-                        }
-
-                        if (methodInfo == null)
-                        {
-                            SendResponse(id, Result.Err($"Method '{typeName}:{methodName}' not found."), token);
-                            return true;
-                        }
-
-                        var src_url = methodInfo.Assembly.Sources.Single(sf => sf.SourceId == methodInfo.SourceId).Url;
-                        SendResponse(id, Result.OkFromObject(new
-                        {
-                            result = new { line = methodInfo.StartLocation.Line, column = methodInfo.StartLocation.Column, url = src_url }
-                        }), token);
-
-                        return true;
-                    }
-                case "Runtime.callFunctionOn":
-                    {
-                        if (!DotnetObjectId.TryParse(args["objectId"], out var objectId))
-                            return false;
-
-                        if (objectId.Scheme == "scope")
-                        {
-                            SendResponse(id,
-                                Result.Exception(new ArgumentException(
-                                    $"Runtime.callFunctionOn not supported with scope ({objectId}).")),
-                                token);
-                            return true;
-                        }
-
-                        var res = await SendMonoCommand(id, MonoCommands.CallFunctionOn(args), token);
-                        var res_value_type = res.Value?["result"]?["value"]?.Type;
-
-                        if (res.IsOk && res_value_type == JTokenType.Object || res_value_type == JTokenType.Object)
-                            res = Result.OkFromObject(new { result = res.Value["result"]["value"] });
-
-                        SendResponse(id, res, token);
-                        return true;
-                    }
-            }
-
-            return false;
-        }
-
-        async Task<Result> RuntimeGetProperties(MessageId id, DotnetObjectId objectId, JToken args, CancellationToken token)
-        {
-            if (objectId.Scheme == "scope")
-            {
-                return await GetScopeProperties(id, int.Parse(objectId.Value), token);
-            }
-
-            var res = await SendMonoCommand(id, MonoCommands.GetDetails(objectId, args), token);
-            if (res.IsErr)
-                return res;
-
-            if (objectId.Scheme == "cfo_res")
-            {
-                // Runtime.callFunctionOn result object
-                var value_json_str = res.Value["result"]?["value"]?["__value_as_json_string__"]?.Value<string>();
-                if (value_json_str != null)
-                {
-                    res = Result.OkFromObject(new
-                    {
-                        result = JArray.Parse(value_json_str)
-                    });
-                }
-                else
-                {
-                    res = Result.OkFromObject(new { result = new { } });
-                }
-            }
-            else
-            {
-                res = Result.Ok(JObject.FromObject(new { result = res.Value["result"]["value"] }));
-            }
-
-            return res;
-        }
-
-        //static int frame_id=0;
-        async Task<bool> OnPause(SessionId sessionId, JObject args, CancellationToken token)
-        {
-            //FIXME we should send release objects every now and then? Or intercept those we inject and deal in the runtime
-            var res = await SendMonoCommand(sessionId, MonoCommands.GetCallStack(), token);
-            var orig_callframes = args?["callFrames"]?.Values<JObject>();
-            var context = GetContext(sessionId);
-            JObject data = null;
-            var reason = "other";//other means breakpoint
-
-            if (res.IsErr)
-            {
-                //Give up and send the original call stack
-                return false;
-            }
-
-            //step one, figure out where did we hit
-            var res_value = res.Value?["result"]?["value"];
-            if (res_value == null || res_value is JValue)
-            {
-                //Give up and send the original call stack
-                return false;
-            }
-
-            Log("verbose", $"call stack (err is {res.Error} value is:\n{res.Value}");
-            var bp_id = res_value?["breakpoint_id"]?.Value<int>();
-            Log("verbose", $"We just hit bp {bp_id}");
-            if (!bp_id.HasValue)
-            {
-                //Give up and send the original call stack
-                return false;
-            }
-
-            var bp = context.BreakpointRequests.Values.SelectMany(v => v.Locations).FirstOrDefault(b => b.RemoteId == bp_id.Value);
-
-            var callFrames = new List<object>();
-            foreach (var frame in orig_callframes)
-            {
-                var function_name = frame["functionName"]?.Value<string>();
-                var url = frame["url"]?.Value<string>();
-                if ("mono_wasm_fire_bp" == function_name || "_mono_wasm_fire_bp" == function_name ||
-                    "_mono_wasm_fire_exception" == function_name)
-                {
-                    if ("_mono_wasm_fire_exception" == function_name)
-                    {
-                        var exception_obj_id = await SendMonoCommand(sessionId, MonoCommands.GetExceptionObject(), token);
-                        var res_val = exception_obj_id.Value?["result"]?["value"];
-                        var exception_dotnet_obj_id = new DotnetObjectId("object", res_val?["exception_id"]?.Value<string>());
-                        data = JObject.FromObject(new
-                        {
-                            type = "object",
-                            subtype = "error",
-                            className = res_val?["class_name"]?.Value<string>(),
-                            uncaught = res_val?["uncaught"]?.Value<bool>(),
-                            description = res_val?["message"]?.Value<string>() + "\n",
-                            objectId = exception_dotnet_obj_id.ToString()
-                        });
-                        reason = "exception";
-                    }
-
-                    var frames = new List<Frame>();
-                    int frame_id = 0;
-                    var the_mono_frames = res.Value?["result"]?["value"]?["frames"]?.Values<JObject>();
-
-                    foreach (var mono_frame in the_mono_frames)
-                    {
-                        ++frame_id;
-                        var il_pos = mono_frame["il_pos"].Value<int>();
-                        var method_token = mono_frame["method_token"].Value<uint>();
-                        var assembly_name = mono_frame["assembly_name"].Value<string>();
-
-                        // This can be different than `method.Name`, like in case of generic methods
-                        var method_name = mono_frame["method_name"]?.Value<string>();
-
-                        var store = await LoadStore(sessionId, token);
-                        var asm = store.GetAssemblyByName(assembly_name);
-                        if (asm == null)
-                        {
-                            Log("info", $"Unable to find assembly: {assembly_name}");
-                            continue;
-                        }
-
-                        var method = asm.GetMethodByToken(method_token);
-
-                        if (method == null)
-                        {
-                            Log("info", $"Unable to find il offset: {il_pos} in method token: {method_token} assembly name: {assembly_name}");
-                            continue;
-                        }
-
-                        var location = method?.GetLocationByIl(il_pos);
-
-                        // When hitting a breakpoint on the "IncrementCount" method in the standard
-                        // Blazor project template, one of the stack frames is inside mscorlib.dll
-                        // and we get location==null for it. It will trigger a NullReferenceException
-                        // if we don't skip over that stack frame.
-                        if (location == null)
-                        {
-                            continue;
-                        }
-
-                        Log("info", $"frame il offset: {il_pos} method token: {method_token} assembly name: {assembly_name}");
-                        Log("info", $"\tmethod {method_name} location: {location}");
-                        frames.Add(new Frame(method, location, frame_id - 1));
-
-                        callFrames.Add(new
-                        {
-                            functionName = method_name,
-                            callFrameId = $"dotnet:scope:{frame_id - 1}",
-                            functionLocation = method.StartLocation.AsLocation(),
-
-                            location = location.AsLocation(),
-
-                            url = store.ToUrl(location),
-
-                            scopeChain = new[]
-                                {
-                                    new
-                                    {
-                                        type = "local",
-                                            @object = new
-                                            {
-                                                @type = "object",
-                                                    className = "Object",
-                                                    description = "Object",
-                                                    objectId = $"dotnet:scope:{frame_id-1}",
-                                            },
-                                            name = method_name,
-                                            startLocation = method.StartLocation.AsLocation(),
-                                            endLocation = method.EndLocation.AsLocation(),
-                                    }
-                                }
-                        });
-
-                        context.CallStack = frames;
-
-                    }
-                }
-                else if (!(function_name.StartsWith("wasm-function", StringComparison.Ordinal) ||
-                        url.StartsWith("wasm://wasm/", StringComparison.Ordinal)))
-                {
-                    callFrames.Add(frame);
-                }
-            }
-
-            var bp_list = new string[bp == null ? 0 : 1];
-            if (bp != null)
-                bp_list[0] = bp.StackId;
-
-            var o = JObject.FromObject(new
-            {
-                callFrames,
-                reason,
-                data,
-                hitBreakpoints = bp_list,
-            });
-
-            SendEvent(sessionId, "Debugger.paused", o, token);
-            return true;
-        }
-
-        async Task OnDefaultContext(SessionId sessionId, ExecutionContext context, CancellationToken token)
-        {
-            Log("verbose", "Default context created, clearing state and sending events");
-            if (UpdateContext(sessionId, context, out var previousContext))
-            {
-                foreach (var kvp in previousContext.BreakpointRequests)
-                {
-                    context.BreakpointRequests[kvp.Key] = kvp.Value.Clone();
-                }
-            }
-
-            if (await IsRuntimeAlreadyReadyAlready(sessionId, token))
-                await RuntimeReady(sessionId, token);
-        }
-
-        async Task OnResume(MessageId msg_id, CancellationToken token)
-        {
-            var ctx = GetContext(msg_id);
-            if (ctx.CallStack != null)
-            {
-                // Stopped on managed code
-                await SendMonoCommand(msg_id, MonoCommands.Resume(), token);
-            }
-
-            //discard managed frames
-            GetContext(msg_id).ClearState();
-        }
-
-        async Task<bool> Step(MessageId msg_id, StepKind kind, CancellationToken token)
-        {
-            var context = GetContext(msg_id);
-            if (context.CallStack == null)
-                return false;
-
-            if (context.CallStack.Count <= 1 && kind == StepKind.Out)
-                return false;
-
-            var res = await SendMonoCommand(msg_id, MonoCommands.StartSingleStepping(kind), token);
-
-            var ret_code = res.Value?["result"]?["value"]?.Value<int>();
-
-            if (ret_code.HasValue && ret_code.Value == 0)
-            {
-                context.ClearState();
-                await SendCommand(msg_id, "Debugger.stepOut", new JObject(), token);
-                return false;
-            }
-
-            SendResponse(msg_id, Result.Ok(new JObject()), token);
-
-            context.ClearState();
-
-            await SendCommand(msg_id, "Debugger.resume", new JObject(), token);
-            return true;
-        }
-
-        async Task<bool> OnEvaluateOnCallFrame(MessageId msg_id, int scope_id, string expression, CancellationToken token)
-        {
-            try
-            {
-                var context = GetContext(msg_id);
-                if (context.CallStack == null)
-                    return false;
-
-                var resolver = new MemberReferenceResolver(this, context, msg_id, scope_id, logger);
-
-                JObject retValue = await resolver.Resolve(expression, token);
-                if (retValue == null)
-                {
-                    retValue = await EvaluateExpression.CompileAndRunTheExpression(expression, resolver, token);
-                }
-
-                if (retValue != null)
-                {
-                    SendResponse(msg_id, Result.OkFromObject(new
-                    {
-                        result = retValue
-                    }), token);
-                }
-                else
-                {
-                    SendResponse(msg_id, Result.Err($"Unable to evaluate '{expression}'"), token);
-                }
-            }
-            catch (ReturnAsErrorException ree)
-            {
-                SendResponse(msg_id, ree.Error, token);
-            }
-            catch (Exception e)
-            {
-                logger.LogDebug($"Error in EvaluateOnCallFrame for expression '{expression}' with '{e}.");
-                SendResponse(msg_id, Result.Exception(e), token);
-            }
-
-            return true;
-        }
-
-        internal async Task<Result> GetScopeProperties(MessageId msg_id, int scope_id, CancellationToken token)
-        {
-            try
-            {
-                var ctx = GetContext(msg_id);
-                var scope = ctx.CallStack.FirstOrDefault(s => s.Id == scope_id);
-                if (scope == null)
-                    return Result.Err(JObject.FromObject(new { message = $"Could not find scope with id #{scope_id}" }));
-
-                var var_ids = scope.Method.GetLiveVarsAt(scope.Location.CliLocation.Offset);
-                var res = await SendMonoCommand(msg_id, MonoCommands.GetScopeVariables(scope.Id, var_ids), token);
-
-                //if we fail we just buble that to the IDE (and let it panic over it)
-                if (res.IsErr)
-                    return res;
-
-                var values = res.Value?["result"]?["value"]?.Values<JObject>().ToArray();
-
-                if (values == null || values.Length == 0)
-                    return Result.OkFromObject(new { result = Array.Empty<object>() });
-
-                var frameCache = ctx.GetCacheForScope(scope_id);
-                foreach (var value in values)
-                {
-                    frameCache.Locals[value["name"]?.Value<string>()] = value;
-                }
-
-                return Result.OkFromObject(new { result = values });
-            }
-            catch (Exception exception)
-            {
-                Log("verbose", $"Error resolving scope properties {exception.Message}");
-                return Result.Exception(exception);
-            }
-        }
-
-        async Task<Breakpoint> SetMonoBreakpoint(SessionId sessionId, string reqId, SourceLocation location, CancellationToken token)
-        {
-            var bp = new Breakpoint(reqId, location, BreakpointState.Pending);
-            var asm_name = bp.Location.CliLocation.Method.Assembly.Name;
-            var method_token = bp.Location.CliLocation.Method.Token;
-            var il_offset = bp.Location.CliLocation.Offset;
-
-            var res = await SendMonoCommand(sessionId, MonoCommands.SetBreakpoint(asm_name, method_token, il_offset), token);
-            var ret_code = res.Value?["result"]?["value"]?.Value<int>();
-
-            if (ret_code.HasValue)
-            {
-                bp.RemoteId = ret_code.Value;
-                bp.State = BreakpointState.Active;
-                //Log ("verbose", $"BP local id {bp.LocalId} enabled with remote id {bp.RemoteId}");
-            }
-
-            return bp;
-        }
-
-        async Task<DebugStore> LoadStore(SessionId sessionId, CancellationToken token)
-        {
-            var context = GetContext(sessionId);
-
-            if (Interlocked.CompareExchange(ref context.store, new DebugStore(logger), null) != null)
-                return await context.Source.Task;
-
-            try
-            {
-                var loaded_files = context.LoadedFiles;
-
-                if (loaded_files == null)
-                {
-                    var loaded = await SendMonoCommand(sessionId, MonoCommands.GetLoadedFiles(), token);
-                    loaded_files = loaded.Value?["result"]?["value"]?.ToObject<string[]>();
-                }
-
-                await
-                foreach (var source in context.store.Load(sessionId, loaded_files, token).WithCancellation(token))
-                {
-                    var scriptSource = JObject.FromObject(source.ToScriptSource(context.Id, context.AuxData));
-                    Log("verbose", $"\tsending {source.Url} {context.Id} {sessionId.sessionId}");
-
-                    SendEvent(sessionId, "Debugger.scriptParsed", scriptSource, token);
-
-                    foreach (var req in context.BreakpointRequests.Values)
-                    {
-                        if (req.TryResolve(source))
-                        {
-                            await SetBreakpoint(sessionId, context.store, req, true, token);
-                        }
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                context.Source.SetException(e);
-            }
-
-            if (!context.Source.Task.IsCompleted)
-                context.Source.SetResult(context.store);
-            return context.store;
-        }
-
-        async Task<DebugStore> RuntimeReady(SessionId sessionId, CancellationToken token)
-        {
-            var context = GetContext(sessionId);
-            if (Interlocked.CompareExchange(ref context.ready, new TaskCompletionSource<DebugStore>(), null) != null)
-                return await context.ready.Task;
-
-            var clear_result = await SendMonoCommand(sessionId, MonoCommands.ClearAllBreakpoints(), token);
-            if (clear_result.IsErr)
-            {
-                Log("verbose", $"Failed to clear breakpoints due to {clear_result}");
-            }
-
-            var store = await LoadStore(sessionId, token);
-
-            context.ready.SetResult(store);
-            SendEvent(sessionId, "Mono.runtimeReady", new JObject(), token);
-            return store;
-        }
-
-        async Task RemoveBreakpoint(MessageId msg_id, JObject args, CancellationToken token)
-        {
-            var bpid = args?["breakpointId"]?.Value<string>();
-
-            var context = GetContext(msg_id);
-            if (!context.BreakpointRequests.TryGetValue(bpid, out var breakpointRequest))
-                return;
-
-            foreach (var bp in breakpointRequest.Locations)
-            {
-                var res = await SendMonoCommand(msg_id, MonoCommands.RemoveBreakpoint(bp.RemoteId), token);
-                var ret_code = res.Value?["result"]?["value"]?.Value<int>();
-
-                if (ret_code.HasValue)
-                {
-                    bp.RemoteId = -1;
-                    bp.State = BreakpointState.Disabled;
-                }
-            }
-            breakpointRequest.Locations.Clear();
-        }
-
-        async Task SetBreakpoint(SessionId sessionId, DebugStore store, BreakpointRequest req, bool sendResolvedEvent, CancellationToken token)
-        {
-            var context = GetContext(sessionId);
-            if (req.Locations.Any())
-            {
-                Log("debug", $"locations already loaded for {req.Id}");
-                return;
-            }
-
-            var comparer = new SourceLocation.LocationComparer();
-            // if column is specified the frontend wants the exact matches
-            // and will clear the bp if it isn't close enoug
-            var locations = store.FindBreakpointLocations(req)
-                .Distinct(comparer)
-                .Where(l => l.Line == req.Line && (req.Column == 0 || l.Column == req.Column))
-                .OrderBy(l => l.Column)
-                .GroupBy(l => l.Id);
-
-            logger.LogDebug("BP request for '{req}' runtime ready {context.RuntimeReady}", req, GetContext(sessionId).IsRuntimeReady);
-
-            var breakpoints = new List<Breakpoint>();
-
-            foreach (var sourceId in locations)
-            {
-                var loc = sourceId.First();
-                var bp = await SetMonoBreakpoint(sessionId, req.Id, loc, token);
-
-                // If we didn't successfully enable the breakpoint
-                // don't add it to the list of locations for this id
-                if (bp.State != BreakpointState.Active)
-                    continue;
-
-                breakpoints.Add(bp);
-
-                var resolvedLocation = new
-                {
-                    breakpointId = req.Id,
-                    location = loc.AsLocation()
-                };
-
-                if (sendResolvedEvent)
-                    SendEvent(sessionId, "Debugger.breakpointResolved", JObject.FromObject(resolvedLocation), token);
-            }
-
-            req.Locations.AddRange(breakpoints);
-            return;
-        }
-
-        async Task<bool> GetPossibleBreakpoints(MessageId msg, SourceLocation start, SourceLocation end, CancellationToken token)
-        {
-            var bps = (await RuntimeReady(msg, token)).FindPossibleBreakpoints(start, end);
-
-            if (bps == null)
-                return false;
-
-            var response = new { locations = bps.Select(b => b.AsLocation()) };
-
-            SendResponse(msg, Result.OkFromObject(response), token);
-            return true;
-        }
-
-        void OnCompileDotnetScript(MessageId msg_id, CancellationToken token)
-        {
-            SendResponse(msg_id, Result.OkFromObject(new { }), token);
-        }
-
-        async Task<bool> OnGetScriptSource(MessageId msg_id, string script_id, CancellationToken token)
-        {
-            if (!SourceId.TryParse(script_id, out var id))
-                return false;
-
-            var src_file = (await LoadStore(msg_id, token)).GetFileById(id);
-
-            try
-            {
-                var uri = new Uri(src_file.Url);
-                string source = $"// Unable to find document {src_file.SourceUri}";
-
-                using (var data = await src_file.GetSourceAsync(checkHash: false, token: token))
-                {
-                    if (data.Length == 0)
-                        return false;
-
-                    using (var reader = new StreamReader(data))
-                        source = await reader.ReadToEndAsync();
-                }
-                SendResponse(msg_id, Result.OkFromObject(new { scriptSource = source }), token);
-            }
-            catch (Exception e)
-            {
-                var o = new
-                {
-                    scriptSource = $"// Unable to read document ({e.Message})\n" +
-                    $"Local path: {src_file?.SourceUri}\n" +
-                    $"SourceLink path: {src_file?.SourceLinkUri}\n"
-                };
-
-                SendResponse(msg_id, Result.OkFromObject(o), token);
-            }
-            return true;
-        }
-
-        async Task DeleteWebDriver(SessionId sessionId, CancellationToken token)
-        {
-            // see https://github.com/mono/mono/issues/19549 for background
-            if (hideWebDriver && sessions.Add(sessionId))
-            {
-                var res = await SendCommand(sessionId,
-                    "Page.addScriptToEvaluateOnNewDocument",
-                    JObject.FromObject(new { source = "delete navigator.constructor.prototype.webdriver" }),
-                    token);
-
-                if (sessionId != SessionId.Null && !res.IsOk)
-                    sessions.Remove(sessionId);
-            }
-        }
-    }
-}

+ 0 - 695
sdks/wasm/DebuggerTestSuite/ArrayTests.cs

@@ -1,695 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace DebuggerTests
-{
-
-    public class ArrayTests : DebuggerTestBase
-    {
-
-        [Theory]
-        [InlineData(19, 8, "PrimitiveTypeLocals", false, 0, false)]
-        [InlineData(19, 8, "PrimitiveTypeLocals", false, 0, true)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, false)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, true)]
-        public async Task InspectPrimitiveTypeArrayLocals(int line, int col, string method_name, bool test_prev_frame, int frame_idx, bool use_cfo) => await TestSimpleArrayLocals(
-            line, col,
-            entry_method_name: "[debugger-test] DebuggerTests.ArrayTestsClass:PrimitiveTypeLocals",
-            method_name: method_name,
-            etype_name: "int",
-            local_var_name_prefix: "int",
-            array: new[] { TNumber(4), TNumber(70), TNumber(1) },
-            array_elem_props: null,
-            test_prev_frame: test_prev_frame,
-            frame_idx: frame_idx,
-            use_cfo: use_cfo);
-
-        [Theory]
-        [InlineData(36, 8, "ValueTypeLocals", false, 0, false)]
-        [InlineData(36, 8, "ValueTypeLocals", false, 0, true)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, false)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, true)]
-        public async Task InspectValueTypeArrayLocals(int line, int col, string method_name, bool test_prev_frame, int frame_idx, bool use_cfo) => await TestSimpleArrayLocals(
-            line, col,
-            entry_method_name: "[debugger-test] DebuggerTests.ArrayTestsClass:ValueTypeLocals",
-            method_name: method_name,
-            etype_name: "DebuggerTests.Point",
-            local_var_name_prefix: "point",
-            array: new[]
-            {
-                TValueType("DebuggerTests.Point"),
-                    TValueType("DebuggerTests.Point"),
-            },
-            array_elem_props: new[]
-            {
-                TPoint(5, -2, "point_arr#Id#0", "Green"),
-                    TPoint(123, 0, "point_arr#Id#1", "Blue")
-            },
-            test_prev_frame: test_prev_frame,
-            frame_idx: frame_idx,
-            use_cfo: use_cfo);
-
-        [Theory]
-        [InlineData(54, 8, "ObjectTypeLocals", false, 0, false)]
-        [InlineData(54, 8, "ObjectTypeLocals", false, 0, true)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, false)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, true)]
-        public async Task InspectObjectArrayLocals(int line, int col, string method_name, bool test_prev_frame, int frame_idx, bool use_cfo) => await TestSimpleArrayLocals(
-            line, col,
-            entry_method_name: "[debugger-test] DebuggerTests.ArrayTestsClass:ObjectTypeLocals",
-            method_name: method_name,
-            etype_name: "DebuggerTests.SimpleClass",
-            local_var_name_prefix: "class",
-            array: new[]
-            {
-                TObject("DebuggerTests.SimpleClass"),
-                    TObject("DebuggerTests.SimpleClass", is_null : true),
-                    TObject("DebuggerTests.SimpleClass")
-            },
-            array_elem_props: new[]
-            {
-                TSimpleClass(5, -2, "class_arr#Id#0", "Green"),
-                    null, // Element is null
-                    TSimpleClass(123, 0, "class_arr#Id#2", "Blue")
-            },
-            test_prev_frame: test_prev_frame,
-            frame_idx: frame_idx,
-            use_cfo: use_cfo);
-
-        [Theory]
-        [InlineData(72, 8, "GenericTypeLocals", false, 0, false)]
-        [InlineData(72, 8, "GenericTypeLocals", false, 0, true)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, false)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, true)]
-        public async Task InspectGenericTypeArrayLocals(int line, int col, string method_name, bool test_prev_frame, int frame_idx, bool use_cfo) => await TestSimpleArrayLocals(
-            line, col,
-            entry_method_name: "[debugger-test] DebuggerTests.ArrayTestsClass:GenericTypeLocals",
-            method_name: method_name,
-            etype_name: "DebuggerTests.GenericClass<int>",
-            local_var_name_prefix: "gclass",
-            array: new[]
-            {
-                TObject("DebuggerTests.GenericClass<int>", is_null : true),
-                    TObject("DebuggerTests.GenericClass<int>"),
-                    TObject("DebuggerTests.GenericClass<int>")
-            },
-            array_elem_props: new[]
-            {
-                null, // Element is null
-                new
-                {
-                    Id = TString("gclass_arr#1#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Red"),
-                        Value = TNumber(5)
-                },
-                new
-                {
-                    Id = TString("gclass_arr#2#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Blue"),
-                        Value = TNumber(-12)
-                }
-            },
-            test_prev_frame: test_prev_frame,
-            frame_idx: frame_idx,
-            use_cfo: use_cfo);
-
-        [Theory]
-        [InlineData(89, 8, "GenericValueTypeLocals", false, 0, false)]
-        [InlineData(89, 8, "GenericValueTypeLocals", false, 0, true)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, false)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, true)]
-        public async Task InspectGenericValueTypeArrayLocals(int line, int col, string method_name, bool test_prev_frame, int frame_idx, bool use_cfo) => await TestSimpleArrayLocals(
-            line, col,
-            entry_method_name: "[debugger-test] DebuggerTests.ArrayTestsClass:GenericValueTypeLocals",
-            method_name: method_name,
-            etype_name: "DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>",
-            local_var_name_prefix: "gvclass",
-            array: new[]
-            {
-                TValueType("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>"),
-                    TValueType("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>")
-            },
-            array_elem_props: new[]
-            {
-                new
-                {
-                    Id = TString("gvclass_arr#1#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Red"),
-                        Value = TPoint(100, 200, "gvclass_arr#1#Value#Id", "Red")
-                },
-                new
-                {
-                    Id = TString("gvclass_arr#2#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Blue"),
-                        Value = TPoint(10, 20, "gvclass_arr#2#Value#Id", "Green")
-                }
-            },
-            test_prev_frame: test_prev_frame,
-            frame_idx: frame_idx,
-            use_cfo: use_cfo);
-
-        [Theory]
-        [InlineData(213, 8, "GenericValueTypeLocals2", false, 0, false)]
-        [InlineData(213, 8, "GenericValueTypeLocals2", false, 0, true)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, false)]
-        [InlineData(100, 8, "YetAnotherMethod", true, 2, true)]
-        public async Task InspectGenericValueTypeArrayLocals2(int line, int col, string method_name, bool test_prev_frame, int frame_idx, bool use_cfo) => await TestSimpleArrayLocals(
-            line, col,
-            entry_method_name: "[debugger-test] DebuggerTests.ArrayTestsClass:GenericValueTypeLocals2",
-            method_name: method_name,
-            etype_name: "DebuggerTests.SimpleGenericStruct<DebuggerTests.Point[]>",
-            local_var_name_prefix: "gvclass",
-            array: new[]
-            {
-                TValueType("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point[]>"),
-                    TValueType("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point[]>")
-            },
-            array_elem_props: new[]
-            {
-                new
-                {
-                    Id = TString("gvclass_arr#0#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Red"),
-                        Value = new []
-                        {
-                            TPoint(100, 200, "gvclass_arr#0#0#Value#Id", "Red"),
-                                TPoint(100, 200, "gvclass_arr#0#1#Value#Id", "Green")
-                        }
-                },
-                new
-                {
-                    Id = TString("gvclass_arr#1#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Blue"),
-                        Value = new []
-                        {
-                            TPoint(100, 200, "gvclass_arr#1#0#Value#Id", "Green"),
-                                TPoint(100, 200, "gvclass_arr#1#1#Value#Id", "Blue")
-                        }
-                }
-            },
-            test_prev_frame: test_prev_frame,
-            frame_idx: frame_idx,
-            use_cfo: use_cfo);
-
-        async Task TestSimpleArrayLocals(int line, int col, string entry_method_name, string method_name, string etype_name,
-            string local_var_name_prefix, object[] array, object[] array_elem_props,
-            bool test_prev_frame = false, int frame_idx = 0, bool use_cfo = false)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-array-test.cs";
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-
-                await SetBreakpoint(debugger_test_loc, line, col);
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method (" +
-                    $"'{entry_method_name}', { (test_prev_frame ? "true" : "false") }" +
-                    "); }, 1);";
-
-                var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, line, col, method_name);
-
-                var locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-                Assert.Equal(4, locals.Count());
-                CheckArray(locals, $"{local_var_name_prefix}_arr", $"{etype_name}[]", array?.Length ?? 0);
-                CheckArray(locals, $"{local_var_name_prefix}_arr_empty", $"{etype_name}[]", 0);
-                CheckObject(locals, $"{local_var_name_prefix}_arr_null", $"{etype_name}[]", is_null: true);
-                CheckBool(locals, "call_other", test_prev_frame);
-
-                var local_arr_name = $"{local_var_name_prefix}_arr";
-
-                JToken prefix_arr;
-                if (use_cfo)
-                { // Use `Runtime.callFunctionOn` to get the properties
-                    var frame = pause_location["callFrames"][frame_idx];
-                    var name = local_arr_name;
-                    var fl = await GetProperties(frame["callFrameId"].Value<string>());
-                    var l_obj = GetAndAssertObjectWithName(locals, name);
-                    var l_objectId = l_obj["value"]["objectId"]?.Value<string>();
-
-                    Assert.True(!String.IsNullOrEmpty(l_objectId), $"No objectId found for {name}");
-
-                    prefix_arr = await GetObjectWithCFO(l_objectId);
-                }
-                else
-                {
-                    prefix_arr = await GetObjectOnFrame(pause_location["callFrames"][frame_idx], local_arr_name);
-                }
-
-                await CheckProps(prefix_arr, array, local_arr_name);
-
-                if (array_elem_props?.Length > 0)
-                {
-                    for (int i = 0; i < array_elem_props.Length; i++)
-                    {
-                        var i_str = i.ToString();
-                        var label = $"{local_var_name_prefix}_arr[{i}]";
-                        if (array_elem_props[i] == null)
-                        {
-                            var act_i = prefix_arr.FirstOrDefault(jt => jt["name"]?.Value<string>() == i_str);
-                            Assert.True(act_i != null, $"[{label}] Couldn't find array element [{i_str}]");
-
-                            await CheckValue(act_i["value"], TObject(etype_name, is_null: true), label);
-                        }
-                        else
-                        {
-                            await CompareObjectPropertiesFor(prefix_arr, i_str, array_elem_props[i], label: label);
-                        }
-                    }
-                }
-
-                var props = await GetObjectOnFrame(pause_location["callFrames"][frame_idx], $"{local_var_name_prefix}_arr_empty");
-                await CheckProps(props, new object[0], "${local_var_name_prefix}_arr_empty");
-            });
-
-            async Task<JToken> GetObjectWithCFO(string objectId, JObject fn_args = null)
-            {
-                var fn_decl = "function () { return this; }";
-                var cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = fn_decl,
-                    objectId = objectId
-                });
-
-                if (fn_args != null)
-                    cfo_args["arguments"] = fn_args;
-
-                // callFunctionOn
-                var result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-
-                return await GetProperties(result.Value["result"]["objectId"]?.Value<string>(), fn_args);
-            }
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectObjectArrayMembers(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            int line = 227;
-            int col = 12;
-            string entry_method_name = "[debugger-test] DebuggerTests.ArrayTestsClass:ObjectArrayMembers";
-            string method_name = "PlaceholderMethod";
-            int frame_idx = 1;
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-array-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, line, col);
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method (" +
-                    $"'{entry_method_name}'" +
-                    "); }, 1);";
-
-                var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, line, col, method_name);
-                var locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-                Assert.Single(locals);
-                CheckObject(locals, "c", "DebuggerTests.Container");
-
-                var c_props = await GetObjectOnFrame(pause_location["callFrames"][frame_idx], "c");
-                await CheckProps(c_props, new
-                {
-                    id = TString("c#id"),
-                    ClassArrayProperty = TArray("DebuggerTests.SimpleClass[]", 3),
-                    ClassArrayField = TArray("DebuggerTests.SimpleClass[]", 3),
-                    PointsProperty = TArray("DebuggerTests.Point[]", 2),
-                    PointsField = TArray("DebuggerTests.Point[]", 2)
-                },
-                    "c"
-                );
-
-                await CompareObjectPropertiesFor(c_props, "ClassArrayProperty",
-                    new[]
-                    {
-                        TSimpleClass(5, -2, "ClassArrayProperty#Id#0", "Green"),
-                            TSimpleClass(30, 1293, "ClassArrayProperty#Id#1", "Green"),
-                            TObject("DebuggerTests.SimpleClass", is_null : true)
-                    },
-                    label: "InspectLocalsWithStructsStaticAsync");
-
-                await CompareObjectPropertiesFor(c_props, "ClassArrayField",
-                    new[]
-                    {
-                        TObject("DebuggerTests.SimpleClass", is_null : true),
-                            TSimpleClass(5, -2, "ClassArrayField#Id#1", "Blue"),
-                            TSimpleClass(30, 1293, "ClassArrayField#Id#2", "Green")
-                    },
-                    label: "c#ClassArrayField");
-
-                await CompareObjectPropertiesFor(c_props, "PointsProperty",
-                    new[]
-                    {
-                        TPoint(5, -2, "PointsProperty#Id#0", "Green"),
-                            TPoint(123, 0, "PointsProperty#Id#1", "Blue"),
-                    },
-                    label: "c#PointsProperty");
-
-                await CompareObjectPropertiesFor(c_props, "PointsField",
-                    new[]
-                    {
-                        TPoint(5, -2, "PointsField#Id#0", "Green"),
-                            TPoint(123, 0, "PointsField#Id#1", "Blue"),
-                    },
-                    label: "c#PointsField");
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectValueTypeArrayLocalsStaticAsync(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            int line = 157;
-            int col = 12;
-            string entry_method_name = "[debugger-test] DebuggerTests.ArrayTestsClass:ValueTypeLocalsAsync";
-            string method_name = "MoveNext"; // BUG: this should be ValueTypeLocalsAsync
-            int frame_idx = 0;
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-array-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, line, col);
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method_async (" +
-                    $"'{entry_method_name}', false" // *false* here keeps us only in the static method
-                    +
-                    "); }, 1);";
-
-                var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, line, col, method_name);
-                var frame_locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-                await CheckProps(frame_locals, new
-                {
-                    call_other = TBool(false),
-                    gvclass_arr = TArray("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>[]", 2),
-                    gvclass_arr_empty = TArray("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>[]"),
-                    gvclass_arr_null = TObject("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>[]", is_null: true),
-                    gvclass = TValueType("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>"),
-                    // BUG: this shouldn't be null!
-                    points = TObject("DebuggerTests.Point[]", is_null: true)
-                }, "ValueTypeLocalsAsync#locals");
-
-                var local_var_name_prefix = "gvclass";
-                await CompareObjectPropertiesFor(frame_locals, local_var_name_prefix, new
-                {
-                    Id = TString(null),
-                    Color = TEnum("DebuggerTests.RGB", "Red"),
-                    Value = TPoint(0, 0, null, "Red")
-                });
-
-                await CompareObjectPropertiesFor(frame_locals, $"{local_var_name_prefix}_arr",
-                    new[]
-                    {
-                        new
-                        {
-                            Id = TString("gvclass_arr#1#Id"),
-                                Color = TEnum("DebuggerTests.RGB", "Red"),
-                                Value = TPoint(100, 200, "gvclass_arr#1#Value#Id", "Red")
-                        },
-                        new
-                        {
-                            Id = TString("gvclass_arr#2#Id"),
-                                Color = TEnum("DebuggerTests.RGB", "Blue"),
-                                Value = TPoint(10, 20, "gvclass_arr#2#Value#Id", "Green")
-                        }
-                    }
-                );
-                await CompareObjectPropertiesFor(frame_locals, $"{local_var_name_prefix}_arr_empty",
-                    new object[0]);
-            });
-        }
-
-        // TODO: Check previous frame too
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectValueTypeArrayLocalsInstanceAsync(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            int line = 170;
-            int col = 12;
-            string entry_method_name = "[debugger-test] DebuggerTests.ArrayTestsClass:ValueTypeLocalsAsync";
-            int frame_idx = 0;
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-array-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, line, col);
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method_async (" +
-                    $"'{entry_method_name}', true" +
-                    "); }, 1);";
-
-                // BUG: Should be InspectValueTypeArrayLocalsInstanceAsync
-                var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, line, col, "MoveNext");
-
-                var frame_locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-                await CheckProps(frame_locals, new
-                {
-                    t1 = TObject("DebuggerTests.SimpleGenericStruct<DebuggerTests.Point>"),
-                    @this = TObject("DebuggerTests.ArrayTestsClass"),
-                    point_arr = TArray("DebuggerTests.Point[]", 2),
-                    point = TValueType("DebuggerTests.Point")
-                }, "InspectValueTypeArrayLocalsInstanceAsync#locals");
-
-                await CompareObjectPropertiesFor(frame_locals, "t1",
-                    new
-                    {
-                        Id = TString("gvclass_arr#1#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Red"),
-                        Value = TPoint(100, 200, "gvclass_arr#1#Value#Id", "Red")
-                    });
-
-                await CompareObjectPropertiesFor(frame_locals, "point_arr",
-                    new[]
-                    {
-                        TPoint(5, -2, "point_arr#Id#0", "Red"),
-                            TPoint(123, 0, "point_arr#Id#1", "Blue"),
-                    }
-                );
-
-                await CompareObjectPropertiesFor(frame_locals, "point",
-                    TPoint(45, 51, "point#Id", "Green"));
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectValueTypeArrayLocalsInAsyncStaticStructMethod(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            int line = 244;
-            int col = 12;
-            string entry_method_name = "[debugger-test] DebuggerTests.ArrayTestsClass:EntryPointForStructMethod";
-            int frame_idx = 0;
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-array-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, line, col);
-                //await SetBreakpoint (debugger_test_loc, 143, 3);
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method_async (" +
-                    $"'{entry_method_name}', false" +
-                    "); }, 1);";
-
-                // BUG: Should be InspectValueTypeArrayLocalsInstanceAsync
-                var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, line, col, "MoveNext");
-
-                var frame_locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-                await CheckProps(frame_locals, new
-                {
-                    call_other = TBool(false),
-                    local_i = TNumber(5),
-                    sc = TSimpleClass(10, 45, "sc#Id", "Blue")
-                }, "InspectValueTypeArrayLocalsInAsyncStaticStructMethod#locals");
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectValueTypeArrayLocalsInAsyncInstanceStructMethod(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            int line = 251;
-            int col = 12;
-            string entry_method_name = "[debugger-test] DebuggerTests.ArrayTestsClass:EntryPointForStructMethod";
-            int frame_idx = 0;
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-array-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, line, col);
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method_async (" +
-                    $"'{entry_method_name}', true" +
-                    "); }, 1);";
-
-                // BUG: Should be InspectValueTypeArrayLocalsInstanceAsync
-                var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, line, col, "MoveNext");
-
-                var frame_locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-                await CheckProps(frame_locals, new
-                {
-                    sc_arg = TObject("DebuggerTests.SimpleClass"),
-                    @this = TValueType("DebuggerTests.Point"),
-                    local_gs = TValueType("DebuggerTests.SimpleGenericStruct<int>")
-                },
-                    "locals#0");
-
-                await CompareObjectPropertiesFor(frame_locals, "local_gs",
-                    new
-                    {
-                        Id = TString("local_gs#Id"),
-                        Color = TEnum("DebuggerTests.RGB", "Green"),
-                        Value = TNumber(4)
-                    },
-                    label: "local_gs#0");
-
-                await CompareObjectPropertiesFor(frame_locals, "sc_arg",
-                    TSimpleClass(10, 45, "sc_arg#Id", "Blue"),
-                    label: "sc_arg#0");
-
-                await CompareObjectPropertiesFor(frame_locals, "this",
-                    TPoint(90, -4, "point#Id", "Green"),
-                    label: "this#0");
-            });
-        }
-
-        [Fact]
-        public async Task InvalidArrayId() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.Container", "PlaceholderMethod", 1, "PlaceholderMethod",
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ArrayTestsClass:ObjectArrayMembers'); }, 1);",
-            wait_for_event_fn: async (pause_location) =>
-           {
-
-               int frame_idx = 1;
-               var frame_locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-               var c_obj = GetAndAssertObjectWithName(frame_locals, "c");
-               var c_obj_id = c_obj["value"]?["objectId"]?.Value<string>();
-               Assert.NotNull(c_obj_id);
-
-               // Invalid format
-               await GetProperties("dotnet:array:4123", expect_ok: false);
-
-               // Invalid object id
-               await GetProperties("dotnet:array:{ \"arrayId\": 234980 }", expect_ok: false);
-
-               // Trying to access object as an array
-               if (!DotnetObjectId.TryParse(c_obj_id, out var id) || id.Scheme != "object")
-                   Assert.True(false, "Unexpected object id format. Maybe this test is out of sync with the object id format in library_mono.js?");
-
-               if (!int.TryParse(id.Value, out var idNum))
-                   Assert.True(false, "Expected a numeric value part of the object id: {c_obj_id}");
-               await GetProperties($"dotnet:array:{{\"arrayId\":{idNum}}}", expect_ok: false);
-           });
-
-        [Fact]
-        public async Task InvalidValueTypeArrayIndex() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.Container", "PlaceholderMethod", 1, "PlaceholderMethod",
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ArrayTestsClass:ObjectArrayMembers'); }, 1);",
-            locals_fn: async (locals) =>
-           {
-               var this_obj = GetAndAssertObjectWithName(locals, "this");
-               var c_obj = GetAndAssertObjectWithName(await GetProperties(this_obj["value"]["objectId"].Value<string>()), "c");
-               var c_obj_id = c_obj["value"]?["objectId"]?.Value<string>();
-               Assert.NotNull(c_obj_id);
-
-               var c_props = await GetProperties(c_obj_id);
-
-               var pf_arr = GetAndAssertObjectWithName(c_props, "PointsField");
-               var pf_arr_elems = await GetProperties(pf_arr["value"]["objectId"].Value<string>());
-
-               if (!DotnetObjectId.TryParse(pf_arr_elems[0]["value"]?["objectId"]?.Value<string>(), out var id))
-                   Assert.True(false, "Couldn't parse objectId for PointsFields' elements");
-
-               AssertEqual("valuetype", id.Scheme, "Expected a valuetype id");
-               var id_args = id.ValueAsJson;
-               Assert.True(id_args["arrayId"] != null, "ObjectId format for array seems to have changed. Expected to find 'arrayId' in the value. Update this test");
-               Assert.True(id_args != null, "Expected to get a json as the value part of {id}");
-
-               // Try one valid query, to confirm that the id format hasn't changed!
-               id_args["arrayIdx"] = 0;
-               await GetProperties($"dotnet:valuetype:{id_args.ToString(Newtonsoft.Json.Formatting.None)}", expect_ok: true);
-
-               id_args["arrayIdx"] = 12399;
-               await GetProperties($"dotnet:valuetype:{id_args.ToString(Newtonsoft.Json.Formatting.None)}", expect_ok: false);
-
-               id_args["arrayIdx"] = -1;
-               await GetProperties($"dotnet:valuetype:{id_args.ToString(Newtonsoft.Json.Formatting.None)}", expect_ok: false);
-
-               id_args["arrayIdx"] = "qwe";
-               await GetProperties($"dotnet:valuetype:{id_args.ToString(Newtonsoft.Json.Formatting.None)}", expect_ok: false);
-           });
-
-        [Fact]
-        public async Task InvalidAccessors() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.Container", "PlaceholderMethod", 1, "PlaceholderMethod",
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ArrayTestsClass:ObjectArrayMembers'); }, 1);",
-            locals_fn: async (locals) =>
-           {
-               var this_obj = GetAndAssertObjectWithName(locals, "this");
-               var c_obj = GetAndAssertObjectWithName(await GetProperties(this_obj["value"]["objectId"].Value<string>()), "c");
-               var c_obj_id = c_obj["value"]?["objectId"]?.Value<string>();
-               Assert.NotNull(c_obj_id);
-
-               var c_props = await GetProperties(c_obj_id);
-
-               var pf_arr = GetAndAssertObjectWithName(c_props, "PointsField");
-
-               var invalid_accessors = new object[] { "NonExistant", "10000", "-2", 10000, -2, null, String.Empty };
-               foreach (var invalid_accessor in invalid_accessors)
-               {
-                   // var res = await InvokeGetter (JObject.FromObject (new { value = new { objectId = obj_id } }), invalid_accessor, expect_ok: true);
-                   var res = await InvokeGetter(pf_arr, invalid_accessor, expect_ok: true);
-                   AssertEqual("undefined", res.Value["result"]?["type"]?.ToString(), "Expected to get undefined result for non-existant accessor");
-               }
-           });
-
-    }
-}

+ 0 - 981
sdks/wasm/DebuggerTestSuite/CallFunctionOnTests.cs

@@ -1,981 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace DebuggerTests
-{
-
-    public class CallFunctionOnTests : DebuggerTestBase
-    {
-
-        // This tests `callFunctionOn` with a function that the vscode-js-debug extension uses
-        // Using this here as a non-trivial test case
-        [Theory]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, 10, false)]
-        [InlineData("big_array_js_test (0);", "/other.js", 8, 1, 0, true)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, 10, false)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 0);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, 0, true)]
-        public async Task CheckVSCodeTestFunction1(string eval_fn, string bp_loc, int line, int col, int len, bool roundtrip)
-        {
-            string vscode_fn0 = "function(){const e={__proto__:this.__proto__},t=Object.getOwnPropertyNames(this);for(let r=0;r<t.length;++r){const n=t[r],i=n>>>0;if(String(i>>>0)===n&&i>>>0!=4294967295)continue;const a=Object.getOwnPropertyDescriptor(this,n);a&&Object.defineProperty(e,n,a)}return e}";
-
-            await RunCallFunctionOn(eval_fn, vscode_fn0, "big", bp_loc, line, col, res_array_len: len, roundtrip: roundtrip,
-                test_fn: async (result) =>
-               {
-
-                   var is_js = bp_loc.EndsWith(".js", StringComparison.Ordinal);
-                   var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = true,
-                       ownProperties = false
-                   }), ctx.token);
-                   if (is_js)
-                       await CheckProps(obj_accessors.Value["result"], new { __proto__ = TIgnore() }, "obj_accessors");
-                   else
-                       AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
-
-                   // Check for a __proto__ object
-                   // isOwn = true, accessorPropertiesOnly = false
-                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = false,
-                       ownProperties = true
-                   }), ctx.token);
-
-                   await CheckProps(obj_own.Value["result"], new
-                   {
-                       length = TNumber(len),
-                       // __proto__ = TArray (type, 0) // Is this one really required?
-                   }, $"obj_own", num_fields: is_js ? 2 : 1);
-
-               });
-        }
-
-        void CheckJFunction(JToken actual, string className, string label)
-        {
-            AssertEqual("function", actual["type"]?.Value<string>(), $"{label}-type");
-            AssertEqual(className, actual["className"]?.Value<string>(), $"{label}-className");
-        }
-
-        // This tests `callFunctionOn` with a function that the vscode-js-debug extension uses
-        // Using this here as a non-trivial test case
-        [Theory]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, 10)]
-        [InlineData("big_array_js_test (0);", "/other.js", 8, 1, 0)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, 10)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 0);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, 0)]
-        public async Task CheckVSCodeTestFunction2(string eval_fn, string bp_loc, int line, int col, int len)
-        {
-            var fetch_start_idx = 2;
-            var num_elems_fetch = 3;
-            string vscode_fn1 = "function(e,t){const r={},n=-1===e?0:e,i=-1===t?this.length:e+t;for(let e=n;e<i&&e<this.length;++e){const t=Object.getOwnPropertyDescriptor(this,e);t&&Object.defineProperty(r,e,t)}return r}";
-
-            await RunCallFunctionOn(eval_fn, vscode_fn1, "big", bp_loc, line, col,
-                fn_args: JArray.FromObject(new[]
-                {
-                    new { @value = fetch_start_idx },
-                    new { @value = num_elems_fetch }
-                }),
-                test_fn: async (result) =>
-               {
-
-                   var is_js = bp_loc.EndsWith(".js", StringComparison.Ordinal);
-
-                   // isOwn = false, accessorPropertiesOnly = true
-                   var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = true,
-                       ownProperties = false
-                   }), ctx.token);
-                   if (is_js)
-                       await CheckProps(obj_accessors.Value["result"], new { __proto__ = TIgnore() }, "obj_accessors");
-                   else
-                       AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
-
-                   // Ignoring the __proto__ property
-
-                   // isOwn = true, accessorPropertiesOnly = false
-                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = false,
-                       ownProperties = true
-                   }), ctx.token);
-
-                   var obj_own_val = obj_own.Value["result"];
-                   var num_elems_recd = len == 0 ? 0 : num_elems_fetch;
-                   AssertEqual(is_js ? num_elems_recd + 1 : num_elems_recd, obj_own_val.Count(), $"obj_own-count");
-
-                   if (is_js)
-                       CheckObject(obj_own_val, "__proto__", "Object");
-
-                   for (int i = fetch_start_idx; i < fetch_start_idx + num_elems_recd; i++)
-                       CheckNumber(obj_own_val, i.ToString(), 1000 + i);
-               });
-        }
-
-        [Theory]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, false)]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, true)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, false)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, true)]
-        public async Task RunOnArrayReturnEmptyArray(string eval_fn, string bp_loc, int line, int col, bool roundtrip)
-        {
-            var ret_len = 0;
-
-            await RunCallFunctionOn(eval_fn,
-                "function () { return []; }",
-                "big", bp_loc, line, col,
-                res_array_len: ret_len,
-                roundtrip: roundtrip,
-                test_fn: async (result) =>
-               {
-                   var is_js = bp_loc.EndsWith(".js", StringComparison.Ordinal);
-
-                   // getProperties (isOwn = false, accessorPropertiesOnly = true)
-                   var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = true,
-                       ownProperties = false
-                   }), ctx.token);
-                   if (is_js)
-                       await CheckProps(obj_accessors.Value["result"], new { __proto__ = TIgnore() }, "obj_accessors");
-                   else
-                       AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
-
-                   // getProperties (isOwn = true, accessorPropertiesOnly = false)
-                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = false,
-                       ownProperties = true
-                   }), ctx.token);
-
-                   await CheckProps(obj_own.Value["result"], new
-                   {
-                       length = TNumber(ret_len),
-                       // __proto__ returned by js
-                   }, $"obj_own", num_fields: is_js ? 2 : 1);
-               });
-        }
-
-        [Theory]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, false)]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, true)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, false)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, true)]
-        public async Task RunOnArrayReturnArray(string eval_fn, string bp_loc, int line, int col, bool roundtrip)
-        {
-            var ret_len = 5;
-            await RunCallFunctionOn(eval_fn,
-                "function (m) { return Object.values (this).filter ((k, i) => i%m == 0); }",
-                "big", bp_loc, line, col,
-                fn_args: JArray.FromObject(new[] { new { value = 2 } }),
-                res_array_len: ret_len,
-                roundtrip: roundtrip,
-                test_fn: async (result) =>
-               {
-                   var is_js = bp_loc.EndsWith(".js");
-
-                   // getProperties (own=false)
-                   var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = true,
-                       ownProperties = false
-                   }), ctx.token);
-
-                   if (is_js)
-                       await CheckProps(obj_accessors.Value["result"], new { __proto__ = TIgnore() }, "obj_accessors");
-                   else
-                       AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
-
-                   // getProperties (own=true)
-                   // isOwn = true, accessorPropertiesOnly = false
-                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-                   {
-                       objectId = result.Value["result"]["objectId"].Value<string>(),
-                       accessorPropertiesOnly = false,
-                       ownProperties = true
-                   }), ctx.token);
-
-                   // AssertEqual (2, obj_own.Value ["result"].Count (), $"{label}-obj_own.count");
-
-                   var obj_own_val = obj_own.Value["result"];
-                   await CheckProps(obj_own_val, new
-                   {
-                       length = TNumber(ret_len),
-                       // __proto__ returned by JS
-                   }, $"obj_own", num_fields: (is_js ? ret_len + 2 : ret_len + 1));
-
-                   for (int i = 0; i < ret_len; i++)
-                       CheckNumber(obj_own_val, i.ToString(), i * 2 + 1000);
-               });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task RunOnVTArray(bool roundtrip) => await RunCallFunctionOn(
-            "invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);",
-            "function (m) { return Object.values (this).filter ((k, i) => i%m == 0); }",
-            "ss_arr",
-            "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12,
-            fn_args: JArray.FromObject(new[] { new { value = 2 } }),
-            res_array_len: 5,
-            roundtrip: roundtrip,
-            test_fn: async (result) =>
-           {
-               var ret_len = 5;
-
-               // getProperties (own=false)
-               var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-               {
-                   objectId = result.Value["result"]["objectId"].Value<string>(),
-                   accessorPropertiesOnly = true,
-                   ownProperties = false
-               }), ctx.token);
-
-               AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
-
-               // getProperties (own=true)
-               // isOwn = true, accessorPropertiesOnly = false
-               var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-               {
-                   objectId = result.Value["result"]["objectId"].Value<string>(),
-                   accessorPropertiesOnly = false,
-                   ownProperties = true
-               }), ctx.token);
-
-               var obj_own_val = obj_own.Value["result"];
-               await CheckProps(obj_own_val, new
-               {
-                   length = TNumber(ret_len),
-                   // __proto__ returned by JS
-               }, "obj_own", num_fields: ret_len + 1);
-
-               for (int i = 0; i < ret_len; i++)
-               {
-                   var act_i = CheckValueType(obj_own_val, i.ToString(), "Math.SimpleStruct");
-
-                   // Valuetypes can get sent as part of the container's getProperties, so ensure that we can access it
-                   var act_i_props = await GetProperties(act_i["value"]["objectId"]?.Value<string>());
-                   await CheckProps(act_i_props, new
-                   {
-                       dt = TValueType("System.DateTime", new DateTime(2020 + (i * 2), 1, 2, 3, 4, 5).ToString()),
-                       gs = TValueType("Math.GenericStruct<System.DateTime>")
-                   }, "obj_own ss_arr[{i}]");
-
-                   var gs_props = await GetObjectOnLocals(act_i_props, "gs");
-                   await CheckProps(gs_props, new
-                   {
-                       List = TObject("System.Collections.Generic.List<System.DateTime>", is_null: true),
-                       StringField = TString($"ss_arr # {i * 2} # gs # StringField")
-                   }, "obj_own ss_arr[{i}].gs");
-
-               }
-           });
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task RunOnCFOValueTypeResult(bool roundtrip) => await RunCallFunctionOn(
-            eval_fn: "invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);",
-            fn_decl: "function () { return this; }",
-            local_name: "simple_struct",
-            bp_loc: "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12,
-            roundtrip: roundtrip,
-            test_fn: async (result) =>
-           {
-
-               // getProperties (own=false)
-               var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-               {
-                   objectId = result.Value["result"]["objectId"].Value<string>(),
-                   accessorPropertiesOnly = true,
-                   ownProperties = false
-               }), ctx.token);
-               AssertEqual(0, obj_accessors.Value["result"].Count(), "obj_accessors-count");
-
-               // getProperties (own=true)
-               // isOwn = true, accessorPropertiesOnly = false
-               var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-               {
-                   objectId = result.Value["result"]["objectId"].Value<string>(),
-                   accessorPropertiesOnly = false,
-                   ownProperties = true
-               }), ctx.token);
-
-               var obj_own_val = obj_own.Value["result"];
-               var dt = new DateTime(2020, 1, 2, 3, 4, 5);
-               await CheckProps(obj_own_val, new
-               {
-                   dt = TValueType("System.DateTime", dt.ToString()),
-                   gs = TValueType("Math.GenericStruct<System.DateTime>")
-               }, $"obj_own-props");
-
-               await CheckDateTime(obj_own_val, "dt", dt);
-
-               var gs_props = await GetObjectOnLocals(obj_own_val, "gs");
-               await CheckProps(gs_props, new
-               {
-                   List = TObject("System.Collections.Generic.List<System.DateTime>", is_null: true),
-                   StringField = TString($"simple_struct # gs # StringField")
-               }, "simple_struct.gs-props");
-           });
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task RunOnJSObject(bool roundtrip) => await RunCallFunctionOn(
-            "object_js_test ();",
-            "function () { return this; }",
-            "obj", "/other.js", 17, 1,
-            fn_args: JArray.FromObject(new[] { new { value = 2 } }),
-            roundtrip: roundtrip,
-            test_fn: async (result) =>
-           {
-
-               // getProperties (own=false)
-               var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-               {
-                   objectId = result.Value["result"]["objectId"].Value<string>(),
-                   accessorPropertiesOnly = true,
-                   ownProperties = false
-               }), ctx.token);
-
-               await CheckProps(obj_accessors.Value["result"], new { __proto__ = TIgnore() }, "obj_accessors");
-
-               // getProperties (own=true)
-               // isOwn = true, accessorPropertiesOnly = false
-               var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
-               {
-                   objectId = result.Value["result"]["objectId"].Value<string>(),
-                   accessorPropertiesOnly = false,
-                   ownProperties = true
-               }), ctx.token);
-
-               var obj_own_val = obj_own.Value["result"];
-               await CheckProps(obj_own_val, new
-               {
-                   a_obj = TObject("Object"),
-                   b_arr = TArray("Array", 2)
-               }, "obj_own", num_fields: 3);
-           });
-
-        [Theory]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, false)]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, true)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, false)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, true)]
-        public async Task RunOnArrayReturnObjectArrayByValue(string eval_fn, string bp_loc, int line, int col, bool roundtrip)
-        {
-            var ret_len = 5;
-            await RunCallFunctionOn(eval_fn,
-                "function () { return Object.values (this).filter ((k, i) => i%2 == 0); }",
-                "big", bp_loc, line, col, returnByValue: true, roundtrip: roundtrip,
-                test_fn: async (result) =>
-               {
-                   // Check cfo result
-                   AssertEqual(JTokenType.Object, result.Value["result"].Type, "cfo-result-jsontype");
-                   AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
-
-                   AssertEqual(JTokenType.Array, result.Value["result"]["value"].Type, "cfo-res-value-jsontype");
-                   var actual = result.Value["result"]?["value"].Values<JToken>().ToArray();
-                   AssertEqual(ret_len, actual.Length, "cfo-res-value-length");
-
-                   for (int i = 0; i < ret_len; i++)
-                   {
-                       var exp_num = i * 2 + 1000;
-                       if (bp_loc.EndsWith(".js", StringComparison.Ordinal))
-                           AssertEqual(exp_num, actual[i].Value<int>(), $"[{i}]");
-                       else
-                       {
-                           AssertEqual("number", actual[i]?["type"]?.Value<string>(), $"[{i}]-type");
-                           AssertEqual(exp_num.ToString(), actual[i]?["description"]?.Value<string>(), $"[{i}]-description");
-                           AssertEqual(exp_num, actual[i]?["value"]?.Value<int>(), $"[{i}]-value");
-                       }
-                   }
-                   await Task.CompletedTask;
-               });
-        }
-
-        [Theory]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, false)]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, true)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, false)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, true)]
-        public async Task RunOnArrayReturnArrayByValue(string eval_fn, string bp_loc, int line, int col, bool roundtrip) => await RunCallFunctionOn(eval_fn,
-            "function () { return Object.getOwnPropertyNames (this); }",
-            "big", bp_loc, line, col, returnByValue: true,
-            roundtrip: roundtrip,
-            test_fn: async (result) =>
-           {
-               // Check cfo result
-               AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
-
-               var exp = new JArray();
-               for (int i = 0; i < 10; i++)
-                   exp.Add(i.ToString());
-               exp.Add("length");
-
-               var actual = result.Value["result"]?["value"];
-               if (!JObject.DeepEquals(exp, actual))
-               {
-                   Assert.True(false, $"Results don't match.\nExpected: {exp}\nActual:  {actual}");
-               }
-               await Task.CompletedTask;
-           });
-
-        [Theory]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, false)]
-        [InlineData("big_array_js_test (10);", "/other.js", 8, 1, true)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, false)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, true)]
-        public async Task RunOnArrayReturnPrimitive(string eval_fn, string bp_loc, int line, int col, bool return_by_val)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                await SetBreakpoint(bp_loc, line, col);
-
-                // callFunctionOn
-                var eval_expr = $"window.setTimeout(function() {{ {eval_fn} }}, 1);";
-                var result = await ctx.cli.SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = eval_expr }), ctx.token);
-                var pause_location = await ctx.insp.WaitFor(Inspector.PAUSE);
-
-                // Um for js we get "scriptId": "6"
-                // CheckLocation (bp_loc, line, col, ctx.scripts, pause_location ["callFrames"][0]["location"]);
-
-                // Check the object at the bp
-                var frame_locals = await GetProperties(pause_location["callFrames"][0]["scopeChain"][0]["object"]["objectId"].Value<string>());
-                var obj = GetAndAssertObjectWithName(frame_locals, "big");
-                var obj_id = obj["value"]["objectId"].Value<string>();
-
-                var cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = "function () { return 5; }",
-                    objectId = obj_id
-                });
-
-                // value of @returnByValue doesn't matter, as the returned value
-                // is a primitive
-                if (return_by_val)
-                    cfo_args["returnByValue"] = return_by_val;
-
-                // callFunctionOn
-                result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-                await CheckValue(result.Value["result"], TNumber(5), "cfo-res");
-
-                cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = "function () { return 'test value'; }",
-                    objectId = obj_id
-                });
-
-                // value of @returnByValue doesn't matter, as the returned value
-                // is a primitive
-                if (return_by_val)
-                    cfo_args["returnByValue"] = return_by_val;
-
-                // callFunctionOn
-                result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-                await CheckValue(result.Value["result"], JObject.FromObject(new { type = "string", value = "test value" }), "cfo-res");
-
-                cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = "function () { return null; }",
-                    objectId = obj_id
-                });
-
-                // value of @returnByValue doesn't matter, as the returned value
-                // is a primitive
-                if (return_by_val)
-                    cfo_args["returnByValue"] = return_by_val;
-
-                // callFunctionOn
-                result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-                await CheckValue(result.Value["result"], JObject.Parse("{ type: 'object', subtype: 'null', value: null }"), "cfo-res");
-            });
-        }
-
-        public static TheoryData<string, string, int, int, bool?> SilentErrorsTestData(bool? silent) => new TheoryData<string, string, int, int, bool?>
-        { { "invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:LocalsTest', 10);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 23, 12, silent },
-            { "big_array_js_test (10);", "/other.js", 8, 1, silent }
-        };
-
-        [Theory]
-        [MemberData(nameof(SilentErrorsTestData), null)]
-        [MemberData(nameof(SilentErrorsTestData), false)]
-        [MemberData(nameof(SilentErrorsTestData), true)]
-        public async Task CFOWithSilentReturnsErrors(string eval_fn, string bp_loc, int line, int col, bool? silent)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                await SetBreakpoint(bp_loc, line, col);
-
-                // callFunctionOn
-                var eval_expr = "window.setTimeout(function() { " + eval_fn + " }, 1);";
-                var result = await ctx.cli.SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = eval_expr }), ctx.token);
-                var pause_location = await ctx.insp.WaitFor(Inspector.PAUSE);
-
-                var frame_locals = await GetProperties(pause_location["callFrames"][0]["scopeChain"][0]["object"]["objectId"].Value<string>());
-                var obj = GetAndAssertObjectWithName(frame_locals, "big");
-                var big_obj_id = obj["value"]["objectId"].Value<string>();
-                var error_msg = "#This is an error message#";
-
-                // Check the object at the bp
-                var cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = $"function () {{ throw Error ('{error_msg}'); }}",
-                    objectId = big_obj_id
-                });
-
-                if (silent.HasValue)
-                    cfo_args["silent"] = silent;
-
-                // callFunctionOn, Silent does not change the result, except that the error
-                // doesn't get reported, and the execution is NOT paused even with setPauseOnException=true
-                result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-                Assert.False(result.IsOk, "result.IsOk");
-                Assert.True(result.IsErr, "result.IsErr");
-
-                var hasErrorMessage = result.Error["exceptionDetails"]?["exception"]?["description"]?.Value<string>()?.Contains(error_msg);
-                Assert.True((hasErrorMessage ?? false), "Exception message not found");
-            });
-        }
-
-        public static TheoryData<string, string, int, int, string, Func<string[], object>, string, bool> GettersTestData(string local_name, bool use_cfo) => new TheoryData<string, string, int, int, string, Func<string[], object>, string, bool>
-        {
-            // Chrome sends this one
-            {
-                "invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTest');",
-                "PropertyGettersTest",
-                30,
-                12,
-                "function invokeGetter(arrayStr){ let result=this; const properties=JSON.parse(arrayStr); for(let i=0,n=properties.length;i<n;++i){ result=result[properties[i]]; } return result; }",
-                (arg_strs) => JArray.FromObject(arg_strs).ToString(),
-                local_name,
-                use_cfo
-            },
-            {
-                "invoke_static_method_async ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTestAsync');",
-                "MoveNext",
-                38,
-                12,
-                "function invokeGetter(arrayStr){ let result=this; const properties=JSON.parse(arrayStr); for(let i=0,n=properties.length;i<n;++i){ result=result[properties[i]]; } return result; }",
-                (arg_strs) => JArray.FromObject(arg_strs).ToString(),
-                local_name,
-                use_cfo
-            },
-
-            // VSCode sends this one
-            {
-                "invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTest');",
-                "PropertyGettersTest",
-                30,
-                12,
-                "function(e){return this[e]}",
-                (args_str) => args_str?.Length > 0 ? args_str[0] : String.Empty,
-                local_name,
-                use_cfo
-            },
-            {
-                "invoke_static_method_async ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTestAsync');",
-                "MoveNext",
-                38,
-                12,
-                "function(e){return this[e]}",
-                (args_str) => args_str?.Length > 0 ? args_str[0] : String.Empty,
-                local_name,
-                use_cfo
-            }
-        };
-
-        [Theory]
-        [MemberData(nameof(GettersTestData), "ptd", false)]
-        [MemberData(nameof(GettersTestData), "ptd", true)]
-        [MemberData(nameof(GettersTestData), "swp", false)]
-        [MemberData(nameof(GettersTestData), "swp", true)]
-        public async Task PropertyGettersTest(string eval_fn, string method_name, int line, int col, string cfo_fn, Func<string[], object> get_args_fn, string local_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            "dotnet://debugger-test.dll/debugger-cfo-test.cs", line, col,
-            method_name,
-            $"window.setTimeout(function() {{ {eval_fn} }}, 1);",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               await CheckProps(frame_locals, new
-               {
-                   ptd = TObject("DebuggerTests.ClassWithProperties"),
-                   swp = TObject("DebuggerTests.StructWithProperties")
-               }, "locals#0");
-
-               var obj = GetAndAssertObjectWithName(frame_locals, local_name);
-
-               var dt = new DateTime(4, 5, 6, 7, 8, 9);
-               var obj_props = await GetProperties(obj?["value"]?["objectId"]?.Value<string>());
-               await CheckProps(obj_props, new
-               {
-                   V = TNumber(0xDEADBEEF),
-                   Int = TGetter("Int"),
-                   String = TGetter("String"),
-                   DT = TGetter("DT"),
-                   IntArray = TGetter("IntArray"),
-                   DTArray = TGetter("DTArray"),
-                   StringField = TString(null),
-
-                   // Auto properties show w/o getters, because they have
-                   // a backing field
-                   DTAutoProperty = TValueType("System.DateTime", dt.ToString())
-               }, local_name);
-
-               // Automatic properties don't have invokable getters, because we can get their
-               // value from the backing field directly
-               {
-                   var dt_auto_props = await GetObjectOnLocals(obj_props, "DTAutoProperty");
-                   await CheckDateTime(obj_props, "DTAutoProperty", dt);
-               }
-
-               // Invoke getters, and check values
-
-               dt = new DateTime(3, 4, 5, 6, 7, 8);
-               var res = await InvokeGetter(obj, get_args_fn(new[] { "Int" }), cfo_fn);
-               await CheckValue(res.Value["result"], JObject.FromObject(new { type = "number", value = (0xDEADBEEF + (uint)dt.Month) }), $"{local_name}.Int");
-
-               res = await InvokeGetter(obj, get_args_fn(new[] { "String" }), cfo_fn);
-               await CheckValue(res.Value["result"], JObject.FromObject(new { type = "string", value = $"String property, V: 0xDEADBEEF" }), $"{local_name}.String");
-
-               res = await InvokeGetter(obj, get_args_fn(new[] { "DT" }), cfo_fn);
-               await CheckValue(res.Value["result"], TValueType("System.DateTime", dt.ToString()), $"{local_name}.DT");
-               await CheckDateTimeValue(res.Value["result"], dt);
-
-               // Check arrays through getters
-
-               res = await InvokeGetter(obj, get_args_fn(new[] { "IntArray" }), cfo_fn);
-               await CheckValue(res.Value["result"], TArray("int[]", 2), $"{local_name}.IntArray");
-               {
-                   var arr_elems = await GetProperties(res.Value["result"]?["objectId"]?.Value<string>());
-                   var exp_elems = new[]
-                   {
-                        TNumber(10),
-                        TNumber(20)
-                   };
-
-                   await CheckProps(arr_elems, exp_elems, $"{local_name}.IntArray");
-               }
-
-               res = await InvokeGetter(obj, get_args_fn(new[] { "DTArray" }), cfo_fn);
-               await CheckValue(res.Value["result"], TArray("System.DateTime[]", 2), $"{local_name}.DTArray");
-               {
-                   var dt0 = new DateTime(6, 7, 8, 9, 10, 11);
-                   var dt1 = new DateTime(1, 2, 3, 4, 5, 6);
-
-                   var arr_elems = await GetProperties(res.Value["result"]?["objectId"]?.Value<string>());
-                   var exp_elems = new[]
-                   {
-                        TValueType("System.DateTime", dt0.ToString()),
-                        TValueType("System.DateTime", dt1.ToString()),
-                   };
-
-                   await CheckProps(arr_elems, exp_elems, $"{local_name}.DTArray");
-
-                   res = await InvokeGetter(arr_elems[0], "Date");
-                   await CheckDateTimeValue(res.Value["result"], dt0.Date);
-               }
-           });
-
-        [Theory]
-        [InlineData("invoke_static_method_async ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTestAsync');", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 38, 12, true)]
-        [InlineData("invoke_static_method_async ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTestAsync');", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 38, 12, false)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTest');", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 30, 12, true)]
-        [InlineData("invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:PropertyGettersTest');", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 30, 12, false)]
-        [InlineData("invoke_getters_js_test ();", "/other.js", 30, 1, false)]
-        [InlineData("invoke_getters_js_test ();", "/other.js", 30, 1, true)]
-        public async Task CheckAccessorsOnObjectsWithCFO(string eval_fn, string bp_loc, int line, int col, bool roundtrip)
-        {
-            await RunCallFunctionOn(
-                eval_fn, "function() { return this; }", "ptd",
-                bp_loc, line, col,
-                roundtrip: roundtrip,
-                test_fn: async (result) =>
-               {
-
-                   var is_js = bp_loc.EndsWith(".js");
-
-                   // Check with `accessorPropertiesOnly=true`
-
-                   var id = result.Value?["result"]?["objectId"]?.Value<string>();
-                   var get_prop_req = JObject.FromObject(new
-                   {
-                       objectId = id,
-                       accessorPropertiesOnly = true
-                   });
-
-                   var res = await GetPropertiesAndCheckAccessors(get_prop_req, is_js ? 6 : 5); // js returns extra `__proto__` member also
-                   Assert.False(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField shouldn't be returned for `accessorPropertiesOnly`");
-
-                   // Check with `accessorPropertiesOnly` unset, == false
-                   get_prop_req = JObject.FromObject(new
-                   {
-                       objectId = id,
-                   });
-
-                   res = await GetPropertiesAndCheckAccessors(get_prop_req, is_js ? 8 : 7); // js returns a `__proto__` member also
-                   Assert.True(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField should be returned for `accessorPropertiesOnly=false`");
-               });
-
-            async Task<Result> GetPropertiesAndCheckAccessors(JObject get_prop_req, int num_fields)
-            {
-                var res = await ctx.cli.SendCommand("Runtime.getProperties", get_prop_req, ctx.token);
-                if (!res.IsOk)
-                    Assert.True(false, $"Runtime.getProperties failed for {get_prop_req.ToString()}, with Result: {res}");
-
-                var accessors = new string[] { "Int", "String", "DT", "IntArray", "DTArray" };
-                foreach (var name in accessors)
-                {
-                    var prop = GetAndAssertObjectWithName(res.Value["result"], name);
-                    Assert.True(prop["value"] == null, $"{name} shouldn't have a `value`");
-
-                    await CheckValue(prop, TGetter(name), $"{name}");
-                }
-
-                return res;
-            }
-        }
-
-        public static TheoryData<string, string, int, int, bool> NegativeTestsData(bool use_cfo = false) => new TheoryData<string, string, int, int, bool>
-        { { "invoke_static_method ('[debugger-test] DebuggerTests.CallFunctionOnTest:MethodForNegativeTests', null);", "dotnet://debugger-test.dll/debugger-cfo-test.cs", 45, 12, use_cfo },
-            { "negative_cfo_test ();", "/other.js", 62, 1, use_cfo }
-        };
-
-        [Theory]
-        [MemberData(nameof(NegativeTestsData), false)]
-        public async Task RunOnInvalidCfoId(string eval_fn, string bp_loc, int line, int col, bool use_cfo) => await RunCallFunctionOn(
-            eval_fn, "function() { return this; }", "ptd",
-            bp_loc, line, col,
-            test_fn: async (cfo_result) =>
-           {
-               var ptd_id = cfo_result.Value?["result"]?["objectId"]?.Value<string>();
-
-               var cfo_args = JObject.FromObject(new
-               {
-                   functionDeclaration = "function () { return 0; }",
-                   objectId = ptd_id + "_invalid"
-               });
-
-               var res = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-               Assert.True(res.IsErr);
-           });
-
-        [Theory]
-        [MemberData(nameof(NegativeTestsData), false)]
-        public async Task RunOnInvalidThirdSegmentOfObjectId(string eval_fn, string bp_loc, int line, int col, bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                await SetBreakpoint(bp_loc, line, col);
-
-                // callFunctionOn
-                var eval_expr = $"window.setTimeout(function() {{ {eval_fn} }}, 1);";
-                var result = await ctx.cli.SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = eval_expr }), ctx.token);
-                var pause_location = await ctx.insp.WaitFor(Inspector.PAUSE);
-
-                var frame_locals = await GetProperties(pause_location["callFrames"][0]["scopeChain"][0]["object"]["objectId"].Value<string>());
-                var ptd = GetAndAssertObjectWithName(frame_locals, "ptd");
-                var ptd_id = ptd["value"]["objectId"].Value<string>();
-
-                var cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = "function () { return 0; }",
-                    objectId = ptd_id + "_invalid"
-                });
-
-                var res = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-                Assert.True(res.IsErr);
-            });
-        }
-
-        [Theory]
-        [MemberData(nameof(NegativeTestsData), false)]
-        [MemberData(nameof(NegativeTestsData), true)]
-        public async Task InvalidPropertyGetters(string eval_fn, string bp_loc, int line, int col, bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                await SetBreakpoint(bp_loc, line, col);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-
-                // callFunctionOn
-                var eval_expr = $"window.setTimeout(function() {{ {eval_fn} }}, 1);";
-                await SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = eval_expr }));
-                var pause_location = await ctx.insp.WaitFor(Inspector.PAUSE);
-
-                var frame_locals = await GetProperties(pause_location["callFrames"][0]["scopeChain"][0]["object"]["objectId"].Value<string>());
-                var ptd = GetAndAssertObjectWithName(frame_locals, "ptd");
-                var ptd_id = ptd["value"]["objectId"].Value<string>();
-
-                var invalid_args = new object[] { "NonExistant", String.Empty, null, 12310 };
-                foreach (var invalid_arg in invalid_args)
-                {
-                    var getter_res = await InvokeGetter(JObject.FromObject(new { value = new { objectId = ptd_id } }), invalid_arg);
-                    AssertEqual("undefined", getter_res.Value["result"]?["type"]?.ToString(), $"Expected to get undefined result for non-existant accessor - {invalid_arg}");
-                }
-            });
-        }
-
-        [Theory]
-        [MemberData(nameof(NegativeTestsData), false)]
-        public async Task ReturnNullFromCFO(string eval_fn, string bp_loc, int line, int col, bool use_cfo) => await RunCallFunctionOn(
-            eval_fn, "function() { return this; }", "ptd",
-            bp_loc, line, col,
-            test_fn: async (result) =>
-           {
-               var is_js = bp_loc.EndsWith(".js");
-               var ptd = JObject.FromObject(new { value = new { objectId = result.Value?["result"]?["objectId"]?.Value<string>() } });
-
-               var null_value_json = JObject.Parse("{ 'type': 'object', 'subtype': 'null', 'value': null }");
-               foreach (var returnByValue in new bool?[] { null, false, true })
-               {
-                   var res = await InvokeGetter(ptd, "StringField", returnByValue: returnByValue);
-                   if (is_js)
-                   {
-                       // In js case, it doesn't know the className, so the result looks slightly different
-                       Assert.True(
-                          JObject.DeepEquals(res.Value["result"], null_value_json),
-                          $"[StringField#returnByValue = {returnByValue}] Json didn't match. Actual: {res.Value["result"]} vs {null_value_json}");
-                   }
-                   else
-                   {
-                       await CheckValue(res.Value["result"], TString(null), "StringField");
-                   }
-               }
-           });
-
-        /*
-         * 1. runs `Runtime.callFunctionOn` on the objectId,
-         * if @roundtrip == false, then
-         *     -> calls @test_fn for that result (new objectId)
-         * else
-         *     -> runs it again on the *result's* objectId.
-         *        -> calls @test_fn on the *new* result objectId
-         *
-         * Returns: result of `Runtime.callFunctionOn`
-         */
-        async Task RunCallFunctionOn(string eval_fn, string fn_decl, string local_name, string bp_loc, int line, int col, int res_array_len = -1,
-            Func<Result, Task> test_fn = null, bool returnByValue = false, JArray fn_args = null, bool roundtrip = false)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                await SetBreakpoint(bp_loc, line, col);
-
-                // callFunctionOn
-                var eval_expr = $"window.setTimeout(function() {{ {eval_fn} }}, 1);";
-                var result = await ctx.cli.SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = eval_expr }), ctx.token);
-                var pause_location = await ctx.insp.WaitFor(Inspector.PAUSE);
-
-                // Um for js we get "scriptId": "6"
-                // CheckLocation (bp_loc, line, col, ctx.scripts, pause_location ["callFrames"][0]["location"]);
-
-                // Check the object at the bp
-                var frame_locals = await GetProperties(pause_location["callFrames"][0]["scopeChain"][0]["object"]["objectId"].Value<string>());
-                var obj = GetAndAssertObjectWithName(frame_locals, local_name);
-                var obj_id = obj["value"]["objectId"].Value<string>();
-
-                var cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = fn_decl,
-                    objectId = obj_id
-                });
-
-                if (fn_args != null)
-                    cfo_args["arguments"] = fn_args;
-
-                if (returnByValue)
-                    cfo_args["returnByValue"] = returnByValue;
-
-                // callFunctionOn
-                result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-                await CheckCFOResult(result);
-
-                // If it wasn't `returnByValue`, then try to run a new function
-                // on that *returned* object
-                // This second function, just returns the object as-is, so the same
-                // test_fn is re-usable.
-                if (!returnByValue && roundtrip)
-                {
-                    cfo_args = JObject.FromObject(new
-                    {
-                        functionDeclaration = "function () { return this; }",
-                        objectId = result.Value["result"]["objectId"]?.Value<string>()
-                    });
-
-                    if (fn_args != null)
-                        cfo_args["arguments"] = fn_args;
-
-                    result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-
-                    await CheckCFOResult(result);
-                }
-
-                if (test_fn != null)
-                    await test_fn(result);
-
-                return;
-
-                async Task CheckCFOResult(Result result)
-                {
-                    if (returnByValue)
-                        return;
-
-                    if (res_array_len < 0)
-                        await CheckValue(result.Value["result"], TObject("Object"), $"cfo-res");
-                    else
-                        await CheckValue(result.Value["result"], TArray("Array", res_array_len), $"cfo-res");
-                }
-            });
-        }
-    }
-
-}

+ 0 - 67
sdks/wasm/DebuggerTestSuite/DateTimeTests.cs

@@ -1,67 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Globalization;
-using System.Threading.Tasks;
-using Xunit;
-
-namespace DebuggerTests
-{
-    public class DateTimeList : DebuggerTestBase
-    {
-
-        [Theory]
-        [InlineData("en-US")]
-
-        // Currently not passing tests. Issue #19743
-        // [InlineData ("ja-JP")]
-        // [InlineData ("es-ES")]
-        //[InlineData ("de-DE")]
-        //[InlineData ("ka-GE")]
-        //[InlineData ("hu-HU")]
-        public async Task CheckDateTimeLocale(string locale)
-        {
-            var insp = new Inspector();
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-datetime-test.cs";
-
-                await SetBreakpointInMethod("debugger-test", "DebuggerTests.DateTimeTest", "LocaleTest", 15);
-
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.DateTimeTest:LocaleTest'," +
-                    $"'{locale}'); }}, 1);",
-                    debugger_test_loc, 25, 12, "LocaleTest",
-                    locals_fn: async (locals) =>
-                   {
-                       DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo(locale).DateTimeFormat;
-                       CultureInfo.CurrentCulture = new CultureInfo(locale, false);
-                       DateTime dt = new DateTime(2020, 1, 2, 3, 4, 5);
-                       string dt_str = dt.ToString();
-
-                       var fdtp = dtfi.FullDateTimePattern;
-                       var ldp = dtfi.LongDatePattern;
-                       var ltp = dtfi.LongTimePattern;
-                       var sdp = dtfi.ShortDatePattern;
-                       var stp = dtfi.ShortTimePattern;
-
-                       CheckString(locals, "fdtp", fdtp);
-                       CheckString(locals, "ldp", ldp);
-                       CheckString(locals, "ltp", ltp);
-                       CheckString(locals, "sdp", sdp);
-                       CheckString(locals, "stp", stp);
-                       await CheckDateTime(locals, "dt", dt);
-                       CheckString(locals, "dt_str", dt_str);
-                   }
-                );
-
-            });
-        }
-
-    }
-}

+ 0 - 19
sdks/wasm/DebuggerTestSuite/DebuggerTestSuite.csproj

@@ -1,19 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.0</TargetFramework>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="xunit" Version="2.4.0" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
-
-    <Content Include="appsettings.json" CopyToOutputDirectory="PreserveNewest" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\BrowserDebugHost\BrowserDebugHost.csproj" />
-    <ProjectReference Include="..\BrowserDebugProxy\BrowserDebugProxy.csproj" />
-  </ItemGroup>
-
-</Project>

+ 0 - 306
sdks/wasm/DebuggerTestSuite/DelegateTests.cs

@@ -1,306 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace DebuggerTests
-{
-
-    public class DelegateTests : DebuggerTestBase
-    {
-
-        [Theory]
-        [InlineData(0, 53, 8, "DelegatesTest", false)]
-        [InlineData(0, 53, 8, "DelegatesTest", true)]
-        [InlineData(2, 99, 8, "InnerMethod2", false)]
-        [InlineData(2, 99, 8, "InnerMethod2", true)]
-        public async Task InspectLocalsWithDelegatesAtBreakpointSite(int frame, int line, int col, string method_name, bool use_cfo) =>
-            await CheckInspectLocalsAtBreakpointSite(
-                "dotnet://debugger-test.dll/debugger-test.cs", line, col, method_name,
-                "window.setTimeout(function() { invoke_delegates_test (); }, 1);",
-                use_cfo: use_cfo,
-                wait_for_event_fn: async (pause_location) =>
-               {
-                   var locals = await GetProperties(pause_location["callFrames"][frame]["callFrameId"].Value<string>());
-
-                   await CheckProps(locals, new
-                   {
-                       fn_func = TDelegate("System.Func<Math, bool>", "bool <DelegatesTest>|(Math)"),
-                       fn_func_null = TObject("System.Func<Math, bool>", is_null: true),
-                       fn_func_arr = TArray("System.Func<Math, bool>[]", 1),
-                       fn_del = TDelegate("Math.IsMathNull", "bool IsMathNullDelegateTarget (Math)"),
-                       fn_del_null = TObject("Math.IsMathNull", is_null: true),
-                       fn_del_arr = TArray("Math.IsMathNull[]", 1),
-
-                       // Unused locals
-                       fn_func_unused = TDelegate("System.Func<Math, bool>", "bool <DelegatesTest>|(Math)"),
-                       fn_func_null_unused = TObject("System.Func<Math, bool>", is_null: true),
-                       fn_func_arr_unused = TArray("System.Func<Math, bool>[]", 1),
-
-                       fn_del_unused = TDelegate("Math.IsMathNull", "bool IsMathNullDelegateTarget (Math)"),
-                       fn_del_null_unused = TObject("Math.IsMathNull", is_null: true),
-                       fn_del_arr_unused = TArray("Math.IsMathNull[]", 1),
-
-                       res = TBool(false),
-                       m_obj = TObject("Math")
-                   }, "locals");
-
-                   await CompareObjectPropertiesFor(locals, "fn_func_arr", new[]
-                   {
-                        TDelegate(
-                            "System.Func<Math, bool>",
-                            "bool <DelegatesTest>|(Math)")
-                   }, "locals#fn_func_arr");
-
-                   await CompareObjectPropertiesFor(locals, "fn_del_arr", new[]
-                   {
-                        TDelegate(
-                            "Math.IsMathNull",
-                            "bool IsMathNullDelegateTarget (Math)")
-                   }, "locals#fn_del_arr");
-
-                   await CompareObjectPropertiesFor(locals, "fn_func_arr_unused", new[]
-                   {
-                        TDelegate(
-                            "System.Func<Math, bool>",
-                            "bool <DelegatesTest>|(Math)")
-                   }, "locals#fn_func_arr_unused");
-
-                   await CompareObjectPropertiesFor(locals, "fn_del_arr_unused", new[]
-                   {
-                        TDelegate(
-                            "Math.IsMathNull",
-                            "bool IsMathNullDelegateTarget (Math)")
-                   }, "locals#fn_del_arr_unused");
-               }
-            );
-
-        [Theory]
-        [InlineData(0, 202, 8, "DelegatesSignatureTest", false)]
-        [InlineData(0, 202, 8, "DelegatesSignatureTest", true)]
-        [InlineData(2, 99, 8, "InnerMethod2", false)]
-        [InlineData(2, 99, 8, "InnerMethod2", true)]
-        public async Task InspectDelegateSignaturesWithFunc(int frame, int line, int col, string bp_method, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            "dotnet://debugger-test.dll/debugger-test.cs",
-            line, col,
-            bp_method,
-            "window.setTimeout (function () { invoke_static_method ('[debugger-test] Math:DelegatesSignatureTest'); }, 1)",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][frame]["callFrameId"].Value<string>());
-
-               await CheckProps(locals, new
-               {
-                   fn_func = TDelegate("System.Func<Math, Math.GenericStruct<Math.GenericStruct<int[]>>, Math.GenericStruct<bool[]>>",
-                           "Math.GenericStruct<bool[]> <DelegatesSignatureTest>|(Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-
-                   fn_func_del = TDelegate("System.Func<Math, Math.GenericStruct<Math.GenericStruct<int[]>>, Math.GenericStruct<bool[]>>",
-                           "Math.GenericStruct<bool[]> DelegateTargetForSignatureTest (Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-
-                   fn_func_null = TObject("System.Func<Math, Math.GenericStruct<Math.GenericStruct<int[]>>, Math.GenericStruct<bool[]>>", is_null: true),
-                   fn_func_only_ret = TDelegate("System.Func<bool>", "bool <DelegatesSignatureTest>|()"),
-                   fn_func_arr = TArray("System.Func<Math, Math.GenericStruct<Math.GenericStruct<int[]>>, Math.GenericStruct<bool[]>>[]", 1),
-
-                   fn_del = TDelegate("Math.DelegateForSignatureTest",
-                           "Math.GenericStruct<bool[]> DelegateTargetForSignatureTest (Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-
-                   fn_del_l = TDelegate("Math.DelegateForSignatureTest",
-                           "Math.GenericStruct<bool[]> <DelegatesSignatureTest>|(Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-
-                   fn_del_null = TObject("Math.DelegateForSignatureTest", is_null: true),
-                   fn_del_arr = TArray("Math.DelegateForSignatureTest[]", 2),
-                   m_obj = TObject("Math"),
-                   gs_gs = TValueType("Math.GenericStruct<Math.GenericStruct<int[]>>"),
-                   fn_void_del = TDelegate("Math.DelegateWithVoidReturn",
-                           "void DelegateTargetWithVoidReturn (Math.GenericStruct<int[]>)"),
-
-                   fn_void_del_arr = TArray("Math.DelegateWithVoidReturn[]", 1),
-                   fn_void_del_null = TObject("Math.DelegateWithVoidReturn", is_null: true),
-                   gs = TValueType("Math.GenericStruct<int[]>"),
-                   rets = TArray("Math.GenericStruct<bool[]>[]", 6)
-               }, "locals");
-
-               await CompareObjectPropertiesFor(locals, "fn_func_arr", new[]
-               {
-                    TDelegate(
-                        "System.Func<Math, Math.GenericStruct<Math.GenericStruct<int[]>>, Math.GenericStruct<bool[]>>",
-                        "Math.GenericStruct<bool[]> <DelegatesSignatureTest>|(Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-               }, "locals#fn_func_arr");
-
-               await CompareObjectPropertiesFor(locals, "fn_del_arr", new[]
-               {
-                    TDelegate(
-                            "Math.DelegateForSignatureTest",
-                            "Math.GenericStruct<bool[]> DelegateTargetForSignatureTest (Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-                        TDelegate(
-                            "Math.DelegateForSignatureTest",
-                            "Math.GenericStruct<bool[]> <DelegatesSignatureTest>|(Math,Math.GenericStruct<Math.GenericStruct<int[]>>)")
-               }, "locals#fn_del_arr");
-
-               await CompareObjectPropertiesFor(locals, "fn_void_del_arr", new[]
-               {
-                    TDelegate(
-                        "Math.DelegateWithVoidReturn",
-                        "void DelegateTargetWithVoidReturn (Math.GenericStruct<int[]>)")
-               }, "locals#fn_void_del_arr");
-           });
-
-        [Theory]
-        [InlineData(0, 224, 8, "ActionTSignatureTest", false)]
-        [InlineData(0, 224, 8, "ActionTSignatureTest", true)]
-        [InlineData(2, 99, 8, "InnerMethod2", false)]
-        [InlineData(2, 99, 8, "InnerMethod2", true)]
-        public async Task ActionTSignatureTest(int frame, int line, int col, string bp_method, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            "dotnet://debugger-test.dll/debugger-test.cs", line, col,
-            bp_method,
-            "window.setTimeout (function () { invoke_static_method ('[debugger-test] Math:ActionTSignatureTest'); }, 1)",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][frame]["callFrameId"].Value<string>());
-
-               await CheckProps(locals, new
-               {
-                   fn_action = TDelegate("System.Action<Math.GenericStruct<int[]>>",
-                           "void <ActionTSignatureTest>|(Math.GenericStruct<int[]>)"),
-                   fn_action_del = TDelegate("System.Action<Math.GenericStruct<int[]>>",
-                           "void DelegateTargetWithVoidReturn (Math.GenericStruct<int[]>)"),
-                   fn_action_bare = TDelegate("System.Action",
-                           "void|()"),
-
-                   fn_action_null = TObject("System.Action<Math.GenericStruct<int[]>>", is_null: true),
-
-                   fn_action_arr = TArray("System.Action<Math.GenericStruct<int[]>>[]", 3),
-
-                   gs = TValueType("Math.GenericStruct<int[]>"),
-               }, "locals");
-
-               await CompareObjectPropertiesFor(locals, "fn_action_arr", new[]
-               {
-                    TDelegate(
-                            "System.Action<Math.GenericStruct<int[]>>",
-                            "void <ActionTSignatureTest>|(Math.GenericStruct<int[]>)"),
-                        TDelegate(
-                            "System.Action<Math.GenericStruct<int[]>>",
-                            "void DelegateTargetWithVoidReturn (Math.GenericStruct<int[]>)"),
-                        TObject("System.Action<Math.GenericStruct<int[]>>", is_null : true)
-               }, "locals#fn_action_arr");
-           });
-
-        [Theory]
-        [InlineData(0, 242, 8, "NestedDelegatesTest", false)]
-        [InlineData(0, 242, 8, "NestedDelegatesTest", true)]
-        [InlineData(2, 99, 8, "InnerMethod2", false)]
-        [InlineData(2, 99, 8, "InnerMethod2", true)]
-        public async Task NestedDelegatesTest(int frame, int line, int col, string bp_method, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            "dotnet://debugger-test.dll/debugger-test.cs", line, col,
-            bp_method,
-            "window.setTimeout (function () { invoke_static_method ('[debugger-test] Math:NestedDelegatesTest'); }, 1)",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][frame]["callFrameId"].Value<string>());
-
-               await CheckProps(locals, new
-               {
-                   fn_func = TDelegate("System.Func<System.Func<int, bool>, bool>",
-                           "bool <NestedDelegatesTest>|(Func<int, bool>)"),
-                   fn_func_null = TObject("System.Func<System.Func<int, bool>, bool>", is_null: true),
-                   fn_func_arr = TArray("System.Func<System.Func<int, bool>, bool>[]", 1),
-                   fn_del_arr = TArray("System.Func<System.Func<int, bool>, bool>[]", 1),
-
-                   m_obj = TObject("Math"),
-                   fn_del_null = TObject("System.Func<System.Func<int, bool>, bool>", is_null: true),
-                   fs = TDelegate("System.Func<int, bool>",
-                           "bool <NestedDelegatesTest>|(int)")
-               }, "locals");
-
-               await CompareObjectPropertiesFor(locals, "fn_func_arr", new[]
-               {
-                    TDelegate(
-                        "System.Func<System.Func<int, bool>, bool>",
-                        "bool <NestedDelegatesTest>|(System.Func<int, bool>)")
-               }, "locals#fn_func_arr");
-
-               await CompareObjectPropertiesFor(locals, "fn_del_arr", new[]
-               {
-                    TDelegate(
-                        "System.Func<System.Func<int, bool>, bool>",
-                        "bool DelegateTargetForNestedFunc (Func<int, bool>)")
-               }, "locals#fn_del_arr");
-           });
-
-        [Theory]
-        [InlineData(0, 262, 8, "MethodWithDelegateArgs", false)]
-        [InlineData(0, 262, 8, "MethodWithDelegateArgs", true)]
-        [InlineData(2, 99, 8, "InnerMethod2", false)]
-        [InlineData(2, 99, 8, "InnerMethod2", true)]
-        public async Task DelegatesAsMethodArgsTest(int frame, int line, int col, string bp_method, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            "dotnet://debugger-test.dll/debugger-test.cs", line, col,
-            bp_method,
-            "window.setTimeout (function () { invoke_static_method ('[debugger-test] Math:DelegatesAsMethodArgsTest'); }, 1)",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][frame]["callFrameId"].Value<string>());
-
-               await CheckProps(locals, new
-               {
-                   @this = TObject("Math"),
-                   dst_arr = TArray("Math.DelegateForSignatureTest[]", 2),
-                   fn_func = TDelegate("System.Func<char[], bool>",
-                           "bool <DelegatesAsMethodArgsTest>|(char[])"),
-                   fn_action = TDelegate("System.Action<Math.GenericStruct<int>[]>",
-                           "void <DelegatesAsMethodArgsTest>|(Math.GenericStruct<int>[])")
-               }, "locals");
-
-               await CompareObjectPropertiesFor(locals, "dst_arr", new[]
-               {
-                    TDelegate("Math.DelegateForSignatureTest",
-                            "Math.GenericStruct<bool[]> DelegateTargetForSignatureTest (Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-                        TDelegate("Math.DelegateForSignatureTest",
-                            "Math.GenericStruct<bool[]> <DelegatesAsMethodArgsTest>|(Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-               }, "locals#dst_arr");
-           });
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task MethodWithDelegatesAsyncTest(bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            "dotnet://debugger-test.dll/debugger-test.cs", 281, 8,
-            "MoveNext", //"DelegatesAsMethodArgsTestAsync"
-            "window.setTimeout (function () { invoke_static_method_async ('[debugger-test] Math:MethodWithDelegatesAsyncTest'); }, 1)",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               await CheckProps(locals, new
-               {
-                   @this = TObject("Math"),
-                   _dst_arr = TArray("Math.DelegateForSignatureTest[]", 2),
-                   _fn_func = TDelegate("System.Func<char[], bool>",
-                           "bool <MethodWithDelegatesAsync>|(char[])"),
-                   _fn_action = TDelegate("System.Action<Math.GenericStruct<int>[]>",
-                           "void <MethodWithDelegatesAsync>|(Math.GenericStruct<int>[])")
-               }, "locals");
-
-               await CompareObjectPropertiesFor(locals, "_dst_arr", new[]
-               {
-                    TDelegate(
-                            "Math.DelegateForSignatureTest",
-                            "Math.GenericStruct<bool[]> DelegateTargetForSignatureTest (Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-                        TDelegate(
-                            "Math.DelegateForSignatureTest",
-                            "Math.GenericStruct<bool[]> <MethodWithDelegatesAsync>|(Math,Math.GenericStruct<Math.GenericStruct<int[]>>)"),
-               }, "locals#dst_arr");
-           });
-    }
-
-}

+ 0 - 167
sdks/wasm/DebuggerTestSuite/DevToolsClient.cs

@@ -1,167 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net.WebSockets;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    internal class DevToolsClient : IDisposable
-    {
-        ClientWebSocket socket;
-        List<Task> pending_ops = new List<Task>();
-        TaskCompletionSource<bool> side_exit = new TaskCompletionSource<bool>();
-        List<byte[]> pending_writes = new List<byte[]>();
-        Task current_write;
-        readonly ILogger logger;
-
-        public DevToolsClient(ILogger logger)
-        {
-            this.logger = logger;
-        }
-
-        ~DevToolsClient()
-        {
-            Dispose(false);
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-        }
-
-        public async Task Close(CancellationToken cancellationToken)
-        {
-            if (socket.State == WebSocketState.Open)
-                await socket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Closing", cancellationToken);
-        }
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (disposing)
-                socket.Dispose();
-        }
-
-        Task Pump(Task task, CancellationToken token)
-        {
-            if (task != current_write)
-                return null;
-            current_write = null;
-
-            pending_writes.RemoveAt(0);
-
-            if (pending_writes.Count > 0)
-            {
-                current_write = socket.SendAsync(new ArraySegment<byte>(pending_writes[0]), WebSocketMessageType.Text, true, token);
-                return current_write;
-            }
-            return null;
-        }
-
-        async Task<string> ReadOne(CancellationToken token)
-        {
-            byte[] buff = new byte[4000];
-            var mem = new MemoryStream();
-            while (true)
-            {
-                var result = await this.socket.ReceiveAsync(new ArraySegment<byte>(buff), token);
-                if (result.MessageType == WebSocketMessageType.Close)
-                {
-                    return null;
-                }
-
-                if (result.EndOfMessage)
-                {
-                    mem.Write(buff, 0, result.Count);
-                    return Encoding.UTF8.GetString(mem.GetBuffer(), 0, (int)mem.Length);
-                }
-                else
-                {
-                    mem.Write(buff, 0, result.Count);
-                }
-            }
-        }
-
-        protected void Send(byte[] bytes, CancellationToken token)
-        {
-            pending_writes.Add(bytes);
-            if (pending_writes.Count == 1)
-            {
-                if (current_write != null)
-                    throw new Exception("Internal state is bad. current_write must be null if there are no pending writes");
-
-                current_write = socket.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Text, true, token);
-                pending_ops.Add(current_write);
-            }
-        }
-
-        async Task MarkCompleteAfterward(Func<CancellationToken, Task> send, CancellationToken token)
-        {
-            try
-            {
-                await send(token);
-                side_exit.SetResult(true);
-            }
-            catch (Exception e)
-            {
-                side_exit.SetException(e);
-            }
-        }
-
-        protected async Task<bool> ConnectWithMainLoops(
-            Uri uri,
-            Func<string, CancellationToken, Task> receive,
-            Func<CancellationToken, Task> send,
-            CancellationToken token)
-        {
-
-            logger.LogDebug("connecting to {0}", uri);
-            this.socket = new ClientWebSocket();
-            this.socket.Options.KeepAliveInterval = Timeout.InfiniteTimeSpan;
-
-            await this.socket.ConnectAsync(uri, token);
-            pending_ops.Add(ReadOne(token));
-            pending_ops.Add(side_exit.Task);
-            pending_ops.Add(MarkCompleteAfterward(send, token));
-
-            while (!token.IsCancellationRequested)
-            {
-                var task = await Task.WhenAny(pending_ops);
-                if (task == pending_ops[0])
-                { //pending_ops[0] is for message reading
-                    var msg = ((Task<string>)task).Result;
-                    pending_ops[0] = ReadOne(token);
-                    Task tsk = receive(msg, token);
-                    if (tsk != null)
-                        pending_ops.Add(tsk);
-                }
-                else if (task == pending_ops[1])
-                {
-                    var res = ((Task<bool>)task).Result;
-                    //it might not throw if exiting successfull
-                    return res;
-                }
-                else
-                { //must be a background task
-                    pending_ops.Remove(task);
-                    var tsk = Pump(task, token);
-                    if (tsk != null)
-                        pending_ops.Add(tsk);
-                }
-            }
-
-            return false;
-        }
-
-        protected virtual void Log(string priority, string msg)
-        {
-            //
-        }
-    }
-}

+ 0 - 466
sdks/wasm/DebuggerTestSuite/EvaluateOnCallFrameTests.cs

@@ -1,466 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace DebuggerTests
-{
-    // TODO: static async, static method args
-    public class EvaluateOnCallFrameTests : DebuggerTestBase
-    {
-        public static IEnumerable<object[]> InstanceMethodsTestData(string type_name)
-        {
-            yield return new object[] { type_name, "InstanceMethod", "InstanceMethod", false };
-            yield return new object[] { type_name, "GenericInstanceMethod", "GenericInstanceMethod<int>", false };
-            yield return new object[] { type_name, "InstanceMethodAsync", "MoveNext", true };
-            yield return new object[] { type_name, "GenericInstanceMethodAsync", "MoveNext", true };
-
-            // TODO: { "DebuggerTests.EvaluateTestsGeneric`1", "Instance", 9, "EvaluateTestsGenericStructInstanceMethod", prefix }
-        }
-
-        public static IEnumerable<object[]> InstanceMethodForTypeMembersTestData(string type_name)
-        {
-            foreach (var data in InstanceMethodsTestData(type_name))
-            {
-                yield return new object[] { "", 0 }.Concat(data).ToArray();
-                yield return new object[] { "this.", 0 }.Concat(data).ToArray();
-                yield return new object[] { "NewInstance.", 3 }.Concat(data).ToArray();
-                yield return new object[] { "this.NewInstance.", 3 }.Concat(data).ToArray();
-            }
-        }
-
-        [Theory]
-        [MemberData(nameof(InstanceMethodForTypeMembersTestData), parameters: "DebuggerTests.EvaluateTestsStructWithProperties")]
-        [MemberData(nameof(InstanceMethodForTypeMembersTestData), parameters: "DebuggerTests.EvaluateTestsClassWithProperties")]
-        public async Task EvaluateTypeInstanceMembers(string prefix, int bias, string type, string method, string bp_function_name, bool is_async)
-        => await CheckInspectLocalsAtBreakpointSite(
-            type, method, /*line_offset*/1, bp_function_name,
-            $"window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] {type}:run');}}, 1);",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-               var dateTime = new DateTime(2010, 9, 8, 7, 6, 5 + bias);
-               var DTProp = dateTime.AddMinutes(10);
-
-                foreach (var pad in new[] { String.Empty, "  " })
-                {
-                    var padded_prefix = pad + prefix;
-                    await EvaluateOnCallFrameAndCheck(id,
-                        ($"{padded_prefix}a", TNumber(4)),
-
-                        // fields
-                        ($"{padded_prefix}dateTime.TimeOfDay", TValueType("System.TimeSpan", dateTime.TimeOfDay.ToString())),
-                        ($"{padded_prefix}dateTime", TDateTime(dateTime)),
-                        ($"{padded_prefix}dateTime.TimeOfDay.Minutes", TNumber(dateTime.TimeOfDay.Minutes)),
-
-                        // properties
-                        ($"{padded_prefix}DTProp.TimeOfDay.Minutes", TNumber(DTProp.TimeOfDay.Minutes)),
-                        ($"{padded_prefix}DTProp", TDateTime(DTProp)),
-                        ($"{padded_prefix}DTProp.TimeOfDay", TValueType("System.TimeSpan", DTProp.TimeOfDay.ToString())),
-
-                        ($"{padded_prefix}IntProp", TNumber(9)),
-                        ($"{padded_prefix}NullIfAIsNotZero", TObject("DebuggerTests.EvaluateTestsClassWithProperties", is_null: true))
-                    );
-                }
-           });
-
-        [Theory]
-        [MemberData(nameof(InstanceMethodsTestData), parameters: "DebuggerTests.EvaluateTestsStructWithProperties")]
-        [MemberData(nameof(InstanceMethodsTestData), parameters: "DebuggerTests.EvaluateTestsClassWithProperties")]
-        public async Task EvaluateInstanceMethodArguments(string type, string method, string bp_function_name, bool is_async)
-        => await CheckInspectLocalsAtBreakpointSite(
-            type, method, /*line_offset*/1, bp_function_name,
-            $"window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] {type}:run');}}, 1);",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-               var DTProp = new DateTime(2010, 9, 8, 7, 6, 5).AddMinutes(10);
-               await EvaluateOnCallFrameAndCheck(id,
-                   ("g", TNumber(400)),
-                   ("h", TNumber(123)),
-                   ("valString", TString("just a test")),
-                   ("me", TObject(type)),
-
-                   // property on method arg
-                   ("me.DTProp", TDateTime(DTProp)),
-                   ("me.DTProp.TimeOfDay.Minutes", TNumber(DTProp.TimeOfDay.Minutes)),
-                   ("me.DTProp.Second + (me.IntProp - 5)", TNumber(DTProp.Second + 4)));
-           });
-
-        [Theory]
-        [MemberData(nameof(InstanceMethodsTestData), parameters: "DebuggerTests.EvaluateTestsStructWithProperties")]
-        [MemberData(nameof(InstanceMethodsTestData), parameters: "DebuggerTests.EvaluateTestsClassWithProperties")]
-        public async Task EvaluateMethodLocals(string type, string method, string bp_function_name, bool is_async)
-        => await CheckInspectLocalsAtBreakpointSite(
-            type, method, /*line_offset*/5, bp_function_name,
-            $"window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] {type}:run');}}, 1);",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-               var dt = new DateTime(2025, 3, 5, 7, 9, 11);
-               await EvaluateOnCallFrameAndCheck(id,
-                   ("d", TNumber(401)),
-                   (" d", TNumber(401)),
-                   ("e", TNumber(402)),
-                   ("f", TNumber(403)),
-
-                   // property on a local
-                   ("local_dt", TDateTime(dt)),
-                   ("  local_dt", TDateTime(dt)),
-                   ("local_dt.Date", TDateTime(dt.Date)),
-                   ("  local_dt.Date", TDateTime(dt.Date)));
-           });
-
-        [Fact]
-        public async Task EvaluateStaticLocalsWithDeepMemberAccess() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.EvaluateTestsClass", "EvaluateLocals", 9, "EvaluateLocals",
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-               var dt = new DateTime(2020, 1, 2, 3, 4, 5);
-               await EvaluateOnCallFrameAndCheck(id,
-                   ("f_s.c", TNumber(4)),
-                   ("f_s", TValueType("DebuggerTests.EvaluateTestsStructWithProperties")),
-
-                   ("f_s.dateTime", TDateTime(dt)),
-                   ("f_s.dateTime.Date", TDateTime(dt.Date)));
-           });
-
-        [Fact]
-        public async Task EvaluateLocalsAsync() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.Point", "AsyncInstanceMethod", 1, "MoveNext",
-            "window.setTimeout(function() { invoke_static_method_async ('[debugger-test] DebuggerTests.ArrayTestsClass:EntryPointForStructMethod', true); })",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-                // sc_arg
-                {
-                   var (sc_arg, _) = await EvaluateOnCallFrame(id, "sc_arg");
-                   await CheckValue(sc_arg, TObject("DebuggerTests.SimpleClass"), nameof(sc_arg));
-
-                    // Check that we did get the correct object
-                    var sc_arg_props = await GetProperties(sc_arg["objectId"]?.Value<string>());
-                   await CheckProps(sc_arg_props, new
-                   {
-                       X = TNumber(10),
-                       Y = TNumber(45),
-                       Id = TString("sc#Id"),
-                       Color = TEnum("DebuggerTests.RGB", "Blue"),
-                       PointWithCustomGetter = TGetter("PointWithCustomGetter")
-                   }, "sc_arg_props#1");
-
-                   await EvaluateOnCallFrameAndCheck(id,
-                       ("(sc_arg.PointWithCustomGetter.X)", TNumber(100)),
-                       ("sc_arg.Id + \"_foo\"", TString($"sc#Id_foo")),
-                       ("sc_arg.Id + (sc_arg.X==10 ? \"_is_ten\" : \"_not_ten\")", TString($"sc#Id_is_ten")));
-               }
-
-                // local_gs
-                {
-                   var (local_gs, _) = await EvaluateOnCallFrame(id, "local_gs");
-                   await CheckValue(local_gs, TValueType("DebuggerTests.SimpleGenericStruct<int>"), nameof(local_gs));
-
-                   var local_gs_props = await GetProperties(local_gs["objectId"]?.Value<string>());
-                   await CheckProps(local_gs_props, new
-                   {
-                       Id = TObject("string", is_null: true),
-                       Color = TEnum("DebuggerTests.RGB", "Red"),
-                       Value = TNumber(0)
-                   }, "local_gs_props#1");
-                   await EvaluateOnCallFrameAndCheck(id, ("(local_gs.Id)", TString(null)));
-               }
-           });
-
-        [Theory]
-        [MemberData(nameof(InstanceMethodForTypeMembersTestData), parameters: "DebuggerTests.EvaluateTestsStructWithProperties")]
-        [MemberData(nameof(InstanceMethodForTypeMembersTestData), parameters: "DebuggerTests.EvaluateTestsClassWithProperties")]
-        public async Task EvaluateExpressionsWithDeepMemberAccesses(string prefix, int bias, string type, string method, string bp_function_name, bool _)
-        => await CheckInspectLocalsAtBreakpointSite(
-            type, method, /*line_offset*/4, bp_function_name,
-            $"window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] {type}:run');}}, 1);",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-               var dateTime = new DateTime(2010, 9, 8, 7, 6, 5 + bias);
-               var DTProp = dateTime.AddMinutes(10);
-
-               await EvaluateOnCallFrameAndCheck(id,
-                   ($"{prefix}a + 5", TNumber(9)),
-                   ($"10 + {prefix}IntProp", TNumber(19)),
-                   ($" {prefix}IntProp  +  {prefix}DTProp.Second", TNumber(9 + DTProp.Second)),
-                   ($" {prefix}IntProp + ({prefix}DTProp.Second+{prefix}dateTime.Year)", TNumber(9 + DTProp.Second + dateTime.Year)),
-                   ($" {prefix}DTProp.Second > 0 ? \"_foo_\": \"_zero_\"", TString("_foo_")),
-
-                   // local_dt is not live yet
-                   ($"local_dt.Date.Year * 10", TNumber(10)));
-           });
-
-        [Fact]
-        public async Task EvaluateSimpleExpressions() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run",
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-               await EvaluateOnCallFrameAndCheck(id,
-                   // "((this))", TObject("foo")); //FIXME:
-                   // "((dt))", TObject("foo")); //FIXME:
-
-                   ("this", TObject("DebuggerTests.EvaluateTestsClass.TestEvaluate")),
-                   ("  this", TObject("DebuggerTests.EvaluateTestsClass.TestEvaluate")),
-
-                   ("5", TNumber(5)),
-                   ("  5", TNumber(5)),
-                   ("d + e", TNumber(203)),
-                   ("e + 10", TNumber(112)),
-
-                   // repeated expressions
-                   ("this.a + this.a", TNumber(2)),
-                   ("a + \"_\" + a", TString("9000_9000")),
-                   ("a+(a  )", TString("90009000")),
-
-                   // possible duplicate arg name
-                   ("this.a + this_a", TNumber(46)),
-
-                   ("this.a + this.b", TNumber(3)),
-                   ("\"test\" + \"test\"", TString("testtest")),
-                   ("5 + 5", TNumber(10)));
-           });
-
-        public static TheoryData<string, string, string> ShadowMethodArgsTestData => new TheoryData<string, string, string>
-        {
-            { "DebuggerTests.EvaluateTestsClassWithProperties", "EvaluateShadow", "EvaluateShadow" },
-            { "DebuggerTests.EvaluateTestsClassWithProperties", "EvaluateShadowAsync", "MoveNext" },
-            { "DebuggerTests.EvaluateTestsStructWithProperties", "EvaluateShadow", "EvaluateShadow" },
-            { "DebuggerTests.EvaluateTestsStructWithProperties", "EvaluateShadowAsync", "MoveNext" },
-        };
-
-        [Theory]
-        [MemberData(nameof(ShadowMethodArgsTestData))]
-        public async Task LocalsAndArgsShadowingThisMembers(string type_name, string method, string bp_function_name) => await CheckInspectLocalsAtBreakpointSite(
-            type_name, method, 2, bp_function_name,
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] " + type_name + ":run'); })",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-               await EvaluateOnCallFrameAndCheck(id,
-                   ("a", TString("hello")),
-                   ("this.a", TNumber(4)));
-
-               await CheckExpressions("this.", new DateTime(2010, 9, 8, 7, 6, 5 + 0));
-               await CheckExpressions(String.Empty, new DateTime(2020, 3, 4, 5, 6, 7));
-
-               async Task CheckExpressions(string prefix, DateTime dateTime)
-               {
-                   await EvaluateOnCallFrameAndCheck(id,
-                       (prefix + "dateTime", TDateTime(dateTime)),
-                       (prefix + "dateTime.TimeOfDay.Minutes", TNumber(dateTime.TimeOfDay.Minutes)),
-                       (prefix + "dateTime.TimeOfDay", TValueType("System.TimeSpan", dateTime.TimeOfDay.ToString())));
-               }
-           });
-
-        [Theory]
-        [InlineData("DebuggerTests.EvaluateTestsStructWithProperties", true)]
-        [InlineData("DebuggerTests.EvaluateTestsClassWithProperties", false)]
-        public async Task EvaluateOnPreviousFrames(string type_name, bool is_valuetype) => await CheckInspectLocalsAtBreakpointSite(
-            type_name, "EvaluateShadow", 1, "EvaluateShadow",
-            $"window.setTimeout(function() {{ invoke_static_method ('[debugger-test] {type_name}:run'); }})",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var dt_local = new DateTime(2020, 3, 4, 5, 6, 7);
-               var dt_this = new DateTime(2010, 9, 8, 7, 6, 5);
-
-                // At EvaluateShadow
-                {
-                   var id0 = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-                   await EvaluateOnCallFrameAndCheck(id0,
-                       ("dateTime", TDateTime(dt_local)),
-                       ("this.dateTime", TDateTime(dt_this))
-                   );
-
-                   await EvaluateOnCallFrameFail(id0, ("obj.IntProp", "ReferenceError"));
-               }
-
-               {
-                   var id1 = pause_location["callFrames"][1]["callFrameId"].Value<string>();
-                   await EvaluateOnCallFrameFail(id1,
-                       ("dateTime", "ReferenceError"),
-                       ("this.dateTime", "ReferenceError"));
-
-                    // obj available only on the -1 frame
-                    await EvaluateOnCallFrameAndCheck(id1, ("obj.IntProp", TNumber(7)));
-               }
-
-               await SetBreakpointInMethod("debugger-test.dll", type_name, "SomeMethod", 1);
-               pause_location = await SendCommandAndCheck(null, "Debugger.resume", null, 0, 0, "SomeMethod");
-
-                // At SomeMethod
-
-                // TODO: change types also.. so, that `this` is different!
-
-                // Check frame0
-                {
-                   var id0 = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-                    // 'me' and 'dateTime' are reversed in this method
-                    await EvaluateOnCallFrameAndCheck(id0,
-                       ("dateTime", is_valuetype ? TValueType(type_name) : TObject(type_name)),
-                       ("this.dateTime", TDateTime(dt_this)),
-                       ("me", TDateTime(dt_local)),
-
-                       // local variable shadows field, but isn't "live" yet
-                       ("DTProp", TString(null)),
-
-                       // access field via `this.`
-                       ("this.DTProp", TDateTime(dt_this.AddMinutes(10))));
-
-                   await EvaluateOnCallFrameFail(id0, ("obj", "ReferenceError"));
-               }
-
-                // check frame1
-                {
-                   var id1 = pause_location["callFrames"][1]["callFrameId"].Value<string>();
-
-                   await EvaluateOnCallFrameAndCheck(id1,
-                       // 'me' and 'dateTime' are reversed in this method
-                       ("dateTime", TDateTime(dt_local)),
-                       ("this.dateTime", TDateTime(dt_this)),
-                       ("me", is_valuetype ? TValueType(type_name) : TObject(type_name)),
-
-                       // not shadowed here
-                       ("DTProp", TDateTime(dt_this.AddMinutes(10))),
-
-                       // access field via `this.`
-                       ("this.DTProp", TDateTime(dt_this.AddMinutes(10))));
-
-                   await EvaluateOnCallFrameFail(id1, ("obj", "ReferenceError"));
-               }
-
-                // check frame2
-                {
-                   var id2 = pause_location["callFrames"][2]["callFrameId"].Value<string>();
-
-                    // Only obj should be available
-                    await EvaluateOnCallFrameFail(id2,
-                       ("dateTime", "ReferenceError"),
-                       ("this.dateTime", "ReferenceError"),
-                       ("me", "ReferenceError"));
-
-                   await EvaluateOnCallFrameAndCheck(id2, ("obj", is_valuetype ? TValueType(type_name) : TObject(type_name)));
-               }
-           });
-
-        [Fact]
-        public async Task JSEvaluate()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            var bp_loc = "/other.js";
-            var line = 76;
-            var col = 1;
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                await SetBreakpoint(bp_loc, line, col);
-
-                var eval_expr = "window.setTimeout(function() { eval_call_on_frame_test (); }, 1)";
-                var result = await ctx.cli.SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = eval_expr }), ctx.token);
-                var pause_location = await ctx.insp.WaitFor(Inspector.PAUSE);
-
-                var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-                await EvaluateOnCallFrameFail(id,
-                    ("me.foo", null),
-                    ("obj.foo.bar", null));
-
-                await EvaluateOnCallFrame(id, "obj.foo", expect_ok: true);
-            });
-        }
-
-        [Fact]
-        public async Task NegativeTestsInInstanceMethod() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run",
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-                // Use '.' on a primitive member
-                await EvaluateOnCallFrameFail(id,
-                   //BUG: TODO:
-                   //("a)", "CompilationError"),
-
-                   ("this.a.", "ReferenceError"),
-                   ("a.", "ReferenceError"),
-
-                   ("this..a", "CompilationError"),
-                   (".a.", "ReferenceError"),
-
-                   ("me.foo", "ReferenceError"),
-
-                   ("this.a + non_existant", "ReferenceError"),
-
-                   ("this.NullIfAIsNotZero.foo", "ReferenceError"),
-                   ("NullIfAIsNotZero.foo", "ReferenceError"));
-           });
-
-        [Fact]
-        public async Task NegativeTestsInStaticMethod() => await CheckInspectLocalsAtBreakpointSite(
-            "DebuggerTests.EvaluateTestsClass", "EvaluateLocals", 9, "EvaluateLocals",
-            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })",
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
-
-               await EvaluateOnCallFrameFail(id,
-                   ("me.foo", "ReferenceError"),
-                   ("this", "ReferenceError"),
-                   ("this.NullIfAIsNotZero.foo", "ReferenceError"));
-           });
-
-        async Task EvaluateOnCallFrameAndCheck(string call_frame_id, params (string expression, JObject expected)[] args)
-        {
-            foreach (var arg in args)
-            {
-                var (eval_val, _) = await EvaluateOnCallFrame(call_frame_id, arg.expression);
-                try
-                {
-                    await CheckValue(eval_val, arg.expected, arg.expression);
-                }
-                catch
-                {
-                    Console.WriteLine($"CheckValue failed for {arg.expression}. Expected: {arg.expected}, vs {eval_val}");
-                    throw;
-                }
-            }
-        }
-
-        async Task EvaluateOnCallFrameFail(string call_frame_id, params (string expression, string class_name)[] args)
-        {
-            foreach (var arg in args)
-            {
-                var (_, res) = await EvaluateOnCallFrame(call_frame_id, arg.expression, expect_ok: false);
-                if (arg.class_name != null)
-                    AssertEqual(arg.class_name, res.Error["result"]?["className"]?.Value<string>(), $"Error className did not match for expression '{arg.expression}'");
-            }
-        }
-    }
-
-}

+ 0 - 264
sdks/wasm/DebuggerTestSuite/ExceptionTests.cs

@@ -1,264 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace DebuggerTests
-{
-
-    public class ExceptionTests : DebuggerTestBase
-    {
-        [Fact]
-        public async Task ExceptionTestAll()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            int line = 15;
-            int col = 20;
-            string entry_method_name = "[debugger-test] DebuggerTests.ExceptionTestsClass:TestExceptions";
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-exception-test.cs";
-
-                await SetPauseOnException("all");
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method (" +
-                    $"'{entry_method_name}'" +
-                    "); }, 1);";
-
-                var pause_location = await EvaluateAndCheck(eval_expr, null, 0, 0, null);
-                //stop in the managed caught exception
-                pause_location = await WaitForManagedException(pause_location);
-
-                AssertEqual("run", pause_location["callFrames"]?[0]?["functionName"]?.Value<string>(), "pause0");
-
-                await CheckValue(pause_location["data"], JObject.FromObject(new
-                {
-                    type = "object",
-                    subtype = "error",
-                    className = "DebuggerTests.CustomException",
-                    uncaught = false
-                }), "exception0.data");
-
-                var exception_members = await GetProperties(pause_location["data"]["objectId"]?.Value<string>());
-                CheckString(exception_members, "message", "not implemented caught");
-
-                pause_location = await WaitForManagedException(null);
-                AssertEqual("run", pause_location["callFrames"]?[0]?["functionName"]?.Value<string>(), "pause1");
-
-                //stop in the uncaught exception
-                CheckLocation(debugger_test_loc, 28, 16, scripts, pause_location["callFrames"][0]["location"]);
-
-                await CheckValue(pause_location["data"], JObject.FromObject(new
-                {
-                    type = "object",
-                    subtype = "error",
-                    className = "DebuggerTests.CustomException",
-                    uncaught = true
-                }), "exception1.data");
-
-                exception_members = await GetProperties(pause_location["data"]["objectId"]?.Value<string>());
-                CheckString(exception_members, "message", "not implemented uncaught");
-            });
-        }
-
-        [Fact]
-        public async Task JSExceptionTestAll()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                await SetPauseOnException("all");
-
-                var eval_expr = "window.setTimeout(function () { exceptions_test (); }, 1)";
-                var pause_location = await EvaluateAndCheck(eval_expr, null, 0, 0, "exception_caught_test", null, null);
-
-                Assert.Equal("exception", pause_location["reason"]);
-                await CheckValue(pause_location["data"], JObject.FromObject(new
-                {
-                    type = "object",
-                    subtype = "error",
-                    className = "TypeError",
-                    uncaught = false
-                }), "exception0.data");
-
-                var exception_members = await GetProperties(pause_location["data"]["objectId"]?.Value<string>());
-                CheckString(exception_members, "message", "exception caught");
-
-                pause_location = await SendCommandAndCheck(null, "Debugger.resume", null, 0, 0, "exception_uncaught_test");
-
-                Assert.Equal("exception", pause_location["reason"]);
-                await CheckValue(pause_location["data"], JObject.FromObject(new
-                {
-                    type = "object",
-                    subtype = "error",
-                    className = "RangeError",
-                    uncaught = true
-                }), "exception1.data");
-
-                exception_members = await GetProperties(pause_location["data"]["objectId"]?.Value<string>());
-                CheckString(exception_members, "message", "exception uncaught");
-            });
-        }
-
-        // FIXME? BUG? We seem to get the stack trace for Runtime.exceptionThrown at `call_method`,
-        // but JS shows the original error type, and original trace
-        [Fact]
-        public async Task ExceptionTestNone()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            string entry_method_name = "[debugger-test] DebuggerTests.ExceptionTestsClass:TestExceptions";
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                await SetPauseOnException("none");
-
-                var eval_expr = "window.setTimeout(function() { invoke_static_method (" +
-                    $"'{entry_method_name}'" +
-                    "); }, 1);";
-
-                try
-                {
-                    await EvaluateAndCheck(eval_expr, null, 0, 0, "", null, null);
-                }
-                catch (ArgumentException ae)
-                {
-                    var eo = JObject.Parse(ae.Message);
-
-                    // AssertEqual (line, eo ["exceptionDetails"]?["lineNumber"]?.Value<int> (), "lineNumber");
-                    AssertEqual("Uncaught", eo["exceptionDetails"]?["text"]?.Value<string>(), "text");
-
-                    await CheckValue(eo["exceptionDetails"]?["exception"], JObject.FromObject(new
-                    {
-                        type = "object",
-                        subtype = "error",
-                        className = "Error" // BUG?: "DebuggerTests.CustomException"
-                    }), "exception");
-
-                    return;
-                }
-
-                Assert.True(false, "Expected to get an ArgumentException from the uncaught user exception");
-            });
-        }
-
-        [Fact]
-        public async Task JSExceptionTestNone()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                await SetPauseOnException("none");
-
-                var eval_expr = "window.setTimeout(function () { exceptions_test (); }, 1)";
-
-                int line = 44;
-                try
-                {
-                    await EvaluateAndCheck(eval_expr, null, 0, 0, "", null, null);
-                }
-                catch (ArgumentException ae)
-                {
-                    Console.WriteLine($"{ae}");
-                    var eo = JObject.Parse(ae.Message);
-
-                    AssertEqual(line, eo["exceptionDetails"]?["lineNumber"]?.Value<int>(), "lineNumber");
-                    AssertEqual("Uncaught", eo["exceptionDetails"]?["text"]?.Value<string>(), "text");
-
-                    await CheckValue(eo["exceptionDetails"]?["exception"], JObject.FromObject(new
-                    {
-                        type = "object",
-                        subtype = "error",
-                        className = "RangeError"
-                    }), "exception");
-
-                    return;
-                }
-
-                Assert.True(false, "Expected to get an ArgumentException from the uncaught user exception");
-            });
-        }
-
-        [Theory]
-        [InlineData("function () { exceptions_test (); }", null, 0, 0, "exception_uncaught_test", "RangeError", "exception uncaught")]
-        [InlineData("function () { invoke_static_method ('[debugger-test] DebuggerTests.ExceptionTestsClass:TestExceptions'); }",
-            "dotnet://debugger-test.dll/debugger-exception-test.cs", 28, 16, "run",
-            "DebuggerTests.CustomException", "not implemented uncaught")]
-        public async Task ExceptionTestUncaught(string eval_fn, string loc, int line, int col, string fn_name,
-            string exception_type, string exception_message)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                await SetPauseOnException("uncaught");
-
-                var eval_expr = $"window.setTimeout({eval_fn}, 1);";
-                var pause_location = await EvaluateAndCheck(eval_expr, loc, line, col, fn_name);
-
-                Assert.Equal("exception", pause_location["reason"]);
-                await CheckValue(pause_location["data"], JObject.FromObject(new
-                {
-                    type = "object",
-                    subtype = "error",
-                    className = exception_type,
-                    uncaught = true
-                }), "exception.data");
-
-                var exception_members = await GetProperties(pause_location["data"]["objectId"]?.Value<string>());
-                CheckString(exception_members, "message", exception_message);
-            });
-        }
-
-        async Task<JObject> WaitForManagedException(JObject pause_location)
-        {
-            while (true)
-            {
-                if (pause_location != null)
-                {
-                    AssertEqual("exception", pause_location["reason"]?.Value<string>(), $"Expected to only pause because of an exception. {pause_location}");
-
-                    // return in case of a managed exception, and ignore JS ones
-                    if (pause_location["data"]?["objectId"]?.Value<string>()?.StartsWith("dotnet:object:") == true)
-                    {
-                        break;
-                    }
-                }
-
-                pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", null, 0, 0, null);
-            }
-
-            return pause_location;
-        }
-    }
-}

+ 0 - 81
sdks/wasm/DebuggerTestSuite/InspectorClient.cs

@@ -1,81 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    internal class InspectorClient : DevToolsClient
-    {
-        List<(int, TaskCompletionSource<Result>)> pending_cmds = new List<(int, TaskCompletionSource<Result>)>();
-        Func<string, JObject, CancellationToken, Task> onEvent;
-        int next_cmd_id;
-
-        public InspectorClient(ILogger logger) : base(logger) { }
-
-        Task HandleMessage(string msg, CancellationToken token)
-        {
-            var res = JObject.Parse(msg);
-            if (res["id"] == null)
-                DumpProtocol(string.Format("Event method: {0} params: {1}", res["method"], res["params"]));
-            else
-                DumpProtocol(string.Format("Response id: {0} res: {1}", res["id"], res));
-
-            if (res["id"] == null)
-                return onEvent(res["method"].Value<string>(), res["params"] as JObject, token);
-            var id = res["id"].Value<int>();
-            var idx = pending_cmds.FindIndex(e => e.Item1 == id);
-            var item = pending_cmds[idx];
-            pending_cmds.RemoveAt(idx);
-            item.Item2.SetResult(Result.FromJson(res));
-            return null;
-        }
-
-        public async Task Connect(
-            Uri uri,
-            Func<string, JObject, CancellationToken, Task> onEvent,
-            Func<CancellationToken, Task> send,
-            CancellationToken token)
-        {
-
-            this.onEvent = onEvent;
-            await ConnectWithMainLoops(uri, HandleMessage, send, token);
-        }
-
-        public Task<Result> SendCommand(string method, JObject args, CancellationToken token)
-        {
-            int id = ++next_cmd_id;
-            if (args == null)
-                args = new JObject();
-
-            var o = JObject.FromObject(new
-            {
-                id = id,
-                method = method,
-                @params = args
-            });
-
-            var tcs = new TaskCompletionSource<Result>();
-            pending_cmds.Add((id, tcs));
-
-            var str = o.ToString();
-            //Log ("protocol", $"SendCommand: id: {id} method: {method} params: {args}");
-
-            var bytes = Encoding.UTF8.GetBytes(str);
-            Send(bytes, token);
-            return tcs.Task;
-        }
-
-        protected virtual void DumpProtocol(string msg)
-        {
-            // Console.WriteLine (msg);
-            //XXX make logging not stupid
-        }
-    }
-}

+ 0 - 558
sdks/wasm/DebuggerTestSuite/PointerTests.cs

@@ -1,558 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace DebuggerTests
-{
-
-    public class PointerTests : DebuggerTestBase
-    {
-
-        public static TheoryData<string, string, string, int, string, bool> PointersTestData =>
-            new TheoryData<string, string, string, int, string, bool>
-            { { $"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "LocalPointers", 32, "LocalPointers", false },
-                { $"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "LocalPointers", 32, "LocalPointers", true },
-                { $"invoke_static_method_async ('[debugger-test] DebuggerTests.PointerTests:LocalPointersAsync');", "DebuggerTests.PointerTests", "LocalPointersAsync", 32, "MoveNext", false },
-                { $"invoke_static_method_async ('[debugger-test] DebuggerTests.PointerTests:LocalPointersAsync');", "DebuggerTests.PointerTests", "LocalPointersAsync", 32, "MoveNext", true }
-            };
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalPointersToPrimitiveTypes(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   ip = TPointer("int*"),
-                   ip_null = TPointer("int*", is_null: true),
-                   ipp = TPointer("int**"),
-                   ipp_null = TPointer("int**"),
-
-                   cvalue0 = TSymbol("113 'q'"),
-                   cp = TPointer("char*"),
-
-                   vp = TPointer("void*"),
-                   vp_null = TPointer("void*", is_null: true),
-               }, "locals", num_fields: 26);
-
-               var props = await GetObjectOnLocals(locals, "ip");
-               await CheckPointerValue(props, "*ip", TNumber(5), "locals");
-
-               {
-                   var ipp_props = await GetObjectOnLocals(locals, "ipp");
-                   await CheckPointerValue(ipp_props, "*ipp", TPointer("int*"));
-
-                   ipp_props = await GetObjectOnLocals(ipp_props, "*ipp");
-                   await CheckPointerValue(ipp_props, "**ipp", TNumber(5));
-               }
-
-               {
-                   var ipp_props = await GetObjectOnLocals(locals, "ipp_null");
-                   await CheckPointerValue(ipp_props, "*ipp_null", TPointer("int*", is_null: true));
-               }
-
-               // *cp
-               props = await GetObjectOnLocals(locals, "cp");
-               await CheckPointerValue(props, "*cp", TSymbol("113 'q'"));
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalPointerArrays(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   ipa = TArray("int*[]", 3)
-               }, "locals", num_fields: 26);
-
-               var ipa_elems = await CompareObjectPropertiesFor(locals, "ipa", new[]
-               {
-                    TPointer("int*"),
-                        TPointer("int*"),
-                        TPointer("int*", is_null : true)
-               });
-
-               await CheckArrayElements(ipa_elems, new[]
-               {
-                    TNumber(5),
-                        TNumber(10),
-                        null
-               });
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalDoublePointerToPrimitiveTypeArrays(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   ippa = TArray("int**[]", 5)
-               }, "locals", num_fields: 26);
-
-               var ippa_elems = await CompareObjectPropertiesFor(locals, "ippa", new[]
-               {
-                    TPointer("int**"),
-                        TPointer("int**"),
-                        TPointer("int**"),
-                        TPointer("int**"),
-                        TPointer("int**", is_null : true)
-               });
-
-               {
-                   var actual_elems = await CheckArrayElements(ippa_elems, new[]
-                   {
-                        TPointer("int*"),
-                            TPointer("int*", is_null : true),
-                            TPointer("int*"),
-                            TPointer("int*", is_null : true),
-                            null
-                   });
-
-                   var val = await GetObjectOnLocals(actual_elems[0], "*[0]");
-                   await CheckPointerValue(val, "**[0]", TNumber(5));
-
-                   val = await GetObjectOnLocals(actual_elems[2], "*[2]");
-                   await CheckPointerValue(val, "**[2]", TNumber(5));
-               }
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalPointersToValueTypes(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   dt = TValueType("System.DateTime", dt.ToString()),
-                   dtp = TPointer("System.DateTime*"),
-                   dtp_null = TPointer("System.DateTime*", is_null: true),
-
-                   gsp = TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
-                   gsp_null = TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*")
-               }, "locals", num_fields: 26);
-
-               await CheckDateTime(locals, "dt", dt);
-
-               // *dtp
-               var props = await GetObjectOnLocals(locals, "dtp");
-               await CheckDateTime(props, "*dtp", dt);
-
-               var gsp_props = await GetObjectOnLocals(locals, "gsp");
-               await CheckPointerValue(gsp_props, "*gsp", TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>"), "locals#gsp");
-
-               {
-                   var gs_dt = new DateTime(1, 2, 3, 4, 5, 6);
-
-                   var gsp_deref_props = await GetObjectOnLocals(gsp_props, "*gsp");
-                   await CheckProps(gsp_deref_props, new
-                   {
-                       Value = TValueType("System.DateTime", gs_dt.ToString()),
-                       IntField = TNumber(4),
-                       DTPP = TPointer("System.DateTime**")
-                   }, "locals#gsp#deref");
-                   {
-                       var dtpp_props = await GetObjectOnLocals(gsp_deref_props, "DTPP");
-                       await CheckPointerValue(dtpp_props, "*DTPP", TPointer("System.DateTime*"), "locals#*gsp");
-
-                       var dtpp_deref_props = await GetObjectOnLocals(dtpp_props, "*DTPP");
-                       await CheckDateTime(dtpp_deref_props, "**DTPP", dt);
-                   }
-               }
-
-               // gsp_null
-               var gsp_w_n_props = await GetObjectOnLocals(locals, "gsp_null");
-               await CheckPointerValue(gsp_w_n_props, "*gsp_null", TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>"), "locals#gsp");
-
-               {
-                   var gs_dt = new DateTime(1, 2, 3, 4, 5, 6);
-
-                   var gsp_deref_props = await GetObjectOnLocals(gsp_w_n_props, "*gsp_null");
-                   await CheckProps(gsp_deref_props, new
-                   {
-                       Value = TValueType("System.DateTime", gs_dt.ToString()),
-                       IntField = TNumber(4),
-                       DTPP = TPointer("System.DateTime**")
-                   }, "locals#gsp#deref");
-                   {
-                       var dtpp_props = await GetObjectOnLocals(gsp_deref_props, "DTPP");
-                       await CheckPointerValue(dtpp_props, "*DTPP", TPointer("System.DateTime*", is_null: true), "locals#*gsp");
-                   }
-               }
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalPointersToValueTypeArrays(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   dtpa = TArray("System.DateTime*[]", 2)
-               }, "locals", num_fields: 26);
-
-               // dtpa
-               var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
-              {
-                    TPointer("System.DateTime*"),
-                        TPointer("System.DateTime*", is_null : true)
-               }));
-               {
-                   var actual_elems = await CheckArrayElements(dtpa_elems, new[]
-                   {
-                        TValueType("System.DateTime", dt.ToString()),
-                            null
-                   });
-
-                   await CheckDateTime(actual_elems[0], "*[0]", dt);
-               }
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalPointersToGenericValueTypeArrays(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   gspa = TArray("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*[]", 3),
-               }, "locals", num_fields: 26);
-
-               // dtpa
-               var gspa_elems = await CompareObjectPropertiesFor(locals, "gspa", new[]
-              {
-                    TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*", is_null : true),
-                        TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
-                        TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
-               });
-               {
-                   var gs_dt = new DateTime(1, 2, 3, 4, 5, 6);
-                   var actual_elems = await CheckArrayElements(gspa_elems, new[]
-                   {
-                        null,
-                        TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>"),
-                        TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>")
-                   });
-
-                   // *[1]
-                   {
-                       var gsp_deref_props = await GetObjectOnLocals(actual_elems[1], "*[1]");
-                       await CheckProps(gsp_deref_props, new
-                       {
-                           Value = TValueType("System.DateTime", gs_dt.ToString()),
-                           IntField = TNumber(4),
-                           DTPP = TPointer("System.DateTime**")
-                       }, "locals#gsp#deref");
-                       {
-                           var dtpp_props = await GetObjectOnLocals(gsp_deref_props, "DTPP");
-                           await CheckPointerValue(dtpp_props, "*DTPP", TPointer("System.DateTime*"), "locals#*gsp");
-
-                           dtpp_props = await GetObjectOnLocals(dtpp_props, "*DTPP");
-                           await CheckDateTime(dtpp_props, "**DTPP", dt);
-                       }
-                   }
-
-                   // *[2]
-                   {
-                       var gsp_deref_props = await GetObjectOnLocals(actual_elems[2], "*[2]");
-                       await CheckProps(gsp_deref_props, new
-                       {
-                           Value = TValueType("System.DateTime", gs_dt.ToString()),
-                           IntField = TNumber(4),
-                           DTPP = TPointer("System.DateTime**")
-                       }, "locals#gsp#deref");
-                       {
-                           var dtpp_props = await GetObjectOnLocals(gsp_deref_props, "DTPP");
-                           await CheckPointerValue(dtpp_props, "*DTPP", TPointer("System.DateTime*", is_null: true), "locals#*gsp");
-                       }
-                   }
-               }
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalDoublePointersToValueTypeArrays(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   dtppa = TArray("System.DateTime**[]", 3),
-               }, "locals", num_fields: 26);
-
-               // DateTime**[] dtppa = new DateTime**[] { &dtp, &dtp_null, null };
-               var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
-              {
-                    TPointer("System.DateTime**"),
-                        TPointer("System.DateTime**"),
-                        TPointer("System.DateTime**", is_null : true)
-               }));
-
-               var exp_elems = new[]
-               {
-                    TPointer("System.DateTime*"),
-                    TPointer("System.DateTime*", is_null : true),
-                    null
-               };
-
-               var actual_elems = new JToken[exp_elems.Length];
-               for (int i = 0; i < exp_elems.Length; i++)
-               {
-                   if (exp_elems[i] != null)
-                   {
-                       actual_elems[i] = await GetObjectOnLocals(dtppa_elems, i.ToString());
-                       await CheckPointerValue(actual_elems[i], $"*[{i}]", exp_elems[i], $"dtppa->");
-                   }
-               }
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersTestData))]
-        public async Task InspectLocalPointersInClasses(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   cwp = TObject("DebuggerTests.GenericClassWithPointers<System.DateTime>"),
-                   cwp_null = TObject("DebuggerTests.GenericClassWithPointers<System.DateTime>")
-               }, "locals", num_fields: 26);
-
-               var cwp_props = await GetObjectOnLocals(locals, "cwp");
-               var ptr_props = await GetObjectOnLocals(cwp_props, "Ptr");
-               await CheckDateTime(ptr_props, "*Ptr", dt);
-           });
-
-        public static TheoryData<string, string, string, int, string, bool> PointersAsMethodArgsTestData =>
-            new TheoryData<string, string, string, int, string, bool>
-            { { $"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "PointersAsArgsTest", 2, "PointersAsArgsTest", false },
-                { $"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "PointersAsArgsTest", 2, "PointersAsArgsTest", true },
-            };
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersAsMethodArgsTestData))]
-        public async Task InspectPrimitiveTypePointersAsMethodArgs(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   ip = TPointer("int*"),
-                   ipp = TPointer("int**"),
-                   ipa = TArray("int*[]", 3),
-                   ippa = TArray("int**[]", 5)
-               }, "locals", num_fields: 8);
-
-               // ip
-               var props = await GetObjectOnLocals(locals, "ip");
-               await CheckPointerValue(props, "*ip", TNumber(5), "locals");
-
-               // ipp
-               var ipp_props = await GetObjectOnLocals(locals, "ipp");
-               await CheckPointerValue(ipp_props, "*ipp", TPointer("int*"));
-
-               ipp_props = await GetObjectOnLocals(ipp_props, "*ipp");
-               await CheckPointerValue(ipp_props, "**ipp", TNumber(5));
-
-               // ipa
-               var ipa_elems = await CompareObjectPropertiesFor(locals, "ipa", new[]
-              {
-                    TPointer("int*"),
-                        TPointer("int*"),
-                        TPointer("int*", is_null : true)
-               });
-
-               await CheckArrayElements(ipa_elems, new[]
-               {
-                    TNumber(5),
-                        TNumber(10),
-                        null
-               });
-
-               // ippa
-               var ippa_elems = await CompareObjectPropertiesFor(locals, "ippa", new[]
-              {
-                    TPointer("int**"),
-                        TPointer("int**"),
-                        TPointer("int**"),
-                        TPointer("int**"),
-                        TPointer("int**", is_null : true)
-               });
-
-               {
-                   var actual_elems = await CheckArrayElements(ippa_elems, new[]
-                   {
-                        TPointer("int*"),
-                            TPointer("int*", is_null : true),
-                            TPointer("int*"),
-                            TPointer("int*", is_null : true),
-                            null
-                   });
-
-                   var val = await GetObjectOnLocals(actual_elems[0], "*[0]");
-                   await CheckPointerValue(val, "**[0]", TNumber(5));
-
-                   val = await GetObjectOnLocals(actual_elems[2], "*[2]");
-                   await CheckPointerValue(val, "**[2]", TNumber(5));
-               }
-           });
-
-        [Theory]
-        [MemberDataAttribute(nameof(PointersAsMethodArgsTestData))]
-        public async Task InspectValueTypePointersAsMethodArgs(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               var dt = new DateTime(5, 6, 7, 8, 9, 10);
-               await CheckProps(locals, new
-               {
-                   dtp = TPointer("System.DateTime*"),
-                   dtpp = TPointer("System.DateTime**"),
-                   dtpa = TArray("System.DateTime*[]", 2),
-                   dtppa = TArray("System.DateTime**[]", 3)
-               }, "locals", num_fields: 8);
-
-               // *dtp
-               var dtp_props = await GetObjectOnLocals(locals, "dtp");
-               await CheckDateTime(dtp_props, "*dtp", dt);
-
-               // *dtpp
-               var dtpp_props = await GetObjectOnLocals(locals, "dtpp");
-               await CheckPointerValue(dtpp_props, "*dtpp", TPointer("System.DateTime*"), "locals");
-
-               dtpp_props = await GetObjectOnLocals(dtpp_props, "*dtpp");
-               await CheckDateTime(dtpp_props, "**dtpp", dt);
-
-               // dtpa
-               var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
-              {
-                    TPointer("System.DateTime*"),
-                        TPointer("System.DateTime*", is_null : true)
-               }));
-               {
-                   var actual_elems = await CheckArrayElements(dtpa_elems, new[]
-                   {
-                        TValueType("System.DateTime", dt.ToString()),
-                            null
-                   });
-
-                   await CheckDateTime(actual_elems[0], "*[0]", dt);
-               }
-
-               // dtppa = new DateTime**[] { &dtp, &dtp_null, null };
-               var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
-              {
-                    TPointer("System.DateTime**"),
-                        TPointer("System.DateTime**"),
-                        TPointer("System.DateTime**", is_null : true)
-               }));
-
-               var exp_elems = new[]
-               {
-                    TPointer("System.DateTime*"),
-                    TPointer("System.DateTime*", is_null : true),
-                    null
-               };
-
-               await CheckArrayElements(dtppa_elems, exp_elems);
-           });
-
-        [Theory]
-        [InlineData("invoke_static_method ('[debugger-test] Math:UseComplex', 0, 0);", "Math", "UseComplex", 3, "UseComplex", false)]
-        [InlineData("invoke_static_method ('[debugger-test] Math:UseComplex', 0, 0);", "Math", "UseComplex", 3, "UseComplex", true)]
-        public async Task DerefNonPointerObject(string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            type, method, line_offset, bp_function_name,
-            "window.setTimeout(function() { " + eval_fn + " })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-
-               // this will generate the object ids
-               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-               var complex = GetAndAssertObjectWithName(locals, "complex");
-
-               // try to deref the non-pointer object, as a pointer
-               await GetProperties(complex["value"]["objectId"].Value<string>().Replace(":object:", ":pointer:"), expect_ok: false);
-
-               // try to deref an invalid pointer id
-               await GetProperties("dotnet:pointer:123897", expect_ok: false);
-           });
-
-        async Task<JToken[]> CheckArrayElements(JToken array, JToken[] exp_elems)
-        {
-            var actual_elems = new JToken[exp_elems.Length];
-            for (int i = 0; i < exp_elems.Length; i++)
-            {
-                if (exp_elems[i] != null)
-                {
-                    actual_elems[i] = await GetObjectOnLocals(array, i.ToString());
-                    await CheckPointerValue(actual_elems[i], $"*[{i}]", exp_elems[i], $"dtppa->");
-                }
-            }
-
-            return actual_elems;
-        }
-    }
-}

+ 0 - 1064
sdks/wasm/DebuggerTestSuite/Support.cs

@@ -1,1064 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net.WebSockets;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using Xunit;
-using Xunit.Sdk;
-
-namespace DebuggerTests
-{
-    class Inspector
-    {
-        // InspectorClient client;
-        Dictionary<string, TaskCompletionSource<JObject>> notifications = new Dictionary<string, TaskCompletionSource<JObject>>();
-        Dictionary<string, Func<JObject, CancellationToken, Task>> eventListeners = new Dictionary<string, Func<JObject, CancellationToken, Task>>();
-
-        public const string PAUSE = "pause";
-        public const string READY = "ready";
-
-        public Task<JObject> WaitFor(string what)
-        {
-            if (notifications.ContainsKey(what))
-                throw new Exception($"Invalid internal state, waiting for {what} while another wait is already setup");
-            var n = new TaskCompletionSource<JObject>();
-            notifications[what] = n;
-            return n.Task;
-        }
-
-        void NotifyOf(string what, JObject args)
-        {
-            if (!notifications.ContainsKey(what))
-                throw new Exception($"Invalid internal state, notifying of {what}, but nobody waiting");
-            notifications[what].SetResult(args);
-            notifications.Remove(what);
-        }
-
-        public void On(string evtName, Func<JObject, CancellationToken, Task> cb)
-        {
-            eventListeners[evtName] = cb;
-        }
-
-        void FailAllWaitersWithException(JObject exception)
-        {
-            foreach (var tcs in notifications.Values)
-                tcs.SetException(new ArgumentException(exception.ToString()));
-        }
-
-        async Task OnMessage(string method, JObject args, CancellationToken token)
-        {
-            //System.Console.WriteLine("OnMessage " + method + args);
-            switch (method)
-            {
-                case "Debugger.paused":
-                    NotifyOf(PAUSE, args);
-                    break;
-                case "Mono.runtimeReady":
-                    NotifyOf(READY, args);
-                    break;
-                case "Runtime.consoleAPICalled":
-                    Console.WriteLine("CWL: {0}", args?["args"]?[0]?["value"]);
-                    break;
-            }
-            if (eventListeners.ContainsKey(method))
-                await eventListeners[method](args, token);
-            else if (String.Compare(method, "Runtime.exceptionThrown") == 0)
-                FailAllWaitersWithException(args);
-        }
-
-        public async Task Ready(Func<InspectorClient, CancellationToken, Task> cb = null, TimeSpan? span = null)
-        {
-            using (var cts = new CancellationTokenSource())
-            {
-                cts.CancelAfter(span?.Milliseconds ?? 60 * 1000); //tests have 1 minute to complete by default
-                var uri = new Uri($"ws://{TestHarnessProxy.Endpoint.Authority}/launch-chrome-and-connect");
-                using var loggerFactory = LoggerFactory.Create(
-                    builder => builder.AddConsole().AddFilter(null, LogLevel.Information));
-                using (var client = new InspectorClient(loggerFactory.CreateLogger<Inspector>()))
-                {
-                    await client.Connect(uri, OnMessage, async token =>
-                    {
-                        Task[] init_cmds = {
-                    client.SendCommand("Profiler.enable", null, token),
-                    client.SendCommand("Runtime.enable", null, token),
-                    client.SendCommand("Debugger.enable", null, token),
-                    client.SendCommand("Runtime.runIfWaitingForDebugger", null, token),
-                    WaitFor(READY),
-                        };
-                        // await Task.WhenAll (init_cmds);
-                        Console.WriteLine("waiting for the runtime to be ready");
-                        await init_cmds[4];
-                        Console.WriteLine("runtime ready, TEST TIME");
-                        if (cb != null)
-                        {
-                            Console.WriteLine("await cb(client, token)");
-                            await cb(client, token);
-                        }
-
-                    }, cts.Token);
-                    await client.Close(cts.Token);
-                }
-            }
-        }
-    }
-
-    public class DebuggerTestBase
-    {
-        protected Task startTask;
-
-        static string FindTestPath()
-        {
-            //FIXME how would I locate it otherwise?
-            var test_path = Environment.GetEnvironmentVariable("TEST_SUITE_PATH");
-            //Lets try to guest
-            if (test_path != null && Directory.Exists(test_path))
-                return test_path;
-
-            var cwd = Environment.CurrentDirectory;
-            Console.WriteLine("guessing from {0}", cwd);
-            //tests run from DebuggerTestSuite/bin/Debug/netcoreapp2.1
-            var new_path = Path.Combine(cwd, "../../../../bin/debugger-test-suite");
-            if (File.Exists(Path.Combine(new_path, "debugger-driver.html")))
-                return new_path;
-
-            throw new Exception("Missing TEST_SUITE_PATH env var and could not guess path from CWD");
-        }
-
-        static string[] PROBE_LIST = {
-            "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
-            "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
-            "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
-            "/usr/bin/chromium",
-            "/usr/bin/chromium-browser",
-        };
-        static string chrome_path;
-
-        static string FindChromePath()
-        {
-            if (chrome_path != null)
-                return chrome_path;
-
-            foreach (var s in PROBE_LIST)
-            {
-                if (File.Exists(s))
-                {
-                    chrome_path = s;
-                    Console.WriteLine($"Using chrome path: ${s}");
-                    return s;
-                }
-            }
-            throw new Exception("Could not find an installed Chrome to use");
-        }
-
-        public DebuggerTestBase(string driver = "debugger-driver.html")
-        {
-            startTask = TestHarnessProxy.Start(FindChromePath(), FindTestPath(), driver);
-        }
-
-        public Task Ready() => startTask;
-
-        internal DebugTestContext ctx;
-        internal Dictionary<string, string> dicScriptsIdToUrl;
-        internal Dictionary<string, string> dicFileToUrl;
-        internal Dictionary<string, string> SubscribeToScripts(Inspector insp)
-        {
-            dicScriptsIdToUrl = new Dictionary<string, string>();
-            dicFileToUrl = new Dictionary<string, string>();
-            insp.On("Debugger.scriptParsed", async (args, c) =>
-            {
-                var script_id = args?["scriptId"]?.Value<string>();
-                var url = args["url"]?.Value<string>();
-                if (script_id.StartsWith("dotnet://"))
-                {
-                    var dbgUrl = args["dotNetUrl"]?.Value<string>();
-                    var arrStr = dbgUrl.Split("/");
-                    dbgUrl = arrStr[0] + "/" + arrStr[1] + "/" + arrStr[2] + "/" + arrStr[arrStr.Length - 1];
-                    dicScriptsIdToUrl[script_id] = dbgUrl;
-                    dicFileToUrl[dbgUrl] = args["url"]?.Value<string>();
-                }
-                else if (!String.IsNullOrEmpty(url))
-                {
-                    dicFileToUrl[new Uri(url).AbsolutePath] = url;
-                }
-                await Task.FromResult(0);
-            });
-            return dicScriptsIdToUrl;
-        }
-
-        internal async Task CheckInspectLocalsAtBreakpointSite(string url_key, int line, int column, string function_name, string eval_expression,
-            Action<JToken> test_fn = null, Func<JObject, Task> wait_for_event_fn = null, bool use_cfo = false)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-
-                var bp = await SetBreakpoint(url_key, line, column);
-
-                await EvaluateAndCheck(
-                    eval_expression, url_key, line, column,
-                    function_name,
-                    wait_for_event_fn: async (pause_location) =>
-                   {
-                       //make sure we're on the right bp
-
-                       Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
-
-                       var top_frame = pause_location["callFrames"][0];
-
-                       var scope = top_frame["scopeChain"][0];
-                       Assert.Equal("dotnet:scope:0", scope["object"]["objectId"]);
-                       if (wait_for_event_fn != null)
-                           await wait_for_event_fn(pause_location);
-                       else
-                           await Task.CompletedTask;
-                   },
-                    locals_fn: (locals) =>
-                    {
-                        if (test_fn != null)
-                            test_fn(locals);
-                    }
-                );
-            });
-        }
-
-        // sets breakpoint by method name and line offset
-        internal async Task CheckInspectLocalsAtBreakpointSite(string type, string method, int line_offset, string bp_function_name, string eval_expression,
-            Action<JToken> locals_fn = null, Func<JObject, Task> wait_for_event_fn = null, bool use_cfo = false, string assembly = "debugger-test.dll", int col = 0)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-
-                var bp = await SetBreakpointInMethod(assembly, type, method, line_offset, col);
-
-                var args = JObject.FromObject(new { expression = eval_expression });
-                var res = await ctx.cli.SendCommand("Runtime.evaluate", args, ctx.token);
-                if (!res.IsOk)
-                {
-                    Console.WriteLine($"Failed to run command {method} with args: {args?.ToString()}\nresult: {res.Error.ToString()}");
-                    Assert.True(false, $"SendCommand for {method} failed with {res.Error.ToString()}");
-                }
-
-                var pause_location = await ctx.insp.WaitFor(Inspector.PAUSE);
-
-                if (bp_function_name != null)
-                    Assert.Equal(bp_function_name, pause_location["callFrames"]?[0]?["functionName"]?.Value<string>());
-
-                Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
-
-                var top_frame = pause_location["callFrames"][0];
-
-                var scope = top_frame["scopeChain"][0];
-                Assert.Equal("dotnet:scope:0", scope["object"]["objectId"]);
-
-                if (wait_for_event_fn != null)
-                    await wait_for_event_fn(pause_location);
-
-                if (locals_fn != null)
-                {
-                    var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                    locals_fn(locals);
-                }
-            });
-        }
-
-        internal void CheckLocation(string script_loc, int line, int column, Dictionary<string, string> scripts, JToken location)
-        {
-            var loc_str = $"{ scripts[location["scriptId"].Value<string>()] }" +
-                $"#{ location["lineNumber"].Value<int>() }" +
-                $"#{ location["columnNumber"].Value<int>() }";
-
-            var expected_loc_str = $"{script_loc}#{line}#{column}";
-            Assert.Equal(expected_loc_str, loc_str);
-        }
-
-        internal void CheckNumber<T>(JToken locals, string name, T value)
-        {
-            foreach (var l in locals)
-            {
-                if (name != l["name"]?.Value<string>())
-                    continue;
-                var val = l["value"];
-                Assert.Equal("number", val["type"]?.Value<string>());
-                Assert.Equal(value, val["value"].Value<T>());
-                Assert.Equal(value.ToString(), val["description"].Value<T>().ToString());
-                return;
-            }
-            Assert.True(false, $"Could not find variable '{name}'");
-        }
-
-        internal void CheckString(JToken locals, string name, string value)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            CheckValue(l["value"], TString(value), name).Wait();
-        }
-
-        internal JToken CheckSymbol(JToken locals, string name, string value)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            CheckValue(l["value"], TSymbol(value), name).Wait();
-            return l;
-        }
-
-        internal JToken CheckObject(JToken locals, string name, string class_name, string subtype = null, bool is_null = false)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            var val = l["value"];
-            CheckValue(val, TObject(class_name, is_null: is_null), name).Wait();
-            Assert.True(val["isValueType"] == null || !val["isValueType"].Value<bool>());
-
-            return l;
-        }
-
-        internal async Task<JToken> CheckPointerValue(JToken locals, string name, JToken expected, string label = null)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            await CheckValue(l["value"], expected, $"{label ?? String.Empty}-{name}");
-            return l;
-        }
-
-        internal async Task CheckDateTime(JToken value, DateTime expected, string label = "")
-        {
-            await CheckValue(value, TValueType("System.DateTime", expected.ToString()), label);
-            await CheckDateTimeValue(value, expected);
-        }
-
-        internal async Task CheckDateTime(JToken locals, string name, DateTime expected)
-        {
-            var obj = GetAndAssertObjectWithName(locals, name);
-            await CheckDateTimeValue(obj["value"], expected);
-        }
-
-        internal async Task CheckDateTimeValue(JToken value, DateTime expected)
-        {
-            await CheckDateTimeMembers(value, expected);
-
-            var res = await InvokeGetter(JObject.FromObject(new { value = value }), "Date");
-            await CheckDateTimeMembers(res.Value["result"], expected.Date);
-
-            // FIXME: check some float properties too
-
-            async Task CheckDateTimeMembers(JToken v, DateTime exp_dt)
-            {
-                AssertEqual("System.DateTime", v["className"]?.Value<string>(), "className");
-                AssertEqual(exp_dt.ToString(), v["description"]?.Value<string>(), "description");
-
-                var members = await GetProperties(v["objectId"]?.Value<string>());
-
-                // not checking everything
-                CheckNumber(members, "Year", exp_dt.Year);
-                CheckNumber(members, "Month", exp_dt.Month);
-                CheckNumber(members, "Day", exp_dt.Day);
-                CheckNumber(members, "Hour", exp_dt.Hour);
-                CheckNumber(members, "Minute", exp_dt.Minute);
-                CheckNumber(members, "Second", exp_dt.Second);
-            }
-        }
-
-        internal JToken CheckBool(JToken locals, string name, bool expected)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            CheckValue(l["value"], TBool(expected), name).Wait();
-            return l;
-        }
-
-        internal void CheckContentValue(JToken token, string value)
-        {
-            var val = token["value"].Value<string>();
-            Assert.Equal(value, val);
-        }
-
-        internal JToken CheckValueType(JToken locals, string name, string class_name)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            CheckValue(l["value"], TValueType(class_name), name).Wait();
-            return l;
-        }
-
-        internal JToken CheckEnum(JToken locals, string name, string class_name, string descr)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            CheckValue(l["value"], TEnum(class_name, descr), name).Wait();
-            return l;
-        }
-
-        internal void CheckArray(JToken locals, string name, string class_name, int length)
-           => CheckValue(
-                GetAndAssertObjectWithName(locals, name)["value"],
-                TArray(class_name, length), name).Wait();
-
-        internal JToken GetAndAssertObjectWithName(JToken obj, string name)
-        {
-            var l = obj.FirstOrDefault(jt => jt["name"]?.Value<string>() == name);
-            if (l == null)
-                Assert.True(false, $"Could not find variable '{name}'");
-            return l;
-        }
-
-        internal async Task<Result> SendCommand(string method, JObject args)
-        {
-            var res = await ctx.cli.SendCommand(method, args, ctx.token);
-            if (!res.IsOk)
-            {
-                Console.WriteLine($"Failed to run command {method} with args: {args?.ToString()}\nresult: {res.Error.ToString()}");
-                Assert.True(false, $"SendCommand for {method} failed with {res.Error.ToString()}");
-            }
-            return res;
-        }
-
-        internal async Task<Result> Evaluate(string expression)
-        {
-            return await SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = expression }));
-        }
-
-        internal void AssertLocation(JObject args, string methodName)
-        {
-            Assert.Equal(methodName, args["callFrames"]?[0]?["functionName"]?.Value<string>());
-        }
-
-        // Place a breakpoint in the given method and run until its hit
-        // Return the Debugger.paused data
-        internal async Task<JObject> RunUntil(string methodName)
-        {
-            await SetBreakpointInMethod("debugger-test", "DebuggerTest", methodName);
-            // This will run all the tests until it hits the bp
-            await Evaluate("window.setTimeout(function() { invoke_run_all (); }, 1);");
-            var wait_res = await ctx.insp.WaitFor(Inspector.PAUSE);
-            AssertLocation(wait_res, "locals_inner");
-            return wait_res;
-        }
-
-        internal async Task<Result> InvokeGetter(JToken obj, object arguments, string fn = "function(e){return this[e]}", bool expect_ok = true, bool? returnByValue = null)
-        {
-            var req = JObject.FromObject(new
-            {
-                functionDeclaration = fn,
-                objectId = obj["value"]?["objectId"]?.Value<string>(),
-                arguments = new[] { new { value = arguments } }
-            });
-            if (returnByValue != null)
-                req["returnByValue"] = returnByValue.Value;
-
-            var res = await ctx.cli.SendCommand("Runtime.callFunctionOn", req, ctx.token);
-            Assert.True(expect_ok == res.IsOk, $"InvokeGetter failed for {req} with {res}");
-
-            return res;
-        }
-
-        internal async Task<JObject> StepAndCheck(StepKind kind, string script_loc, int line, int column, string function_name,
-            Func<JObject, Task> wait_for_event_fn = null, Action<JToken> locals_fn = null, int times = 1)
-        {
-            for (int i = 0; i < times - 1; i++)
-            {
-                await SendCommandAndCheck(null, $"Debugger.step{kind.ToString()}", null, -1, -1, null);
-            }
-
-            // Check for method/line etc only at the last step
-            return await SendCommandAndCheck(
-                null, $"Debugger.step{kind.ToString()}", script_loc, line, column, function_name,
-                wait_for_event_fn: wait_for_event_fn,
-                locals_fn: locals_fn);
-        }
-
-        internal async Task<JObject> EvaluateAndCheck(string expression, string script_loc, int line, int column, string function_name,
-            Func<JObject, Task> wait_for_event_fn = null, Action<JToken> locals_fn = null) => await SendCommandAndCheck(
-            JObject.FromObject(new { expression = expression }),
-            "Runtime.evaluate", script_loc, line, column, function_name,
-            wait_for_event_fn: wait_for_event_fn,
-            locals_fn: locals_fn);
-
-        internal async Task<JObject> SendCommandAndCheck(JObject args, string method, string script_loc, int line, int column, string function_name,
-            Func<JObject, Task> wait_for_event_fn = null, Action<JToken> locals_fn = null, string waitForEvent = Inspector.PAUSE)
-        {
-            var res = await ctx.cli.SendCommand(method, args, ctx.token);
-            if (!res.IsOk)
-            {
-                Console.WriteLine($"Failed to run command {method} with args: {args?.ToString()}\nresult: {res.Error.ToString()}");
-                Assert.True(false, $"SendCommand for {method} failed with {res.Error.ToString()}");
-            }
-
-            var wait_res = await ctx.insp.WaitFor(waitForEvent);
-
-            if (function_name != null)
-                Assert.Equal(function_name, wait_res["callFrames"]?[0]?["functionName"]?.Value<string>());
-
-            if (script_loc != null)
-                CheckLocation(script_loc, line, column, ctx.scripts, wait_res["callFrames"][0]["location"]);
-
-            if (wait_for_event_fn != null)
-                await wait_for_event_fn(wait_res);
-
-            if (locals_fn != null)
-            {
-                var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value<string>());
-                locals_fn(locals);
-            }
-
-            return wait_res;
-        }
-
-        internal async Task CheckDelegate(JToken locals, string name, string className, string target)
-        {
-            var l = GetAndAssertObjectWithName(locals, name);
-            var val = l["value"];
-
-            await CheckDelegate(l, TDelegate(className, target), name);
-        }
-
-        internal async Task CheckDelegate(JToken actual_val, JToken exp_val, string label)
-        {
-            AssertEqual("object", actual_val["type"]?.Value<string>(), $"{label}-type");
-            AssertEqual(exp_val["className"]?.Value<string>(), actual_val["className"]?.Value<string>(), $"{label}-className");
-
-            var actual_target = actual_val["description"]?.Value<string>();
-            Assert.True(actual_target != null, $"${label}-description");
-            var exp_target = exp_val["target"].Value<string>();
-
-            CheckDelegateTarget(actual_target, exp_target);
-
-            var del_props = await GetProperties(actual_val["objectId"]?.Value<string>());
-            AssertEqual(1, del_props.Count(), $"${label}-delegate-properties-count");
-
-            var obj = del_props.Where(jt => jt["name"]?.Value<string>() == "Target").FirstOrDefault();
-            Assert.True(obj != null, $"[{label}] Property named 'Target' found found in delegate properties");
-
-            AssertEqual("symbol", obj["value"]?["type"]?.Value<string>(), $"{label}#Target#type");
-            CheckDelegateTarget(obj["value"]?["value"]?.Value<string>(), exp_target);
-
-            return;
-
-            void CheckDelegateTarget(string actual_target, string exp_target)
-            {
-                var parts = exp_target.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
-                if (parts.Length == 1)
-                {
-                    // not a generated method
-                    AssertEqual(exp_target, actual_target, $"{label}-description");
-                }
-                else
-                {
-                    bool prefix = actual_target.StartsWith(parts[0], StringComparison.Ordinal);
-                    Assert.True(prefix, $"{label}-description, Expected target to start with '{parts[0]}'. Actual: '{actual_target}'");
-
-                    var remaining = actual_target.Substring(parts[0].Length);
-                    bool suffix = remaining.EndsWith(parts[1], StringComparison.Ordinal);
-                    Assert.True(prefix, $"{label}-description, Expected target to end with '{parts[1]}'. Actual: '{remaining}'");
-                }
-            }
-        }
-
-        internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string label)
-        {
-            var ctype = exp_val["__custom_type"].Value<string>();
-            switch (ctype)
-            {
-                case "delegate":
-                    await CheckDelegate(actual_val, exp_val, label);
-                    break;
-
-                case "pointer":
-                    {
-
-                        if (exp_val["is_null"]?.Value<bool>() == true)
-                        {
-                            AssertEqual("symbol", actual_val["type"]?.Value<string>(), $"{label}-type");
-
-                            var exp_val_str = $"({exp_val["type_name"]?.Value<string>()}) 0";
-                            AssertEqual(exp_val_str, actual_val["value"]?.Value<string>(), $"{label}-value");
-                            AssertEqual(exp_val_str, actual_val["description"]?.Value<string>(), $"{label}-description");
-                        }
-                        else if (exp_val["is_void"]?.Value<bool>() == true)
-                        {
-                            AssertEqual("symbol", actual_val["type"]?.Value<string>(), $"{label}-type");
-
-                            var exp_val_str = $"({exp_val["type_name"]?.Value<string>()})";
-                            AssertStartsWith(exp_val_str, actual_val["value"]?.Value<string>(), $"{label}-value");
-                            AssertStartsWith(exp_val_str, actual_val["description"]?.Value<string>(), $"{label}-description");
-                        }
-                        else
-                        {
-                            AssertEqual("object", actual_val["type"]?.Value<string>(), $"{label}-type");
-
-                            var exp_prefix = $"({exp_val["type_name"]?.Value<string>()})";
-                            AssertStartsWith(exp_prefix, actual_val["className"]?.Value<string>(), $"{label}-className");
-                            AssertStartsWith(exp_prefix, actual_val["description"]?.Value<string>(), $"{label}-description");
-                            Assert.False(actual_val["className"]?.Value<string>() == $"{exp_prefix} 0", $"[{label}] Expected a non-null value, but got {actual_val}");
-                        }
-                        break;
-                    }
-
-                case "getter":
-                    {
-                        // For getter, `actual_val` is not `.value`, instead it's the container object
-                        // which has a `.get` instead of a `.value`
-                        var get = actual_val["get"];
-                        Assert.True(get != null, $"[{label}] No `get` found. {(actual_val != null ? "Make sure to pass the container object for testing getters, and not the ['value']" : String.Empty)}");
-
-                        AssertEqual("Function", get["className"]?.Value<string>(), $"{label}-className");
-                        AssertStartsWith($"get {exp_val["type_name"]?.Value<string>()} ()", get["description"]?.Value<string>(), $"{label}-description");
-                        AssertEqual("function", get["type"]?.Value<string>(), $"{label}-type");
-
-                        break;
-                    }
-
-                case "datetime":
-                    {
-                        var dateTime = DateTime.FromBinary(exp_val["binary"].Value<long>());
-                        await CheckDateTime(actual_val, dateTime, label);
-                        break;
-                    }
-
-                case "ignore_me":
-                    // nothing to check ;)
-                    break;
-
-                default:
-                    throw new ArgumentException($"{ctype} not supported");
-            }
-        }
-
-        internal async Task CheckProps(JToken actual, object exp_o, string label, int num_fields = -1)
-        {
-            if (exp_o.GetType().IsArray || exp_o is JArray)
-            {
-                if (!(actual is JArray actual_arr))
-                {
-                    Assert.True(false, $"[{label}] Expected to get an array here but got {actual}");
-                    return;
-                }
-
-                var exp_v_arr = JArray.FromObject(exp_o);
-                AssertEqual(exp_v_arr.Count, actual_arr.Count(), $"{label}-count");
-
-                for (int i = 0; i < exp_v_arr.Count; i++)
-                {
-                    var exp_i = exp_v_arr[i];
-                    var act_i = actual_arr[i];
-
-                    AssertEqual(i.ToString(), act_i["name"]?.Value<string>(), $"{label}-[{i}].name");
-                    if (exp_i != null)
-                        await CheckValue(act_i["value"], exp_i, $"{label}-{i}th value");
-                }
-
-                return;
-            }
-
-            // Not an array
-            var exp = exp_o as JObject;
-            if (exp == null)
-                exp = JObject.FromObject(exp_o);
-
-            num_fields = num_fields < 0 ? exp.Values<JToken>().Count() : num_fields;
-            Assert.True(num_fields == actual.Count(), $"[{label}] Number of fields don't match, Expected: {num_fields}, Actual: {actual.Count()}");
-
-            foreach (var kvp in exp)
-            {
-                var exp_name = kvp.Key;
-                var exp_val = kvp.Value;
-
-                var actual_obj = actual.FirstOrDefault(jt => jt["name"]?.Value<string>() == exp_name);
-                if (actual_obj == null)
-                {
-                    Assert.True(actual_obj != null, $"[{label}] Could not find property named '{exp_name}'");
-                }
-
-                Assert.True(actual_obj != null, $"[{label}] not value found for property named '{exp_name}'");
-
-                var actual_val = actual_obj["value"];
-                if (exp_val.Type == JTokenType.Array)
-                {
-                    var actual_props = await GetProperties(actual_val["objectId"]?.Value<string>());
-                    await CheckProps(actual_props, exp_val, $"{label}-{exp_name}");
-                }
-                else if (exp_val["__custom_type"] != null && exp_val["__custom_type"]?.Value<string>() == "getter")
-                {
-                    // hack: for getters, actual won't have a .value
-                    await CheckCustomType(actual_obj, exp_val, $"{label}#{exp_name}");
-                }
-                else
-                {
-                    await CheckValue(actual_val, exp_val, $"{label}#{exp_name}");
-                }
-            }
-        }
-
-        internal async Task CheckValue(JToken actual_val, JToken exp_val, string label)
-        {
-            if (exp_val["__custom_type"] != null)
-            {
-                await CheckCustomType(actual_val, exp_val, label);
-                return;
-            }
-
-            if (exp_val["type"] == null && actual_val["objectId"] != null)
-            {
-                var new_val = await GetProperties(actual_val["objectId"].Value<string>());
-                await CheckProps(new_val, exp_val, $"{label}-{actual_val["objectId"]?.Value<string>()}");
-                return;
-            }
-
-            foreach (var jp in exp_val.Values<JProperty>())
-            {
-                if (jp.Value.Type == JTokenType.Object)
-                {
-                    var new_val = await GetProperties(actual_val["objectId"].Value<string>());
-                    await CheckProps(new_val, jp.Value, $"{label}-{actual_val["objectId"]?.Value<string>()}");
-
-                    continue;
-                }
-
-                var exp_val_str = jp.Value.Value<string>();
-                bool null_or_empty_exp_val = String.IsNullOrEmpty(exp_val_str);
-
-                var actual_field_val = actual_val.Values<JProperty>().FirstOrDefault(a_jp => a_jp.Name == jp.Name);
-                var actual_field_val_str = actual_field_val?.Value?.Value<string>();
-                if (null_or_empty_exp_val && String.IsNullOrEmpty(actual_field_val_str))
-                    continue;
-
-                Assert.True(actual_field_val != null, $"[{label}] Could not find value field named {jp.Name}");
-
-                Assert.True(exp_val_str == actual_field_val_str,
-                    $"[{label}] Value for json property named {jp.Name} didn't match.\n" +
-                    $"Expected: {jp.Value.Value<string>()}\n" +
-                    $"Actual:   {actual_field_val.Value.Value<string>()}");
-            }
-        }
-
-        internal async Task<JToken> GetLocalsForFrame(JToken frame, string script_loc, int line, int column, string function_name)
-        {
-            CheckLocation(script_loc, line, column, ctx.scripts, frame["location"]);
-            Assert.Equal(function_name, frame["functionName"].Value<string>());
-
-            return await GetProperties(frame["callFrameId"].Value<string>());
-        }
-
-        internal async Task<JToken> GetObjectOnFrame(JToken frame, string name)
-        {
-            var locals = await GetProperties(frame["callFrameId"].Value<string>());
-            return await GetObjectOnLocals(locals, name);
-        }
-
-        // Find an object with @name, *fetch* the object, and check against @o
-        internal async Task<JToken> CompareObjectPropertiesFor(JToken locals, string name, object o, string label = null, int num_fields = -1)
-        {
-            if (label == null)
-                label = name;
-            var props = await GetObjectOnLocals(locals, name);
-            try
-            {
-                if (o != null)
-                    await CheckProps(props, o, label, num_fields);
-                return props;
-            }
-            catch
-            {
-                throw;
-            }
-        }
-
-        internal async Task<JToken> GetObjectOnLocals(JToken locals, string name)
-        {
-            var obj = GetAndAssertObjectWithName(locals, name);
-            var objectId = obj["value"]["objectId"]?.Value<string>();
-            Assert.True(!String.IsNullOrEmpty(objectId), $"No objectId found for {name}");
-
-            return await GetProperties(objectId);
-        }
-
-        /* @fn_args is for use with `Runtime.callFunctionOn` only */
-        internal async Task<JToken> GetProperties(string id, JToken fn_args = null, bool expect_ok = true)
-        {
-            if (ctx.UseCallFunctionOnBeforeGetProperties && !id.StartsWith("dotnet:scope:"))
-            {
-                var fn_decl = "function () { return this; }";
-                var cfo_args = JObject.FromObject(new
-                {
-                    functionDeclaration = fn_decl,
-                    objectId = id
-                });
-                if (fn_args != null)
-                    cfo_args["arguments"] = fn_args;
-
-                var result = await ctx.cli.SendCommand("Runtime.callFunctionOn", cfo_args, ctx.token);
-                AssertEqual(expect_ok, result.IsOk, $"Runtime.getProperties returned {result.IsOk} instead of {expect_ok}, for {cfo_args.ToString()}, with Result: {result}");
-                if (!result.IsOk)
-                    return null;
-                id = result.Value["result"]?["objectId"]?.Value<string>();
-            }
-
-            var get_prop_req = JObject.FromObject(new
-            {
-                objectId = id
-            });
-
-            var frame_props = await ctx.cli.SendCommand("Runtime.getProperties", get_prop_req, ctx.token);
-            AssertEqual(expect_ok, frame_props.IsOk, $"Runtime.getProperties returned {frame_props.IsOk} instead of {expect_ok}, for {get_prop_req}, with Result: {frame_props}");
-            if (!frame_props.IsOk)
-                return null;
-
-            var locals = frame_props.Value["result"];
-            // FIXME: Should be done when generating the list in library_mono.js, but not sure yet
-            //        whether to remove it, and how to do it correctly.
-            if (locals is JArray)
-            {
-                foreach (var p in locals)
-                {
-                    if (p["name"]?.Value<string>() == "length" && p["enumerable"]?.Value<bool>() != true)
-                    {
-                        p.Remove();
-                        break;
-                    }
-                }
-            }
-
-            return locals;
-        }
-
-        internal async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true)
-        {
-            var evaluate_req = JObject.FromObject(new
-            {
-                callFrameId = id,
-                expression = expression
-            });
-
-            var res = await ctx.cli.SendCommand("Debugger.evaluateOnCallFrame", evaluate_req, ctx.token);
-            AssertEqual(expect_ok, res.IsOk, $"Debugger.evaluateOnCallFrame ('{expression}', scope: {id}) returned {res.IsOk} instead of {expect_ok}, with Result: {res}");
-            if (res.IsOk)
-                return (res.Value["result"], res);
-
-            return (null, res);
-        }
-
-        internal async Task<Result> SetBreakpoint(string url_key, int line, int column, bool expect_ok = true, bool use_regex = false)
-        {
-            var bp1_req = !use_regex ?
-                JObject.FromObject(new { lineNumber = line, columnNumber = column, url = dicFileToUrl[url_key], }) :
-                JObject.FromObject(new { lineNumber = line, columnNumber = column, urlRegex = url_key, });
-
-            var bp1_res = await ctx.cli.SendCommand("Debugger.setBreakpointByUrl", bp1_req, ctx.token);
-            Assert.True(expect_ok ? bp1_res.IsOk : bp1_res.IsErr);
-
-            return bp1_res;
-        }
-
-        internal async Task<Result> SetPauseOnException(string state)
-        {
-            var exc_res = await ctx.cli.SendCommand("Debugger.setPauseOnExceptions", JObject.FromObject(new { state = state }), ctx.token);
-            return exc_res;
-        }
-
-        internal async Task<Result> SetBreakpointInMethod(string assembly, string type, string method, int lineOffset = 0, int col = 0)
-        {
-            var req = JObject.FromObject(new { assemblyName = assembly, typeName = type, methodName = method, lineOffset = lineOffset });
-
-            // Protocol extension
-            var res = await ctx.cli.SendCommand("DotnetDebugger.getMethodLocation", req, ctx.token);
-            Assert.True(res.IsOk);
-
-            var m_url = res.Value["result"]["url"].Value<string>();
-            var m_line = res.Value["result"]["line"].Value<int>();
-
-            var bp1_req = JObject.FromObject(new
-            {
-                lineNumber = m_line + lineOffset,
-                columnNumber = col,
-                url = m_url
-            });
-
-            res = await ctx.cli.SendCommand("Debugger.setBreakpointByUrl", bp1_req, ctx.token);
-            Assert.True(res.IsOk);
-
-            return res;
-        }
-
-        internal void AssertEqual(object expected, object actual, string label)
-        {
-            if (expected?.Equals(actual) == true)
-                return;
-
-            throw new AssertActualExpectedException(
-                expected, actual,
-                $"[{label}]\n");
-        }
-
-        internal void AssertStartsWith(string expected, string actual, string label) => Assert.True(actual?.StartsWith(expected), $"[{label}] Does not start with the expected string\nExpected: {expected}\nActual:   {actual}");
-
-        internal static Func<int, int, string, string, object> TSimpleClass = (X, Y, Id, Color) => new
-        {
-            X = TNumber(X),
-            Y = TNumber(Y),
-            Id = TString(Id),
-            Color = TEnum("DebuggerTests.RGB", Color),
-            PointWithCustomGetter = TGetter("PointWithCustomGetter")
-        };
-
-        internal static Func<int, int, string, string, object> TPoint = (X, Y, Id, Color) => new
-        {
-            X = TNumber(X),
-            Y = TNumber(Y),
-            Id = TString(Id),
-            Color = TEnum("DebuggerTests.RGB", Color),
-        };
-
-        //FIXME: um maybe we don't need to convert jobject right here!
-        internal static JObject TString(string value) =>
-            value == null ?
-            JObject.FromObject(new { type = "object", className = "string", subtype = "null" }) :
-            JObject.FromObject(new { type = "string", value = @value });
-
-        internal static JObject TNumber(int value) =>
-            JObject.FromObject(new { type = "number", value = @value.ToString(), description = value.ToString() });
-
-        internal static JObject TNumber(uint value) =>
-            JObject.FromObject(new { type = "number", value = @value.ToString(), description = value.ToString() });
-
-        internal static JObject TValueType(string className, string description = null, object members = null) =>
-            JObject.FromObject(new { type = "object", isValueType = true, className = className, description = description ?? className });
-
-        internal static JObject TEnum(string className, string descr, object members = null) =>
-            JObject.FromObject(new { type = "object", isEnum = true, className = className, description = descr });
-
-        internal static JObject TObject(string className, string description = null, bool is_null = false) =>
-            is_null ?
-            JObject.FromObject(new { type = "object", className = className, description = description ?? className, subtype = is_null ? "null" : null }) :
-            JObject.FromObject(new { type = "object", className = className, description = description ?? className });
-
-        internal static JObject TArray(string className, int length = 0) => JObject.FromObject(new { type = "object", className = className, description = $"{className}({length})", subtype = "array" });
-
-        internal static JObject TBool(bool value) => JObject.FromObject(new { type = "boolean", value = @value, description = @value ? "true" : "false" });
-
-        internal static JObject TSymbol(string value) => JObject.FromObject(new { type = "symbol", value = @value, description = @value });
-
-        /*
-        	For target names with generated method names like
-        		`void <ActionTSignatureTest>b__11_0 (Math.GenericStruct<int[]>)`
-
-        	.. pass target "as `target: "void <ActionTSignatureTest>|(Math.GenericStruct<int[]>)"`
-        */
-        internal static JObject TDelegate(string className, string target) => JObject.FromObject(new
-        {
-            __custom_type = "delegate",
-            className = className,
-            target = target
-        });
-
-        internal static JObject TPointer(string type_name, bool is_null = false) => JObject.FromObject(new { __custom_type = "pointer", type_name = type_name, is_null = is_null, is_void = type_name.StartsWith("void*") });
-
-        internal static JObject TIgnore() => JObject.FromObject(new { __custom_type = "ignore_me" });
-
-        internal static JObject TGetter(string type) => JObject.FromObject(new { __custom_type = "getter", type_name = type });
-
-        internal static JObject TDateTime(DateTime dt) => JObject.FromObject(new
-        {
-            __custom_type = "datetime",
-            binary = dt.ToBinary()
-        });
-    }
-
-    class DebugTestContext
-    {
-        public InspectorClient cli;
-        public Inspector insp;
-        public CancellationToken token;
-        public Dictionary<string, string> scripts;
-
-        public bool UseCallFunctionOnBeforeGetProperties;
-
-        public DebugTestContext(InspectorClient cli, Inspector insp, CancellationToken token, Dictionary<string, string> scripts)
-        {
-            this.cli = cli;
-            this.insp = insp;
-            this.token = token;
-            this.scripts = scripts;
-        }
-    }
-
-    class DotnetObjectId
-    {
-        public string Scheme { get; }
-        public string Value { get; }
-
-        JObject value_json;
-        public JObject ValueAsJson
-        {
-            get
-            {
-                if (value_json == null)
-                {
-                    try
-                    {
-                        value_json = JObject.Parse(Value);
-                    }
-                    catch (JsonReaderException) { }
-                }
-
-                return value_json;
-            }
-        }
-
-        public static bool TryParse(JToken jToken, out DotnetObjectId objectId) => TryParse(jToken?.Value<string>(), out objectId);
-
-        public static bool TryParse(string id, out DotnetObjectId objectId)
-        {
-            objectId = null;
-            if (id == null)
-            {
-                return false;
-            }
-
-            if (!id.StartsWith("dotnet:"))
-            {
-                return false;
-            }
-
-            var parts = id.Split(":", 3);
-
-            if (parts.Length < 3)
-            {
-                return false;
-            }
-
-            objectId = new DotnetObjectId(parts[1], parts[2]);
-
-            return true;
-        }
-
-        public DotnetObjectId(string scheme, string value)
-        {
-            Scheme = scheme;
-            Value = value;
-        }
-
-        public override string ToString() => $"dotnet:{Scheme}:{Value}";
-    }
-
-    enum StepKind
-    {
-        Into,
-        Over,
-        Out
-    }
-}

+ 0 - 15
sdks/wasm/DebuggerTestSuite/TestHarnessOptions.cs

@@ -1,15 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    public class TestHarnessOptions : ProxyOptions
-    {
-        public string ChromePath { get; set; }
-        public string AppPath { get; set; }
-        public string PagePath { get; set; }
-        public string NodeApp { get; set; }
-    }
-}

+ 0 - 59
sdks/wasm/DebuggerTestSuite/TestHarnessProxy.cs

@@ -1,59 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    public class TestHarnessProxy
-    {
-        static IWebHost host;
-        static Task hostTask;
-        static CancellationTokenSource cts = new CancellationTokenSource();
-        static object proxyLock = new object();
-
-        public static readonly Uri Endpoint = new Uri("http://localhost:9400");
-
-        public static Task Start(string chromePath, string appPath, string pagePath)
-        {
-            lock (proxyLock)
-            {
-                if (host != null)
-                    return hostTask;
-
-                host = WebHost.CreateDefaultBuilder()
-                    .UseSetting("UseIISIntegration", false.ToString())
-                    .ConfigureAppConfiguration((hostingContext, config) =>
-                    {
-                        config.AddEnvironmentVariables(prefix: "WASM_TESTS_");
-                    })
-                    .ConfigureServices((ctx, services) =>
-                    {
-                        services.Configure<TestHarnessOptions>(ctx.Configuration);
-                        services.Configure<TestHarnessOptions>(options =>
-                        {
-                            options.ChromePath = options.ChromePath ?? chromePath;
-                            options.AppPath = appPath;
-                            options.PagePath = pagePath;
-                            options.DevToolsUrl = new Uri("http://localhost:0");
-                        });
-                    })
-                    .UseStartup<TestHarnessStartup>()
-                    .UseUrls(Endpoint.ToString())
-                    .Build();
-                hostTask = host.StartAsync(cts.Token);
-            }
-
-            Console.WriteLine("WebServer Ready!");
-            return hostTask;
-        }
-    }
-}

+ 0 - 255
sdks/wasm/DebuggerTestSuite/TestHarnessStartup.cs

@@ -1,255 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Net.Http;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Routing;
-using Microsoft.AspNetCore.StaticFiles;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.FileProviders;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.WebAssembly.Diagnostics
-{
-    public class TestHarnessStartup
-    {
-        static Regex parseConnection = new Regex(@"listening on (ws?s://[^\s]*)");
-        public TestHarnessStartup(IConfiguration configuration)
-        {
-            Configuration = configuration;
-        }
-
-        public IConfiguration Configuration { get; set; }
-
-        // This method gets called by the runtime. Use this method to add services to the container.
-        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
-        public void ConfigureServices(IServiceCollection services)
-        {
-            services.AddRouting()
-                .Configure<TestHarnessOptions>(Configuration);
-        }
-
-        async Task SendNodeVersion(HttpContext context)
-        {
-            Console.WriteLine("hello chrome! json/version");
-            var resp_obj = new JObject();
-            resp_obj["Browser"] = "node.js/v9.11.1";
-            resp_obj["Protocol-Version"] = "1.1";
-
-            var response = resp_obj.ToString();
-            await context.Response.WriteAsync(response, new CancellationTokenSource().Token);
-        }
-
-        async Task SendNodeList(HttpContext context)
-        {
-            Console.WriteLine("hello chrome! json/list");
-            try
-            {
-                var response = new JArray(JObject.FromObject(new
-                {
-                    description = "node.js instance",
-                    devtoolsFrontendUrl = "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:9300/91d87807-8a81-4f49-878c-a5604103b0a4",
-                    faviconUrl = "https://nodejs.org/static/favicon.ico",
-                    id = "91d87807-8a81-4f49-878c-a5604103b0a4",
-                    title = "foo.js",
-                    type = "node",
-                    webSocketDebuggerUrl = "ws://localhost:9300/91d87807-8a81-4f49-878c-a5604103b0a4"
-                })).ToString();
-
-                Console.WriteLine($"sending: {response}");
-                await context.Response.WriteAsync(response, new CancellationTokenSource().Token);
-            }
-            catch (Exception e) { Console.WriteLine(e); }
-        }
-
-        public async Task LaunchAndServe(ProcessStartInfo psi, HttpContext context, Func<string, Task<string>> extract_conn_url)
-        {
-
-            if (!context.WebSockets.IsWebSocketRequest)
-            {
-                context.Response.StatusCode = 400;
-                return;
-            }
-
-            var tcs = new TaskCompletionSource<string>();
-
-            var proc = Process.Start(psi);
-            try
-            {
-                proc.ErrorDataReceived += (sender, e) =>
-                {
-                    var str = e.Data;
-                    Console.WriteLine($"stderr: {str}");
-
-                    if (tcs.Task.IsCompleted)
-                        return;
-
-                    var match = parseConnection.Match(str);
-                    if (match.Success)
-                    {
-                        tcs.TrySetResult(match.Groups[1].Captures[0].Value);
-                    }
-                };
-
-                proc.OutputDataReceived += (sender, e) =>
-                {
-                    Console.WriteLine($"stdout: {e.Data}");
-                };
-
-                proc.BeginErrorReadLine();
-                proc.BeginOutputReadLine();
-
-                if (await Task.WhenAny(tcs.Task, Task.Delay(5000)) != tcs.Task)
-                {
-                    Console.WriteLine("Didnt get the con string after 5s.");
-                    throw new Exception("node.js timedout");
-                }
-                var line = await tcs.Task;
-                var con_str = extract_conn_url != null ? await extract_conn_url(line) : line;
-
-                Console.WriteLine($"launching proxy for {con_str}");
-
-                using var loggerFactory = LoggerFactory.Create(
-                    builder => builder.AddConsole().AddFilter(null, LogLevel.Information));
-                var proxy = new DebuggerProxy(loggerFactory);
-                var browserUri = new Uri(con_str);
-                var ideSocket = await context.WebSockets.AcceptWebSocketAsync();
-
-                await proxy.Run(browserUri, ideSocket);
-                Console.WriteLine("Proxy done");
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("got exception {0}", e);
-            }
-            finally
-            {
-                proc.CancelErrorRead();
-                proc.CancelOutputRead();
-                proc.Kill();
-                proc.WaitForExit();
-                proc.Close();
-            }
-        }
-
-        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
-        public void Configure(IApplicationBuilder app, IOptionsMonitor<TestHarnessOptions> optionsAccessor, IWebHostEnvironment env)
-        {
-            app.UseWebSockets();
-            app.UseStaticFiles();
-
-            TestHarnessOptions options = optionsAccessor.CurrentValue;
-
-            var provider = new FileExtensionContentTypeProvider();
-            provider.Mappings[".wasm"] = "application/wasm";
-
-            app.UseStaticFiles(new StaticFileOptions
-            {
-                FileProvider = new PhysicalFileProvider(options.AppPath),
-                ServeUnknownFileTypes = true, //Cuz .wasm is not a known file type :cry:
-                RequestPath = "",
-                ContentTypeProvider = provider
-            });
-
-            var devToolsUrl = options.DevToolsUrl;
-            app.UseRouter(router =>
-            {
-                router.MapGet("launch-chrome-and-connect", async context =>
-                {
-                    Console.WriteLine("New test request");
-                    try
-                    {
-                        var client = new HttpClient();
-                        var psi = new ProcessStartInfo();
-
-                        psi.Arguments = $"--headless --disable-gpu --lang=en-US --incognito --remote-debugging-port={devToolsUrl.Port} http://{TestHarnessProxy.Endpoint.Authority}/{options.PagePath}";
-                        psi.UseShellExecute = false;
-                        psi.FileName = options.ChromePath;
-                        psi.RedirectStandardError = true;
-                        psi.RedirectStandardOutput = true;
-
-                        await LaunchAndServe(psi, context, async (str) =>
-                        {
-                            var start = DateTime.Now;
-                            JArray obj = null;
-
-                            while (true)
-                            {
-                                // Unfortunately it does look like we have to wait
-                                // for a bit after getting the response but before
-                                // making the list request.  We get an empty result
-                                // if we make the request too soon.
-                                await Task.Delay(100);
-
-                                var res = await client.GetStringAsync(new Uri(new Uri(str), "/json/list"));
-                                Console.WriteLine("res is {0}", res);
-
-                                if (!String.IsNullOrEmpty(res))
-                                {
-                                    // Sometimes we seem to get an empty array `[ ]`
-                                    obj = JArray.Parse(res);
-                                    if (obj != null && obj.Count >= 1)
-                                        break;
-                                }
-
-                                var elapsed = DateTime.Now - start;
-                                if (elapsed.Milliseconds > 5000)
-                                {
-                                    Console.WriteLine($"Unable to get DevTools /json/list response in {elapsed.Seconds} seconds, stopping");
-                                    return null;
-                                }
-                            }
-
-                            var wsURl = obj[0]?["webSocketDebuggerUrl"]?.Value<string>();
-                            Console.WriteLine(">>> {0}", wsURl);
-
-                            return wsURl;
-                        });
-                    }
-                    catch (Exception ex)
-                    {
-                        Console.WriteLine($"launch-chrome-and-connect failed with {ex.ToString()}");
-                    }
-                });
-            });
-
-            if (options.NodeApp != null)
-            {
-                Console.WriteLine($"Doing the nodejs: {options.NodeApp}");
-                var nodeFullPath = Path.GetFullPath(options.NodeApp);
-                Console.WriteLine(nodeFullPath);
-                var psi = new ProcessStartInfo();
-
-                psi.UseShellExecute = false;
-                psi.RedirectStandardError = true;
-                psi.RedirectStandardOutput = true;
-
-                psi.Arguments = $"--inspect-brk=localhost:0 {nodeFullPath}";
-                psi.FileName = "node";
-
-                app.UseRouter(router =>
-                {
-                    //Inspector API for using chrome devtools directly
-                    router.MapGet("json", SendNodeList);
-                    router.MapGet("json/list", SendNodeList);
-                    router.MapGet("json/version", SendNodeVersion);
-                    router.MapGet("launch-done-and-connect", async context =>
-                    {
-                        await LaunchAndServe(psi, context, null);
-                    });
-                });
-            }
-        }
-    }
-}

+ 0 - 1528
sdks/wasm/DebuggerTestSuite/Tests.cs

@@ -1,1528 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
-
-namespace DebuggerTests
-{
-
-    public class SourceList : DebuggerTestBase
-    {
-
-        [Fact]
-        public async Task CheckThatAllSourcesAreSent()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            //all sources are sent before runtime ready is sent, nothing to check
-            await insp.Ready();
-            Assert.Contains("dotnet://debugger-test.dll/debugger-test.cs", scripts.Values);
-            Assert.Contains("dotnet://debugger-test.dll/debugger-test2.cs", scripts.Values);
-            Assert.Contains("dotnet://debugger-test.dll/dependency.cs", scripts.Values);
-        }
-
-        [Fact]
-        public async Task CreateGoodBreakpoint()
-        {
-            var insp = new Inspector();
-
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var bp1_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8);
-
-                Assert.EndsWith("debugger-test.cs", bp1_res.Value["breakpointId"].ToString());
-                Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count);
-
-                var loc = bp1_res.Value["locations"]?.Value<JArray>()[0];
-
-                Assert.NotNull(loc["scriptId"]);
-                Assert.Equal("dotnet://debugger-test.dll/debugger-test.cs", scripts[loc["scriptId"]?.Value<string>()]);
-                Assert.Equal(10, loc["lineNumber"]);
-                Assert.Equal(8, loc["columnNumber"]);
-            });
-        }
-
-        [Fact]
-        public async Task CreateJSBreakpoint()
-        {
-            // Test that js breakpoints get set correctly
-            var insp = new Inspector();
-
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                // 13 24
-                // 13 31
-                var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 24);
-
-                Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString());
-                Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count);
-
-                var loc = bp1_res.Value["locations"]?.Value<JArray>()[0];
-
-                Assert.NotNull(loc["scriptId"]);
-                Assert.Equal(13, loc["lineNumber"]);
-                Assert.Equal(24, loc["columnNumber"]);
-
-                var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 31);
-
-                Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString());
-                Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count);
-
-                var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0];
-
-                Assert.NotNull(loc2["scriptId"]);
-                Assert.Equal(13, loc2["lineNumber"]);
-                Assert.Equal(31, loc2["columnNumber"]);
-            });
-        }
-
-        [Fact]
-        public async Task CreateJS0Breakpoint()
-        {
-            // Test that js column 0 does as expected
-            var insp = new Inspector();
-
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                // 13 24
-                // 13 31
-                var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 0);
-
-                Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString());
-                Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count);
-
-                var loc = bp1_res.Value["locations"]?.Value<JArray>()[0];
-
-                Assert.NotNull(loc["scriptId"]);
-                Assert.Equal(13, loc["lineNumber"]);
-                Assert.Equal(24, loc["columnNumber"]);
-
-                var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 31);
-
-                Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString());
-                Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count);
-
-                var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0];
-
-                Assert.NotNull(loc2["scriptId"]);
-                Assert.Equal(13, loc2["lineNumber"]);
-                Assert.Equal(31, loc2["columnNumber"]);
-            });
-        }
-
-        [Theory]
-        [InlineData(0)]
-        [InlineData(50)]
-        public async Task CheckMultipleBreakpointsOnSameLine(int col)
-        {
-            var insp = new Inspector();
-
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var bp1_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-array-test.cs", 219, col);
-                Assert.EndsWith("debugger-array-test.cs", bp1_res.Value["breakpointId"].ToString());
-                Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count);
-
-                var loc = bp1_res.Value["locations"]?.Value<JArray>()[0];
-
-                CheckLocation("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 50, scripts, loc);
-
-                var bp2_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 55);
-                Assert.EndsWith("debugger-array-test.cs", bp2_res.Value["breakpointId"].ToString());
-                Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count);
-
-                var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0];
-
-                CheckLocation("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 55, scripts, loc2);
-            });
-        }
-
-        [Fact]
-        public async Task CreateBadBreakpoint()
-        {
-            var insp = new Inspector();
-
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                var bp1_req = JObject.FromObject(new
-                {
-                    lineNumber = 8,
-                    columnNumber = 2,
-                    url = "dotnet://debugger-test.dll/this-file-doesnt-exist.cs",
-                });
-
-                var bp1_res = await cli.SendCommand("Debugger.setBreakpointByUrl", bp1_req, token);
-
-                Assert.True(bp1_res.IsOk);
-                Assert.Empty(bp1_res.Value["locations"].Values<object>());
-                //Assert.Equal ((int)MonoErrorCodes.BpNotFound, bp1_res.Error ["code"]?.Value<int> ());
-            });
-        }
-
-        [Fact]
-        public async Task CreateGoodBreakpointAndHit()
-        {
-            var insp = new Inspector();
-
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8);
-
-                var eval_req = JObject.FromObject(new
-                {
-                    expression = "window.setTimeout(function() { invoke_add(); }, 1);",
-                });
-
-                await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_add(); }, 1);",
-                    "dotnet://debugger-test.dll/debugger-test.cs", 10, 8,
-                    "IntAdd",
-                    wait_for_event_fn: (pause_location) =>
-                    {
-                        Assert.Equal("other", pause_location["reason"]?.Value<string>());
-                        Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
-
-                        var top_frame = pause_location["callFrames"][0];
-                        Assert.Equal("IntAdd", top_frame["functionName"].Value<string>());
-                        Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>());
-
-                        CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]);
-
-                        //now check the scope
-                        var scope = top_frame["scopeChain"][0];
-                        Assert.Equal("local", scope["type"]);
-                        Assert.Equal("IntAdd", scope["name"]);
-
-                        Assert.Equal("object", scope["object"]["type"]);
-                        Assert.Equal("dotnet:scope:0", scope["object"]["objectId"]);
-                        CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]);
-                        CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]);
-                        return Task.CompletedTask;
-                    }
-                );
-
-            });
-        }
-
-        [Fact]
-        public async Task ExceptionThrownInJS()
-        {
-            var insp = new Inspector();
-
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                var eval_req = JObject.FromObject(new
-                {
-                    expression = "invoke_bad_js_test();"
-                });
-
-                var eval_res = await cli.SendCommand("Runtime.evaluate", eval_req, token);
-                Assert.True(eval_res.IsErr);
-                Assert.Equal("Uncaught", eval_res.Error["exceptionDetails"]?["text"]?.Value<string>());
-            });
-        }
-
-        [Fact]
-        public async Task ExceptionThrownInJSOutOfBand()
-        {
-            var insp = new Inspector();
-
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                await SetBreakpoint("/debugger-driver.html", 27, 2);
-
-                var eval_req = JObject.FromObject(new
-                {
-                    expression = "window.setTimeout(function() { invoke_bad_js_test(); }, 1);",
-                });
-
-                var eval_res = await cli.SendCommand("Runtime.evaluate", eval_req, token);
-                // Response here will be the id for the timer from JS!
-                Assert.True(eval_res.IsOk);
-
-                var ex = await Assert.ThrowsAsync<ArgumentException>(async () => await insp.WaitFor("Runtime.exceptionThrown"));
-                var ex_json = JObject.Parse(ex.Message);
-                Assert.Equal(dicFileToUrl["/debugger-driver.html"], ex_json["exceptionDetails"]?["url"]?.Value<string>());
-            });
-
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsAtBreakpointSite(bool use_cfo) =>
-            await CheckInspectLocalsAtBreakpointSite(
-                "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd",
-                "window.setTimeout(function() { invoke_add(); }, 1);",
-                use_cfo: use_cfo,
-                test_fn: (locals) =>
-                {
-                    CheckNumber(locals, "a", 10);
-                    CheckNumber(locals, "b", 20);
-                    CheckNumber(locals, "c", 30);
-                    CheckNumber(locals, "d", 0);
-                    CheckNumber(locals, "e", 0);
-                }
-            );
-
-        [Fact]
-        public async Task InspectPrimitiveTypeLocalsAtBreakpointSite() =>
-            await CheckInspectLocalsAtBreakpointSite(
-                "dotnet://debugger-test.dll/debugger-test.cs", 154, 8, "PrimitiveTypesTest",
-                "window.setTimeout(function() { invoke_static_method ('[debugger-test] Math:PrimitiveTypesTest'); }, 1);",
-                test_fn: (locals) =>
-                {
-                    CheckSymbol(locals, "c0", "8364 '€'");
-                    CheckSymbol(locals, "c1", "65 'A'");
-                }
-            );
-
-        [Fact]
-        public async Task InspectLocalsTypesAtBreakpointSite() =>
-            await CheckInspectLocalsAtBreakpointSite(
-                "dotnet://debugger-test.dll/debugger-test2.cs", 48, 8, "Types",
-                "window.setTimeout(function() { invoke_static_method (\"[debugger-test] Fancy:Types\")(); }, 1);",
-                use_cfo: false,
-                test_fn: (locals) =>
-                {
-                    CheckNumber(locals, "dPI", Math.PI);
-                    CheckNumber(locals, "fPI", (float)Math.PI);
-                    CheckNumber(locals, "iMax", int.MaxValue);
-                    CheckNumber(locals, "iMin", int.MinValue);
-                    CheckNumber(locals, "uiMax", uint.MaxValue);
-                    CheckNumber(locals, "uiMin", uint.MinValue);
-
-                    CheckNumber(locals, "l", uint.MaxValue * (long)2);
-                    //CheckNumber (locals, "lMax", long.MaxValue); // cannot be represented as double
-                    //CheckNumber (locals, "lMin", long.MinValue); // cannot be represented as double
-
-                    CheckNumber(locals, "sbMax", sbyte.MaxValue);
-                    CheckNumber(locals, "sbMin", sbyte.MinValue);
-                    CheckNumber(locals, "bMax", byte.MaxValue);
-                    CheckNumber(locals, "bMin", byte.MinValue);
-
-                    CheckNumber(locals, "sMax", short.MaxValue);
-                    CheckNumber(locals, "sMin", short.MinValue);
-                    CheckNumber(locals, "usMin", ushort.MinValue);
-                    CheckNumber(locals, "usMax", ushort.MaxValue);
-                }
-            );
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsWithGenericTypesAtBreakpointSite(bool use_cfo) =>
-            await CheckInspectLocalsAtBreakpointSite(
-                "dotnet://debugger-test.dll/debugger-test.cs", 74, 8, "GenericTypesTest",
-                "window.setTimeout(function() { invoke_generic_types_test (); }, 1);",
-                use_cfo: use_cfo,
-                test_fn: (locals) =>
-                {
-                    CheckObject(locals, "list", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>");
-                    CheckObject(locals, "list_null", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>", is_null: true);
-
-                    CheckArray(locals, "list_arr", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>[]", 1);
-                    CheckObject(locals, "list_arr_null", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>[]", is_null: true);
-
-                    // Unused locals
-                    CheckObject(locals, "list_unused", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>");
-                    CheckObject(locals, "list_null_unused", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>", is_null: true);
-
-                    CheckArray(locals, "list_arr_unused", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>[]", 1);
-                    CheckObject(locals, "list_arr_null_unused", "System.Collections.Generic.Dictionary<Math[], Math.IsMathNull>[]", is_null: true);
-                }
-            );
-
-        object TGenericStruct(string typearg, string stringField) => new
-        {
-            List = TObject($"System.Collections.Generic.List<{typearg}>"),
-            StringField = TString(stringField)
-        };
-
-        [Fact]
-        public async Task RuntimeGetPropertiesWithInvalidScopeIdTest()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 49, 8);
-
-                await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_delegates_test (); }, 1);",
-                    "dotnet://debugger-test.dll/debugger-test.cs", 49, 8,
-                    "DelegatesTest",
-                    wait_for_event_fn: async (pause_location) =>
-                   {
-                       //make sure we're on the right bp
-                       Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
-
-                       var top_frame = pause_location["callFrames"][0];
-
-                       var scope = top_frame["scopeChain"][0];
-                       Assert.Equal("dotnet:scope:0", scope["object"]["objectId"]);
-
-                       // Try to get an invalid scope!
-                       var get_prop_req = JObject.FromObject(new
-                       {
-                           objectId = "dotnet:scope:23490871",
-                       });
-
-                       var frame_props = await cli.SendCommand("Runtime.getProperties", get_prop_req, token);
-                       Assert.True(frame_props.IsErr);
-                   }
-                );
-            });
-        }
-
-        [Fact]
-        public async Task TrivalStepping()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8);
-
-                await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_add(); }, 1);",
-                    "dotnet://debugger-test.dll/debugger-test.cs", 10, 8,
-                    "IntAdd",
-                    wait_for_event_fn: (pause_location) =>
-                    {
-                        //make sure we're on the right bp
-                        Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
-
-                        var top_frame = pause_location["callFrames"][0];
-                        CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]);
-                        return Task.CompletedTask;
-                    }
-                );
-
-                await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 11, 8, "IntAdd",
-                    wait_for_event_fn: (pause_location) =>
-                    {
-                        var top_frame = pause_location["callFrames"][0];
-                        CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]);
-                        return Task.CompletedTask;
-                    }
-                );
-            });
-        }
-
-        [Fact]
-        public async Task InspectLocalsDuringStepping()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-test.cs";
-                await SetBreakpoint(debugger_test_loc, 10, 8);
-
-                await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_add(); }, 1);",
-                    debugger_test_loc, 10, 8, "IntAdd",
-                    locals_fn: (locals) =>
-                    {
-                        CheckNumber(locals, "a", 10);
-                        CheckNumber(locals, "b", 20);
-                        CheckNumber(locals, "c", 30);
-                        CheckNumber(locals, "d", 0);
-                        CheckNumber(locals, "e", 0);
-                    }
-                );
-
-                await StepAndCheck(StepKind.Over, debugger_test_loc, 11, 8, "IntAdd",
-                    locals_fn: (locals) =>
-                    {
-                        CheckNumber(locals, "a", 10);
-                        CheckNumber(locals, "b", 20);
-                        CheckNumber(locals, "c", 30);
-                        CheckNumber(locals, "d", 50);
-                        CheckNumber(locals, "e", 0);
-                    }
-                );
-
-                //step and get locals
-                await StepAndCheck(StepKind.Over, debugger_test_loc, 12, 8, "IntAdd",
-                    locals_fn: (locals) =>
-                    {
-                        CheckNumber(locals, "a", 10);
-                        CheckNumber(locals, "b", 20);
-                        CheckNumber(locals, "c", 30);
-                        CheckNumber(locals, "d", 50);
-                        CheckNumber(locals, "e", 60);
-                    }
-                );
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsInPreviousFramesDuringSteppingIn2(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-
-                var dep_cs_loc = "dotnet://debugger-test.dll/dependency.cs";
-                await SetBreakpoint(dep_cs_loc, 33, 8);
-
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-test.cs";
-
-                // Will stop in Complex.DoEvenMoreStuff
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_use_complex (); }, 1);",
-                    dep_cs_loc, 33, 8, "DoEvenMoreStuff",
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Single(locals);
-                        CheckObject(locals, "this", "Simple.Complex");
-                    }
-                );
-
-                var props = await GetObjectOnFrame(pause_location["callFrames"][0], "this");
-                Assert.Equal(3, props.Count());
-                CheckNumber(props, "A", 10);
-                CheckString(props, "B", "xx");
-                CheckObject(props, "c", "object");
-
-                // Check UseComplex frame
-                var locals_m1 = await GetLocalsForFrame(pause_location["callFrames"][3], debugger_test_loc, 23, 8, "UseComplex");
-                Assert.Equal(7, locals_m1.Count());
-
-                CheckNumber(locals_m1, "a", 10);
-                CheckNumber(locals_m1, "b", 20);
-                CheckObject(locals_m1, "complex", "Simple.Complex");
-                CheckNumber(locals_m1, "c", 30);
-                CheckNumber(locals_m1, "d", 50);
-                CheckNumber(locals_m1, "e", 60);
-                CheckNumber(locals_m1, "f", 0);
-
-                props = await GetObjectOnFrame(pause_location["callFrames"][3], "complex");
-                Assert.Equal(3, props.Count());
-                CheckNumber(props, "A", 10);
-                CheckString(props, "B", "xx");
-                CheckObject(props, "c", "object");
-
-                pause_location = await StepAndCheck(StepKind.Over, dep_cs_loc, 23, 8, "DoStuff", times: 2);
-                // Check UseComplex frame again
-                locals_m1 = await GetLocalsForFrame(pause_location["callFrames"][1], debugger_test_loc, 23, 8, "UseComplex");
-                Assert.Equal(7, locals_m1.Count());
-
-                CheckNumber(locals_m1, "a", 10);
-                CheckNumber(locals_m1, "b", 20);
-                CheckObject(locals_m1, "complex", "Simple.Complex");
-                CheckNumber(locals_m1, "c", 30);
-                CheckNumber(locals_m1, "d", 50);
-                CheckNumber(locals_m1, "e", 60);
-                CheckNumber(locals_m1, "f", 0);
-
-                props = await GetObjectOnFrame(pause_location["callFrames"][1], "complex");
-                Assert.Equal(3, props.Count());
-                CheckNumber(props, "A", 10);
-                CheckString(props, "B", "xx");
-                CheckObject(props, "c", "object");
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsInPreviousFramesDuringSteppingIn(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-test.cs";
-                await SetBreakpoint(debugger_test_loc, 111, 12);
-
-                // Will stop in InnerMethod
-                var wait_res = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_outer_method(); }, 1);",
-                    debugger_test_loc, 111, 12, "InnerMethod",
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(4, locals.Count());
-                        CheckNumber(locals, "i", 5);
-                        CheckNumber(locals, "j", 24);
-                        CheckString(locals, "foo_str", "foo");
-                        CheckObject(locals, "this", "Math.NestedInMath");
-                    }
-                );
-
-                var this_props = await GetObjectOnFrame(wait_res["callFrames"][0], "this");
-                Assert.Equal(2, this_props.Count());
-                CheckObject(this_props, "m", "Math");
-                CheckValueType(this_props, "SimpleStructProperty", "Math.SimpleStruct");
-
-                var ss_props = await GetObjectOnLocals(this_props, "SimpleStructProperty");
-                var dt = new DateTime(2020, 1, 2, 3, 4, 5);
-                await CheckProps(ss_props, new
-                {
-                    dt = TValueType("System.DateTime", dt.ToString()),
-                    gs = TValueType("Math.GenericStruct<System.DateTime>")
-                }, "ss_props");
-
-                await CheckDateTime(ss_props, "dt", new DateTime(2020, 1, 2, 3, 4, 5));
-
-                // Check OuterMethod frame
-                var locals_m1 = await GetLocalsForFrame(wait_res["callFrames"][1], debugger_test_loc, 87, 8, "OuterMethod");
-                Assert.Equal(5, locals_m1.Count());
-                // FIXME: Failing test CheckNumber (locals_m1, "i", 5);
-                // FIXME: Failing test CheckString (locals_m1, "text", "Hello");
-                CheckNumber(locals_m1, "new_i", 0);
-                CheckNumber(locals_m1, "k", 0);
-                CheckObject(locals_m1, "nim", "Math.NestedInMath");
-
-                // step back into OuterMethod
-                await StepAndCheck(StepKind.Over, debugger_test_loc, 91, 8, "OuterMethod", times: 9,
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(5, locals.Count());
-
-                        // FIXME: Failing test CheckNumber (locals_m1, "i", 5);
-                        CheckString(locals, "text", "Hello");
-                        // FIXME: Failing test CheckNumber (locals, "new_i", 24);
-                        CheckNumber(locals, "k", 19);
-                        CheckObject(locals, "nim", "Math.NestedInMath");
-                    }
-                );
-
-                //await StepAndCheck (StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 81, 2, "OuterMethod", times: 2);
-
-                // step into InnerMethod2
-                await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 96, 4, "InnerMethod2",
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(3, locals.Count());
-
-                        CheckString(locals, "s", "test string");
-                        //out var: CheckNumber (locals, "k", 0);
-                        CheckNumber(locals, "i", 24);
-                    }
-                );
-
-                await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 100, 4, "InnerMethod2", times: 4,
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(3, locals.Count());
-
-                        CheckString(locals, "s", "test string");
-                        // FIXME: Failing test CheckNumber (locals, "k", 34);
-                        CheckNumber(locals, "i", 24);
-                    }
-                );
-
-                await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 92, 8, "OuterMethod", times: 2,
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(5, locals.Count());
-
-                        CheckString(locals, "text", "Hello");
-                        // FIXME: failing test CheckNumber (locals, "i", 5);
-                        CheckNumber(locals, "new_i", 22);
-                        CheckNumber(locals, "k", 34);
-                        CheckObject(locals, "nim", "Math.NestedInMath");
-                    }
-                );
-            });
-        }
-
-        [Fact]
-        public async Task InspectLocalsDuringSteppingIn()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 86, 8);
-
-                await EvaluateAndCheck("window.setTimeout(function() { invoke_outer_method(); }, 1);",
-                    "dotnet://debugger-test.dll/debugger-test.cs", 86, 8, "OuterMethod",
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(5, locals.Count());
-
-                        CheckObject(locals, "nim", "Math.NestedInMath");
-                        CheckNumber(locals, "i", 5);
-                        CheckNumber(locals, "k", 0);
-                        CheckNumber(locals, "new_i", 0);
-                        CheckString(locals, "text", null);
-                    }
-                );
-
-                await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 87, 8, "OuterMethod",
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(5, locals.Count());
-
-                        CheckObject(locals, "nim", "Math.NestedInMath");
-                        // FIXME: Failing test CheckNumber (locals, "i", 5);
-                        CheckNumber(locals, "k", 0);
-                        CheckNumber(locals, "new_i", 0);
-                        CheckString(locals, "text", "Hello");
-                    }
-                );
-
-                // Step into InnerMethod
-                await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 105, 8, "InnerMethod");
-                await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 109, 12, "InnerMethod", times: 5,
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(4, locals.Count());
-
-                        CheckNumber(locals, "i", 5);
-                        CheckNumber(locals, "j", 15);
-                        CheckString(locals, "foo_str", "foo");
-                        CheckObject(locals, "this", "Math.NestedInMath");
-                    }
-                );
-
-                // Step back to OuterMethod
-                await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 88, 8, "OuterMethod", times: 6,
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(5, locals.Count());
-
-                        CheckObject(locals, "nim", "Math.NestedInMath");
-                        // FIXME: Failing test CheckNumber (locals, "i", 5);
-                        CheckNumber(locals, "k", 0);
-                        CheckNumber(locals, "new_i", 24);
-                        CheckString(locals, "text", "Hello");
-                    }
-                );
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsInAsyncMethods(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, 120, 12);
-                await SetBreakpoint(debugger_test_loc, 135, 12);
-
-                // Will stop in Asyncmethod0
-                var wait_res = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_async_method_with_await(); }, 1);",
-                    debugger_test_loc, 120, 12, "MoveNext", //FIXME:
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(4, locals.Count());
-                        CheckString(locals, "s", "string from js");
-                        CheckNumber(locals, "i", 42);
-                        CheckString(locals, "local0", "value0");
-                        CheckObject(locals, "this", "Math.NestedInMath");
-                    }
-                );
-                Console.WriteLine(wait_res);
-
-#if false // Disabled for now, as we don't have proper async traces
-                var locals = await GetProperties(wait_res["callFrames"][2]["callFrameId"].Value<string>());
-                Assert.Equal(4, locals.Count());
-                CheckString(locals, "ls", "string from jstest");
-                CheckNumber(locals, "li", 52);
-#endif
-
-                // TODO: previous frames have async machinery details, so no point checking that right now
-
-                var pause_loc = await SendCommandAndCheck(null, "Debugger.resume", debugger_test_loc, 135, 12, /*FIXME: "AsyncMethodNoReturn"*/ "MoveNext",
-                    locals_fn: (locals) =>
-                    {
-                        Assert.Equal(4, locals.Count());
-                        CheckString(locals, "str", "AsyncMethodNoReturn's local");
-                        CheckObject(locals, "this", "Math.NestedInMath");
-                        //FIXME: check fields
-                        CheckValueType(locals, "ss", "Math.SimpleStruct");
-                        CheckArray(locals, "ss_arr", "Math.SimpleStruct[]", 0);
-                        // TODO: struct fields
-                    }
-                );
-
-                var this_props = await GetObjectOnFrame(pause_loc["callFrames"][0], "this");
-                Assert.Equal(2, this_props.Count());
-                CheckObject(this_props, "m", "Math");
-                CheckValueType(this_props, "SimpleStructProperty", "Math.SimpleStruct");
-
-                // TODO: Check `this` properties
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsWithStructs(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, 24, 8);
-
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_method_with_structs(); }, 1);",
-                    debugger_test_loc, 24, 8, "MethodWithLocalStructs");
-
-                var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                await CheckProps(locals, new
-                {
-                    ss_local = TValueType("DebuggerTests.ValueTypesTest.SimpleStruct"),
-                    gs_local = TValueType("DebuggerTests.ValueTypesTest.GenericStruct<DebuggerTests.ValueTypesTest>"),
-                    vt_local = TObject("DebuggerTests.ValueTypesTest")
-                }, "locals");
-
-                var dt = new DateTime(2021, 2, 3, 4, 6, 7);
-                var vt_local_props = await GetObjectOnFrame(pause_location["callFrames"][0], "vt_local");
-                Assert.Equal(5, vt_local_props.Count());
-
-                CheckString(vt_local_props, "StringField", "string#0");
-                CheckValueType(vt_local_props, "SimpleStructField", "DebuggerTests.ValueTypesTest.SimpleStruct");
-                CheckValueType(vt_local_props, "SimpleStructProperty", "DebuggerTests.ValueTypesTest.SimpleStruct");
-                await CheckDateTime(vt_local_props, "DT", new DateTime(2020, 1, 2, 3, 4, 5));
-                CheckEnum(vt_local_props, "RGB", "DebuggerTests.RGB", "Blue");
-
-                // Check ss_local's properties
-                var ss_local_props = await GetObjectOnFrame(pause_location["callFrames"][0], "ss_local");
-                await CheckProps(ss_local_props, new
-                {
-                    V = TGetter("V"),
-                    str_member = TString("set in MethodWithLocalStructs#SimpleStruct#str_member"),
-                    dt = TValueType("System.DateTime", dt.ToString()),
-                    gs = TValueType("DebuggerTests.ValueTypesTest.GenericStruct<System.DateTime>"),
-                    Kind = TEnum("System.DateTimeKind", "Utc")
-                }, "ss_local");
-
-                {
-                    var gres = await InvokeGetter(GetAndAssertObjectWithName(locals, "ss_local"), "V");
-                    await CheckValue(gres.Value["result"], TNumber(0xDEADBEEF + 2), $"ss_local#V");
-                    // Check ss_local.dt
-                    await CheckDateTime(ss_local_props, "dt", dt);
-
-                    // Check ss_local.gs
-                    var gs_props = await GetObjectOnLocals(ss_local_props, "gs");
-                    CheckString(gs_props, "StringField", "set in MethodWithLocalStructs#SimpleStruct#gs#StringField");
-                    CheckObject(gs_props, "List", "System.Collections.Generic.List<System.DateTime>");
-                }
-
-                // Check gs_local's properties
-                var gs_local_props = await GetObjectOnFrame(pause_location["callFrames"][0], "gs_local");
-                await CheckProps(gs_local_props, new
-                {
-                    StringField = TString("gs_local#GenericStruct<ValueTypesTest>#StringField"),
-                    List = TObject("System.Collections.Generic.List<DebuggerTests.ValueTypesTest>", is_null: true),
-                    Options = TEnum("DebuggerTests.Options", "None")
-                }, "gs_local");
-
-                // Check vt_local's properties
-
-                var exp = new[]
-                {
-                    ("SimpleStructProperty", 2, "Utc"),
-                    ("SimpleStructField", 5, "Local")
-                };
-
-                foreach (var (name, bias, dt_kind) in exp)
-                {
-                    dt = new DateTime(2020 + bias, 1 + bias, 2 + bias, 3 + bias, 5 + bias, 6 + bias);
-                    var ssp_props = await CompareObjectPropertiesFor(vt_local_props, name,
-                        new
-                        {
-                            V = TGetter("V"),
-                            str_member = TString($"{name}#string#0#SimpleStruct#str_member"),
-                            dt = TValueType("System.DateTime", dt.ToString()),
-                            gs = TValueType("DebuggerTests.ValueTypesTest.GenericStruct<System.DateTime>"),
-                            Kind = TEnum("System.DateTimeKind", dt_kind)
-                        },
-                        label: $"vt_local_props.{name}");
-
-                    await CheckDateTime(ssp_props, "dt", dt);
-                    var gres = await InvokeGetter(GetAndAssertObjectWithName(vt_local_props, name), "V");
-                    await CheckValue(gres.Value["result"], TNumber(0xDEADBEEF + (uint)dt.Month), $"{name}#V");
-                }
-
-                // FIXME: check ss_local.gs.List's members
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectValueTypeMethodArgs(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, 36, 12);
-
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ValueTypesTest:TestStructsAsMethodArgs'); }, 1);",
-                    debugger_test_loc, 36, 12, "MethodWithStructArgs");
-                var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                {
-                    Assert.Equal(3, locals.Count());
-                    CheckString(locals, "label", "TestStructsAsMethodArgs#label");
-                    CheckValueType(locals, "ss_arg", "DebuggerTests.ValueTypesTest.SimpleStruct");
-                    CheckNumber(locals, "x", 3);
-                }
-
-                var dt = new DateTime(2025, 6, 7, 8, 10, 11);
-                var ss_local_as_ss_arg = new
-                {
-                    V = TGetter("V"),
-                    str_member = TString("ss_local#SimpleStruct#string#0#SimpleStruct#str_member"),
-                    dt = TValueType("System.DateTime", dt.ToString()),
-                    gs = TValueType("DebuggerTests.ValueTypesTest.GenericStruct<System.DateTime>"),
-                    Kind = TEnum("System.DateTimeKind", "Local")
-                };
-                var ss_local_gs = new
-                {
-                    StringField = TString("ss_local#SimpleStruct#string#0#SimpleStruct#gs#StringField"),
-                    List = TObject("System.Collections.Generic.List<System.DateTime>"),
-                    Options = TEnum("DebuggerTests.Options", "Option1")
-                };
-
-                // Check ss_arg's properties
-                var ss_arg_props = await GetObjectOnFrame(pause_location["callFrames"][0], "ss_arg");
-                await CheckProps(ss_arg_props, ss_local_as_ss_arg, "ss_arg");
-
-                var res = await InvokeGetter(GetAndAssertObjectWithName(locals, "ss_arg"), "V");
-                await CheckValue(res.Value["result"], TNumber(0xDEADBEEF + (uint)dt.Month), "ss_arg#V");
-
-                {
-                    // Check ss_local.dt
-                    await CheckDateTime(ss_arg_props, "dt", dt);
-
-                    // Check ss_local.gs
-                    await CompareObjectPropertiesFor(ss_arg_props, "gs", ss_local_gs);
-                }
-
-                pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 40, 8, "MethodWithStructArgs", times: 4,
-                    locals_fn: (l) => { /* non-null to make sure that locals get fetched */ });
-                locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                {
-                    Assert.Equal(3, locals.Count());
-
-                    CheckString(locals, "label", "TestStructsAsMethodArgs#label");
-                    CheckValueType(locals, "ss_arg", "DebuggerTests.ValueTypesTest.SimpleStruct");
-                    CheckNumber(locals, "x", 3);
-                }
-
-                var ss_arg_updated = new
-                {
-                    V = TGetter("V"),
-                    str_member = TString("ValueTypesTest#MethodWithStructArgs#updated#ss_arg#str_member"),
-                    dt = TValueType("System.DateTime", dt.ToString()),
-                    gs = TValueType("DebuggerTests.ValueTypesTest.GenericStruct<System.DateTime>"),
-                    Kind = TEnum("System.DateTimeKind", "Utc")
-                };
-
-                ss_arg_props = await GetObjectOnFrame(pause_location["callFrames"][0], "ss_arg");
-                await CheckProps(ss_arg_props, ss_arg_updated, "ss_arg");
-
-                res = await InvokeGetter(GetAndAssertObjectWithName(locals, "ss_arg"), "V");
-                await CheckValue(res.Value["result"], TNumber(0xDEADBEEF + (uint)dt.Month), "ss_arg#V");
-
-                {
-                    // Check ss_local.gs
-                    await CompareObjectPropertiesFor(ss_arg_props, "gs", new
-                    {
-                        StringField = TString("ValueTypesTest#MethodWithStructArgs#updated#gs#StringField#3"),
-                        List = TObject("System.Collections.Generic.List<System.DateTime>"),
-                        Options = TEnum("DebuggerTests.Options", "Option1")
-                    });
-
-                    await CheckDateTime(ss_arg_props, "dt", dt);
-                }
-
-                // Check locals on previous frame, same as earlier in this test
-                ss_arg_props = await GetObjectOnFrame(pause_location["callFrames"][1], "ss_local");
-                await CheckProps(ss_arg_props, ss_local_as_ss_arg, "ss_local");
-
-                {
-                    // Check ss_local.dt
-                    await CheckDateTime(ss_arg_props, "dt", dt);
-
-                    // Check ss_local.gs
-                    var gs_props = await GetObjectOnLocals(ss_arg_props, "gs");
-                    CheckString(gs_props, "StringField", "ss_local#SimpleStruct#string#0#SimpleStruct#gs#StringField");
-                    CheckObject(gs_props, "List", "System.Collections.Generic.List<System.DateTime>");
-                }
-
-                // ----------- Step back to the caller ---------
-
-                pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 30, 12, "TestStructsAsMethodArgs",
-                    times: 2, locals_fn: (l) => { /* non-null to make sure that locals get fetched */ });
-                locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                await CheckProps(locals, new
-                {
-                    ss_local = TValueType("DebuggerTests.ValueTypesTest.SimpleStruct"),
-                    ss_ret = TValueType("DebuggerTests.ValueTypesTest.SimpleStruct")
-                },
-                    "locals#0");
-
-                ss_arg_props = await GetObjectOnFrame(pause_location["callFrames"][0], "ss_local");
-                await CheckProps(ss_arg_props, ss_local_as_ss_arg, "ss_local");
-
-                {
-                    // Check ss_local.gs
-                    await CompareObjectPropertiesFor(ss_arg_props, "gs", ss_local_gs, label: "ss_local_gs");
-                }
-
-                // FIXME: check ss_local.gs.List's members
-            });
-        }
-
-        [Fact]
-        public async Task CheckUpdatedValueTypeFieldsOnResume()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
-
-                var lines = new[] { 205, 208 };
-                await SetBreakpoint(debugger_test_loc, lines[0], 12);
-                await SetBreakpoint(debugger_test_loc, lines[1], 12);
-
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ValueTypesTest:MethodUpdatingValueTypeMembers'); }, 1);",
-                    debugger_test_loc, lines[0], 12, "MethodUpdatingValueTypeMembers");
-
-                await CheckLocals(pause_location, new DateTime(1, 2, 3, 4, 5, 6), new DateTime(4, 5, 6, 7, 8, 9));
-
-                // Resume
-                pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", debugger_test_loc, lines[1], 12, "MethodUpdatingValueTypeMembers");
-                await CheckLocals(pause_location, new DateTime(9, 8, 7, 6, 5, 4), new DateTime(5, 1, 3, 7, 9, 10));
-            });
-
-            async Task CheckLocals(JToken pause_location, DateTime obj_dt, DateTime vt_dt)
-            {
-                var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                await CheckProps(locals, new
-                {
-                    obj = TObject("DebuggerTests.ClassForToStringTests"),
-                    vt = TObject("DebuggerTests.StructForToStringTests")
-                }, "locals");
-
-                var obj_props = await GetObjectOnLocals(locals, "obj");
-                {
-                    await CheckProps(obj_props, new
-                    {
-                        DT = TValueType("System.DateTime", obj_dt.ToString())
-                    }, "locals#obj.DT", num_fields: 5);
-
-                    await CheckDateTime(obj_props, "DT", obj_dt);
-                }
-
-                var vt_props = await GetObjectOnLocals(locals, "vt");
-                {
-                    await CheckProps(vt_props, new
-                    {
-                        DT = TValueType("System.DateTime", vt_dt.ToString())
-                    }, "locals#obj.DT", num_fields: 5);
-
-                    await CheckDateTime(vt_props, "DT", vt_dt);
-                }
-            }
-        }
-
-        [Fact]
-        public async Task CheckUpdatedValueTypeLocalsOnResumeAsync()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
-
-                var lines = new[] { 214, 216 };
-                await SetBreakpoint(debugger_test_loc, lines[0], 12);
-                await SetBreakpoint(debugger_test_loc, lines[1], 12);
-
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ValueTypesTest:MethodUpdatingValueTypeLocalsAsync'); }, 1);",
-                    debugger_test_loc, lines[0], 12, "MoveNext");
-
-                var dt = new DateTime(1, 2, 3, 4, 5, 6);
-                var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                await CheckDateTime(locals, "dt", dt);
-
-                // Resume
-                dt = new DateTime(9, 8, 7, 6, 5, 4);
-                pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", debugger_test_loc, lines[1], 12, "MoveNext");
-                locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                await CheckDateTime(locals, "dt", dt);
-            });
-        }
-
-        [Fact]
-        public async Task CheckUpdatedVTArrayMembersOnResume()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
-
-                var lines = new[] { 225, 227 };
-                await SetBreakpoint(debugger_test_loc, lines[0], 12);
-                await SetBreakpoint(debugger_test_loc, lines[1], 12);
-
-                var dt = new DateTime(1, 2, 3, 4, 5, 6);
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ValueTypesTest:MethodUpdatingVTArrayMembers'); }, 1);",
-                    debugger_test_loc, lines[0], 12, "MethodUpdatingVTArrayMembers");
-                await CheckArrayElements(pause_location, dt);
-
-                // Resume
-                dt = new DateTime(9, 8, 7, 6, 5, 4);
-                pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", debugger_test_loc, lines[1], 12, "MethodUpdatingVTArrayMembers");
-                await CheckArrayElements(pause_location, dt);
-            });
-
-            async Task CheckArrayElements(JToken pause_location, DateTime dt)
-            {
-                var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                await CheckProps(locals, new
-                {
-                    ssta = TArray("DebuggerTests.StructForToStringTests[]", 1)
-                }, "locals");
-
-                var ssta = await GetObjectOnLocals(locals, "ssta");
-                var sst0 = await GetObjectOnLocals(ssta, "0");
-                await CheckProps(sst0, new
-                {
-                    DT = TValueType("System.DateTime", dt.ToString())
-                }, "dta [0]", num_fields: 5);
-
-                await CheckDateTime(sst0, "DT", dt);
-            }
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsWithStructsStaticAsync(bool use_cfo)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, 54, 12);
-
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_static_method_async (" +
-                    "'[debugger-test] DebuggerTests.ValueTypesTest:MethodWithLocalStructsStaticAsync'" +
-                    "); }, 1);",
-                    debugger_test_loc, 54, 12, "MoveNext"); //BUG: method name
-
-                var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-                await CheckProps(locals, new
-                {
-                    ss_local = TObject("DebuggerTests.ValueTypesTest.SimpleStruct"),
-                    gs_local = TValueType("DebuggerTests.ValueTypesTest.GenericStruct<int>"),
-                    result = TBool(true)
-                },
-                    "locals#0");
-
-                var dt = new DateTime(2021, 2, 3, 4, 6, 7);
-                // Check ss_local's properties
-                var ss_local_props = await GetObjectOnFrame(pause_location["callFrames"][0], "ss_local");
-                await CheckProps(ss_local_props, new
-                {
-                    V = TGetter("V"),
-                    str_member = TString("set in MethodWithLocalStructsStaticAsync#SimpleStruct#str_member"),
-                    dt = TValueType("System.DateTime", dt.ToString()),
-                    gs = TValueType("DebuggerTests.ValueTypesTest.GenericStruct<System.DateTime>"),
-                    Kind = TEnum("System.DateTimeKind", "Utc")
-                }, "ss_local");
-
-                {
-                    var gres = await InvokeGetter(GetAndAssertObjectWithName(locals, "ss_local"), "V");
-                    await CheckValue(gres.Value["result"], TNumber(0xDEADBEEF + 2), $"ss_local#V");
-
-                    // Check ss_local.dt
-                    await CheckDateTime(ss_local_props, "dt", dt);
-
-                    // Check ss_local.gs
-                    await CompareObjectPropertiesFor(ss_local_props, "gs",
-                        new
-                        {
-                            StringField = TString("set in MethodWithLocalStructsStaticAsync#SimpleStruct#gs#StringField"),
-                            List = TObject("System.Collections.Generic.List<System.DateTime>"),
-                            Options = TEnum("DebuggerTests.Options", "Option1")
-                        }
-                    );
-                }
-
-                // Check gs_local's properties
-                var gs_local_props = await GetObjectOnFrame(pause_location["callFrames"][0], "gs_local");
-                await CheckProps(gs_local_props, new
-                {
-                    StringField = TString("gs_local#GenericStruct<ValueTypesTest>#StringField"),
-                    List = TObject("System.Collections.Generic.List<int>"),
-                    Options = TEnum("DebuggerTests.Options", "Option2")
-                }, "gs_local");
-
-                // FIXME: check ss_local.gs.List's members
-            });
-        }
-
-        [Theory]
-        [InlineData(137, 12, "MethodWithLocalsForToStringTest", false, false)]
-        [InlineData(147, 12, "MethodWithArgumentsForToStringTest", true, false)]
-        [InlineData(192, 12, "MethodWithArgumentsForToStringTestAsync", true, true)]
-        [InlineData(182, 12, "MethodWithArgumentsForToStringTestAsync", false, true)]
-        public async Task InspectLocalsForToStringDescriptions(int line, int col, string method_name, bool call_other, bool invoke_async)
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-            string entry_method_name = $"[debugger-test] DebuggerTests.ValueTypesTest:MethodWithLocalsForToStringTest{(invoke_async ? "Async" : String.Empty)}";
-            int frame_idx = 0;
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-                var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
-
-                await SetBreakpoint(debugger_test_loc, line, col);
-
-                var eval_expr = "window.setTimeout(function() {" +
-                    (invoke_async ? "invoke_static_method_async (" : "invoke_static_method (") +
-                    $"'{entry_method_name}'," +
-                    (call_other ? "true" : "false") +
-                    "); }, 1);";
-                Console.WriteLine($"{eval_expr}");
-
-                var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, line, col, invoke_async ? "MoveNext" : method_name);
-
-                var dt0 = new DateTime(2020, 1, 2, 3, 4, 5);
-                var dt1 = new DateTime(2010, 5, 4, 3, 2, 1);
-                var ts = dt0 - dt1;
-                var dto = new DateTimeOffset(dt0, new TimeSpan(4, 5, 0));
-
-                var frame_locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value<string>());
-                await CheckProps(frame_locals, new
-                {
-                    call_other = TBool(call_other),
-                    dt0 = TValueType("System.DateTime", dt0.ToString()),
-                    dt1 = TValueType("System.DateTime", dt1.ToString()),
-                    dto = TValueType("System.DateTimeOffset", dto.ToString()),
-                    ts = TValueType("System.TimeSpan", ts.ToString()),
-                    dec = TValueType("System.Decimal", "123987123"),
-                    guid = TValueType("System.Guid", "3D36E07E-AC90-48C6-B7EC-A481E289D014"),
-                    dts = TArray("System.DateTime[]", 2),
-                    obj = TObject("DebuggerTests.ClassForToStringTests"),
-                    sst = TObject("DebuggerTests.StructForToStringTests")
-                }, "locals#0");
-
-                var dts_0 = new DateTime(1983, 6, 7, 5, 6, 10);
-                var dts_1 = new DateTime(1999, 10, 15, 1, 2, 3);
-                var dts_elements = await GetObjectOnLocals(frame_locals, "dts");
-                await CheckDateTime(dts_elements, "0", dts_0);
-                await CheckDateTime(dts_elements, "1", dts_1);
-
-                // TimeSpan
-                await CompareObjectPropertiesFor(frame_locals, "ts",
-                    new
-                    {
-                        Days = TNumber(3530),
-                        Minutes = TNumber(2),
-                        Seconds = TNumber(4),
-                    }, "ts_props", num_fields: 12);
-
-                // DateTimeOffset
-                await CompareObjectPropertiesFor(frame_locals, "dto",
-                    new
-                    {
-                        Day = TNumber(2),
-                        Year = TNumber(2020),
-                        DayOfWeek = TEnum("System.DayOfWeek", "Thursday")
-                    }, "dto_props", num_fields: 22);
-
-                var DT = new DateTime(2004, 10, 15, 1, 2, 3);
-                var DTO = new DateTimeOffset(dt0, new TimeSpan(2, 14, 0));
-
-                var obj_props = await CompareObjectPropertiesFor(frame_locals, "obj",
-                    new
-                    {
-                        DT = TValueType("System.DateTime", DT.ToString()),
-                        DTO = TValueType("System.DateTimeOffset", DTO.ToString()),
-                        TS = TValueType("System.TimeSpan", ts.ToString()),
-                        Dec = TValueType("System.Decimal", "1239871"),
-                        Guid = TValueType("System.Guid", "3D36E07E-AC90-48C6-B7EC-A481E289D014")
-                    }, "obj_props");
-
-                DTO = new DateTimeOffset(dt0, new TimeSpan(3, 15, 0));
-                var sst_props = await CompareObjectPropertiesFor(frame_locals, "sst",
-                    new
-                    {
-                        DT = TValueType("System.DateTime", DT.ToString()),
-                        DTO = TValueType("System.DateTimeOffset", DTO.ToString()),
-                        TS = TValueType("System.TimeSpan", ts.ToString()),
-                        Dec = TValueType("System.Decimal", "1239871"),
-                        Guid = TValueType("System.Guid", "3D36E07E-AC90-48C6-B7EC-A481E289D014")
-                    }, "sst_props");
-            });
-        }
-
-        [Fact]
-        public async Task InspectLocals()
-        {
-            var insp = new Inspector();
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var wait_res = await RunUntil("locals_inner");
-                var locals = await GetProperties(wait_res["callFrames"][1]["callFrameId"].Value<string>());
-            });
-        }
-
-        [Theory]
-        [InlineData(false)]
-        [InlineData(true)]
-        public async Task InspectLocalsForStructInstanceMethod(bool use_cfo) => await CheckInspectLocalsAtBreakpointSite(
-            "dotnet://debugger-test.dll/debugger-array-test.cs", 258, 12,
-            "GenericInstanceMethod<DebuggerTests.SimpleClass>",
-            "window.setTimeout(function() { invoke_static_method_async ('[debugger-test] DebuggerTests.EntryClass:run'); })",
-            use_cfo: use_cfo,
-            wait_for_event_fn: async (pause_location) =>
-           {
-               var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
-
-               await CheckProps(frame_locals, new
-               {
-                   sc_arg = TObject("DebuggerTests.SimpleClass"),
-                   @this = TValueType("DebuggerTests.Point"),
-                   local_gs = TValueType("DebuggerTests.SimpleGenericStruct<int>")
-               },
-                   "locals#0");
-
-               await CompareObjectPropertiesFor(frame_locals, "local_gs",
-                   new
-                   {
-                       Id = TString("local_gs#Id"),
-                       Color = TEnum("DebuggerTests.RGB", "Green"),
-                       Value = TNumber(4)
-                   },
-                   label: "local_gs#0");
-
-               await CompareObjectPropertiesFor(frame_locals, "sc_arg",
-                   TSimpleClass(10, 45, "sc_arg#Id", "Blue"),
-                   label: "sc_arg#0");
-
-               await CompareObjectPropertiesFor(frame_locals, "this",
-                   TPoint(90, -4, "point#Id", "Green"),
-                   label: "this#0");
-
-           });
-
-        [Fact]
-        public async Task SteppingIntoMscorlib()
-        {
-            var insp = new Inspector();
-            //Collect events
-            var scripts = SubscribeToScripts(insp);
-
-            await Ready();
-            await insp.Ready(async (cli, token) =>
-            {
-                ctx = new DebugTestContext(cli, insp, token, scripts);
-
-                var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 83, 8);
-                var pause_location = await EvaluateAndCheck(
-                    "window.setTimeout(function() { invoke_static_method ('[debugger-test] Math:OuterMethod'); }, 1);",
-                    "dotnet://debugger-test.dll/debugger-test.cs", 83, 8,
-                    "OuterMethod");
-
-                //make sure we're on the right bp
-                Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
-
-                pause_location = await SendCommandAndCheck(null, $"Debugger.stepInto", null, -1, -1, null);
-                var top_frame = pause_location["callFrames"][0];
-
-                AssertEqual("WriteLine", top_frame["functionName"]?.Value<string>(), "Expected to be in WriteLine method");
-                var script_id = top_frame["functionLocation"]["scriptId"].Value<string>();
-                Assert.Matches ("^dotnet://(mscorlib|System\\.Console)\\.dll/Console.cs", scripts[script_id]);
-            });
-        }
-
-        [Fact]
-        public async Task InvalidValueTypeData()
-        {
-            await CheckInspectLocalsAtBreakpointSite(
-                "dotnet://debugger-test.dll/debugger-test.cs", 85, 8,
-                "OuterMethod",
-                "window.setTimeout(function() { invoke_static_method ('[debugger-test] Math:OuterMethod'); })",
-                wait_for_event_fn: async (pause_location) =>
-               {
-                   var new_id = await CreateNewId(@"MONO._new_or_add_id_props ({ scheme: 'valuetype', idArgs: { containerId: 1 }, props: { klass: 3, value64: 4 }});");
-                   await _invoke_getter(new_id, "NonExistant", expect_ok: false);
-
-                   new_id = await CreateNewId(@"MONO._new_or_add_id_props ({ scheme: 'valuetype', idArgs: { containerId: 1 }, props: { klass: 3 }});");
-                   await _invoke_getter(new_id, "NonExistant", expect_ok: false);
-
-                   new_id = await CreateNewId(@"MONO._new_or_add_id_props ({ scheme: 'valuetype', idArgs: { containerId: 1 }, props: { klass: 3, value64: 'AA' }});");
-                   await _invoke_getter(new_id, "NonExistant", expect_ok: false);
-               });
-
-            async Task<string> CreateNewId(string expr)
-            {
-                var res = await ctx.cli.SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = expr }), ctx.token);
-                Assert.True(res.IsOk, "Expected Runtime.evaluate to succeed");
-                AssertEqual("string", res.Value["result"]?["type"]?.Value<string>(), "Expected Runtime.evaluate to return a string type result");
-                return res.Value["result"]?["value"]?.Value<string>();
-            }
-
-            async Task<Result> _invoke_getter(string obj_id, string property_name, bool expect_ok)
-            {
-                var expr = $"MONO._invoke_getter ('{obj_id}', '{property_name}')";
-                var res = await ctx.cli.SendCommand("Runtime.evaluate", JObject.FromObject(new { expression = expr }), ctx.token);
-                AssertEqual(expect_ok, res.IsOk, "Runtime.evaluate result not as expected for {expr}");
-
-                return res;
-            }
-        }
-
-        //TODO add tests covering basic stepping behavior as step in/out/over
-    }
-}

Деякі файли не було показано, через те що забагато файлів було змінено