Skip to content

Instantly share code, notes, and snippets.

View lambdageek's full-sized avatar
🦀

Aleksey Kliger (λgeek) lambdageek

🦀
View GitHub Profile
@lambdageek
lambdageek / Makefile
Created February 12, 2019 20:07
custom modifier IL tests
all: Repro11350.exe
.PHONY: all clean
Repro11350.exe: Repro11350.cs modifiersdata.dll
csc /out:$@ /target:exe $< -r:./modifiersdata.dll
modifiersdata.dll: modifiersdata.il
ilasm /output:$@ /dll $<
@lambdageek
lambdageek / Makefile
Created February 12, 2019 21:43
modopt test 12422
all: Repro12422.exe
.PHONY: all clean
Repro12422.exe: Repro12422.cs ModoptTests.dll
csc /out:$@ /target:exe $< -r:./ModoptTests.dll
ModoptTests.dll: ModoptTests.il
@lambdageek
lambdageek / Makefile
Created February 12, 2019 22:07
standalone repro 10564
all: Repro10564.exe
.PHONY: all clean
Repro10564.exe: Repro10564.cs Mods.dll
csc /out:$@ /target:exe $< -r:./Mods.dll
Mods.dll: Mods.il

compile with

~/work/roslyn/roslyn/Binaries/Tools/ILAsm/ilasm -DLL  modmod.il
csc test.cs -r:modmod.dll

run with

ALEKSEY_HACK=1 mono test.exe

expected output is:

This file has been truncated, but you can view the full file.
; ModuleID = 'tup.opt.bc'
source_filename = "aot"
%MonoAotFileInfo = type { i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [11 x i32], [6 x i32], [6 x i32], [6 x i32], [6 x i32], [16 x i8] }
%"OneThing`1<int>" = type { i8, i8, i8, i8 }
%System.ParamsArray = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%"OneThing`1<T1_INT>" = type { i8, i8, i8, i8 }
%System.Threading.CancellationToken = type { i8, i8, i8, i8, i8, i8, i8, i8 }
%"System.Runtime.CompilerServices.TaskAwaiter`1<TResult_INST>" = type { i8, i8, i8, i8, i8, i8, i8, i8 }
%"System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<TResult_INST>" = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i
From a8dc6cc6fd0f318ad8b963ea1efe060ed975fd2b Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <[email protected]>
Date: Wed, 27 Mar 2019 11:58:52 -0400
Subject: [PATCH] print more
---
mono/mini/mini-generic-sharing.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mono/mini/mini-generic-sharing.c b/mono/mini/mini-generic-sharing.c
***** MonoTests.System.Linq.ParallelEnumerableTests.TestSimpleExcept
Ran out of trampolines of type 3 in '/home/builder/jenkins/workspace/test-mono-pull-request-arm64-fullaot/mcs/class/lib/testing_aot_full/mscorlib.dll' (limit 4000)
/proc/self/maps:
aaaacc281000-aaaacc5df000 r-xp 00000000 08:02 8673559 /home/builder/jenkins/workspace/test-mono-pull-request-arm64-fullaot/mono/mini/mono-sgen
aaaacc5ee000-aaaacc5f5000 r--p 0035d000 08:02 8673559 /home/builder/jenkins/workspace/test-mono-pull-request-arm64-fullaot/mono/mini/mono-sgen
aaaacc5f5000-aaaacc5fa000 rw-p 00364000 08:02 8673559 /home/builder/jenkins/workspace/test-mono-pull-request-arm64-fullaot/mono/mini/mono-sgen
aaaacc5fa000-aaaacc611000 rw-p 00000000 00:00 0
aaaae8ae7000-aaaaea3c8000 rw-p 00000000 00:00 0 [heap]
fffe18000000-fffe18028000 rw-p 00000000 00:00 0
@lambdageek
lambdageek / debug-mono-no-build.md
Created April 19, 2019 19:10
Debugging Mono using LLDB without building

Overview

Sometimes you want to debug a build of Mono from Jenkins without building it yourself (for example because you want to be sure it's configured exactly how it would be on a customer install).

The basic idea is to grab a build from Jenkins but point LLDB at a local checkout of the source

Steps

Let's say I'm interesed in Mono 6.0.x (2019-02).

.PHONY: all run clean
all: Repro13734.exe
Repro13734.exe: Repro13734.cs Point.dll
csc -r:Point.dll Repro13734.cs
Point.dll: Point.cs
csc -target:library Point.cs
make -C runtime all-mcs build_profiles=monodroid_designer PROFILE_PLATFORM=
win32
cp ../data/config etc/mono/config
if test -d "/Users/alklig/work/mono-monodroid_designer_profile/support"; then \
sed 's,target="$mono_libdir/libMonoPosixHelper.dylib",target="/Users/alklig/work/mono-monodroid_designer_profile/support/libMonoPosixHelper.la",' etc/mono/config > etc/mono/config.tmp \
&& mv etc/mono/config.tmp etc/mono/config \
; \
else \
echo "Unknown directory '/Users/alklig/work/mono-monodroid_designer_profile/support'" && false; \
fi