Skip to content

Instantly share code, notes, and snippets.

View lambdageek's full-sized avatar
🦀

Aleksey Kliger (λgeek) lambdageek

🦀
View GitHub Profile
./autogen.sh --disable-btls --disable-btls-lib --disable-boehm
make -C mono
make -C mcs NO_DIR_CHECK=1 PROFILES=build all-profiles
make -C runtime all-mcs build_profiles=monodroid_designer PROFILE_PLATFORM=win32
@lambdageek
lambdageek / vscode
Created May 4, 2019 00:11
Visual Studio Code script for Cygwin
#! /usr/bin/env bash
if [ "z$1" == "z--help" ]; then
echo "vscode [FILE]"
echo " Starts Visual Studio Code for Windows"
echo " If FILE is given (as a unix path) it will be opened."
exit;
fi
winpath="C:\\Program Files\\Microsoft VS Code\\Code.exe"
@lambdageek
lambdageek / How-to-run-Mono.md
Created May 28, 2019 17:22
How to run Mono

How to run Mono

You built Mono from git and now you want to run it. There are three approaches

Assume GIT_ROOT is an environment variable set to the directory where you build mono and it's your current working directory.

Run mono tests

If you added a new test to one of the usual places and you want to try it out

Forwarding debugger port 8852
Detecting existing process
> am start -n "com.companyname.couchbase_crash_attempt/md5e99597658932f3d92401f62f404342dd.MainActivity"
> Starting: Intent { cmp=com.companyname.couchbase_crash_attempt/md5e99597658932f3d92401f62f404342dd.MainActivity }
Loaded assembly: /storage/emulated/0/Android/data/com.companyname.couchbase_crash_attempt/files/.__override__/couchbase.crash.attempt.dll
Loaded assembly: /storage/emulated/0/Android/data/com.companyname.couchbase_crash_attempt/files/.__override__/Couchbase.Lite.dll [External]
Loaded assembly: /storage/emulated/0/Android/data/com.companyname.couchbase_crash_attempt/files/.__override__/Couchbase.Lite.Support.Android.dll [External]
Loaded assembly: /storage/emulated/0/Android/data/com.companyname.couchbase_crash_attempt/files/.__override__/FormsViewGroup.dll [External]
Loaded assembly: /storage/emulated/0/Android/data/com.companyname.couchbase_crash_attempt/files/.__override__/Newtonsoft.Json.dll [External]
@lambdageek
lambdageek / debugger-soft.diff
Last active July 15, 2019 18:47
debugger-libs Mono.Debugger.Soft vs mono Mono.Debugger.Soft
diff -u /Users/alklig/work/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/ArrayMirror.cs /Users/alklig/work/mono/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ArrayMirror.cs
--- /Users/alklig/work/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/ArrayMirror.cs 2019-07-15 14:32:06.000000000 -0400
+++ /Users/alklig/work/mono/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ArrayMirror.cs 2015-09-30 17:51:36.000000000 -0400
@@ -1,4 +1,3 @@
-
using System;
using System.Collections;
using System.Collections.Generic;
@@ -93,14 +92,6 @@
vm.conn.Array_SetValues (id, index, vm.EncodeValues (values));
@lambdageek
lambdageek / Suspend-and-Thread-States.md
Created October 2, 2019 16:05
Description of GC thread state transitions and the mechanics of thread suspension

GC Safe, GC Unsafe, coop vs preemptive suspend and mechanics

I find the names gc safe/unsafe confusing.

"GC Safe": it is safe for the GC to modify this thread's view of the heap. "GC Unsafe" it is not safe for the GC to modify this thread's view of the heap.

If a thread is in GC Safe mode, it does not have any references to unpinned managed references. So the thread can keep running as long as it doesn't try to interact with Mono.

If a thread is in GC Unsafe mode it is doing something that would interfere with the GC - maybe it's accessing a heap object that the GC needs to move, maybe it wants to take the GC lock because it is trying to allocate. etc.

#!/usr/bin/ruby
# Copyright © 2012-2016 David Caldwell <david@porkrind.org>
#
# This launcher code is from emacsformacosx.com and is not part of Emacs
# proper. It exists so that there can be a single download that contains
# binaries for all supported Mac OS X versions.
#
# Why not just use a fat binary? Because fat binaries can only hold 1 of
# each architecture and Emacs has multiple x86_64 architectures binaries.
#
all: foo.exe
.PHONY: all
libfoo.dylib: foo.c
clang -shared -fpic -o $@ $<
foo.exe: foo.cs libfoo.dylib
csc /target:exe /out:$@ foo.cs
=== Visual Studio Enterprise 2019 for Mac (Preview) ===
Version 8.4 Preview (8.4 build 2406)
Installation UUID: c1b3b394-68d8-4231-92e8-47d068034506
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)
Package version: 606000154
=== Mono Framework MDK ===
Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen.CodeGenTupleEqualityTests.TestOnTupleOfDecimals [FAIL]
Expected:
Actual:
// (6,38): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
// System.Console.Write(Compare((1, 2), (1, 2)));
Diagnostic(ErrorCode.ERR_PredefinedValueTupleTypeNotFound, "(1, 2)").WithArguments("System.ValueTuple`2").WithLocation(6, 38),
// (6,46): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
// System.Console.Write(Compare((1, 2), (1, 2)));
Diagnostic(ErrorCode.ERR_PredefinedValueTupleTypeNotFound, "(1, 2)").WithArguments("System.ValueTuple`2").WithLocation(6, 46),