Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 7e76a48

Browse files
committed
Refactor to use a dylib
1 parent 0c303ed commit 7e76a48

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

main/build/MacOSX/Makefile.am

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ MONOSTUB_STATIC_LINK=$(EXTERNAL)/Xamarin.Mac.registrar.full.a
1313

1414
if !RELEASE_BUILDS
1515
HYBRID_SUSPEND_ABORT=-DHYBRID_SUSPEND_ABORT
16-
ENABLE_DEBUG_CRASHER=-DENABLE_DEBUG_CRASHER
1716
endif
1817

1918
#SDK_PATH=$(shell xcrun --sdk macosx10.8 --show-sdk-path)
@@ -41,14 +40,26 @@ MONOSTUB_RPATH=-Wl,-rpath,/Library/Frameworks/Mono.framework/Libraries/ \
4140
-Wl,-rpath,/usr/lib/ \
4241
-Wl,-rpath,/usr/local/lib/
4342

44-
all: monostub monostub-nogui monostub-test
43+
all: monostub monostub-nogui monostub-test debugcrash
4544

4645
render.exe: render.cs
4746
mcs -r:System.Drawing render.cs
4847

4948
dmg: render.exe app
5049
./make-dmg-bundle.sh
5150

51+
if !RELEASE_BUILDS
52+
debugcrash: libdebugcrash.dylib
53+
cp $^ ../bin
54+
else
55+
debugcrash:
56+
endif
57+
58+
if !RELEASE_BUILDS
59+
libdebugcrash.dylib: debugcrash.c
60+
clang -g -shared -fpic -o $@ $^
61+
endif
62+
5263
monostub.o: monostub.mm $(MONOSTUB_EXTRA_SOURCEFILES)
5364
g++ -g $(HYBRID_SUSPEND_ABORT) $(ENABLE_DEBUG_CRASHER) -c -Wall -m64 -o $@ monostub.mm
5465

@@ -161,4 +172,4 @@ app: monostub monostub-test
161172
@echo ""
162173
@rm -f missing-stuff
163174

164-
.PHONY: app dmg
175+
.PHONY: app dmg debugcrash

main/build/MacOSX/monostub.mm

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,6 @@
227227
}
228228
}
229229

230-
#if ENABLE_DEBUG_CRASHER
231-
extern "C" void debug_trigger_sigsegv()
232-
{
233-
void *p = (void*)0x12345;
234-
*(int *)p = 0;
235-
}
236-
#endif
237-
238230
int
239231
main (int argc, char **argv)
240232
{

main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/Commands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected override void Run ()
204204

205205
class InduceNativePInvokeCrashHandler : CommandHandler
206206
{
207-
[DllImport ("__Internal")]
207+
[DllImport ("libdebugcrash.dylib")]
208208
static extern void debug_trigger_sigsegv ();
209209

210210
protected override void Run ()

0 commit comments

Comments
 (0)