Skip to content

Commit 991e78a

Browse files
author
brianradunity
authored
Merge pull request #852 from Unity-Technologies/il2cpp-debugger-build
Cleaning up mono/mini directory in IL2CPP externals
2 parents 9410509 + 4ff5d1e commit 991e78a

File tree

6 files changed

+47
-22
lines changed

6 files changed

+47
-22
lines changed

external/buildscripts/sources.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -540,23 +540,8 @@ support/libm/math_private.h
540540
####################
541541
#mono mini files
542542
####################
543-
mono/mini/aot-runtime.h
544-
mono/mini/cfgdump.h
545543
mono/mini/debugger-agent.c
546544
mono/mini/debugger-agent.h
547545
mono/mini/il2cpp-c-types.h
548546
mono/mini/il2cpp-compat.h
549547
mono/mini/il2cpp-stubs.cpp
550-
mono/mini/jit.h
551-
mono/mini/mini-amd64.h
552-
mono/mini/mini-arch.h
553-
mono/mini/mini-ops.h
554-
mono/mini/mini-runtime.h
555-
mono/mini/mini-unwind.h
556-
mono/mini/mini-x86.h
557-
mono/mini/mini.h
558-
mono/mini/optflags-def.h
559-
mono/mini/patch-info.h
560-
mono/mini/regalloc.h
561-
mono/mini/seq-points.h
562-
mono/mini/interp/interp.h

mono/mini/debugger-agent.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,21 @@
7878
#include <mono/utils/networking.h>
7979
#include <mono/utils/mono-proclib.h>
8080
#include <mono/utils/w32api.h>
81+
82+
#ifndef RUNTIME_IL2CPP
8183
#include "mini.h"
8284
#include "seq-points.h"
8385
#include "aot-runtime.h"
8486
#include "mini-runtime.h"
8587
#include "interp/interp.h"
88+
#endif
89+
90+
#ifdef RUNTIME_IL2CPP
91+
#include <mono/metadata/seq-points-data.h>
92+
#include <mono/metadata/profiler.h>
93+
#include <mono/metadata/tokentype.h>
94+
#define MONO_ARCH_SOFT_DEBUG_SUPPORTED
95+
#endif
8696

8797
/*
8898
* On iOS we can't use System.Environment.Exit () as it will do the wrong
@@ -2267,6 +2277,7 @@ void mono_debugger_il2cpp_init (const Il2CppDebuggerMetadataRegistration *data)
22672277
{
22682278
s_jit_info_hashtable = g_hash_table_new_full(mono_aligned_addr_hash, NULL, NULL, NULL);
22692279
g_il2cpp_metadata = data;
2280+
debug_options.native_debugger_break = FALSE;
22702281
}
22712282

22722283
static gpointer
@@ -4475,6 +4486,8 @@ breakpoints_init (void)
44754486
* Insert the breakpoint described by BP into the method described by
44764487
* JI.
44774488
*/
4489+
#ifndef RUNTIME_IL2CPP
4490+
44784491
static void
44794492
insert_breakpoint (MonoSeqPointInfo *seq_points, MonoDomain *domain, MonoJitInfo *ji, MonoBreakpoint *bp, MonoError *error)
44804493
{
@@ -4564,7 +4577,6 @@ insert_breakpoint (MonoSeqPointInfo *seq_points, MonoDomain *domain, MonoJitInfo
45644577
DEBUG_PRINTF (1, "[dbg] Inserted breakpoint at %s:[il=0x%x,native=0x%x] [%p](%d).\n", mono_method_full_name (jinfo_get_method (ji), TRUE), (int)it.seq_point.il_offset, (int)it.seq_point.native_offset, inst->ip, count);
45654578
}
45664579

4567-
#ifndef RUNTIME_IL2CPP
45684580

45694581
static void
45704582
remove_breakpoint (BreakpointInstance *inst)
@@ -4694,6 +4706,8 @@ add_pending_breakpoints (MonoMethod *method, MonoJitInfo *ji)
46944706
#endif
46954707
}
46964708

4709+
#ifndef RUNTIME_IL2CPP
4710+
46974711
static void
46984712
set_bp_in_method (MonoDomain *domain, MonoMethod *method, MonoSeqPointInfo *seq_points, MonoBreakpoint *bp, MonoError *error)
46994713
{
@@ -4723,6 +4737,8 @@ set_bp_in_method (MonoDomain *domain, MonoMethod *method, MonoSeqPointInfo *seq_
47234737
insert_breakpoint (seq_points, domain, ji, bp, error);
47244738
}
47254739

4740+
#endif
4741+
47264742
static void
47274743
clear_breakpoint (MonoBreakpoint *bp);
47284744

@@ -8124,8 +8140,10 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
81248140
MonoObject *this_arg, *res, *exc = NULL;
81258141
MonoDomain *domain;
81268142
guint8 *this_buf;
8127-
#ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
8143+
#ifndef RUNTIME_IL2CPP
8144+
#ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
81288145
MonoLMFExt ext;
8146+
#endif
81298147
#endif
81308148
MonoStopwatch watch;
81318149

mono/mini/debugger-agent.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
#ifndef __MONO_DEBUGGER_AGENT_H__
66
#define __MONO_DEBUGGER_AGENT_H__
77

8+
#ifndef RUNTIME_IL2CPP
89
#include "mini.h"
10+
#endif
11+
912
#include "il2cpp-compat.h"
1013
#include <mono/utils/mono-stack-unwinding.h>
1114

mono/mini/il2cpp-c-types.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ typedef struct _Il2CppMonoMethodSignature Il2CppMonoMethodSignature;
5252
typedef struct _Il2CppMonoRuntimeExceptionHandlingCallbacks Il2CppMonoRuntimeExceptionHandlingCallbacks;
5353
typedef struct Il2CppDefaults Il2CppMonoDefaults;
5454
typedef struct _Il2CppMonoTypeNameParse Il2CppMonoTypeNameParse;
55+
typedef struct _Il2CppMonoDebugOptions Il2CppMonoDebugOptions;
56+
typedef struct _Il2CppEmptyStruct Il2CppMonoLMF;
57+
58+
typedef MonoStackFrameInfo StackFrameInfo;
59+
typedef gpointer MonoInterpFrameHandle;
5560

5661
typedef gboolean (*Il2CppMonoInternalStackWalk) (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer data);
5762

@@ -76,10 +81,20 @@ struct _Il2CppMonoTypeNameParse
7681
void *il2cppTypeNameParseInfo;
7782
};
7883

84+
struct _Il2CppMonoDebugOptions
85+
{
86+
gboolean native_debugger_break;
87+
};
88+
89+
struct _Il2CppEmptyStruct
90+
{
91+
int dummy;
92+
};
93+
7994
TYPED_HANDLE_DECL (MonoObject);
8095
TYPED_HANDLE_DECL (MonoReflectionAssembly);
8196
Il2CppMonoDefaults il2cpp_mono_defaults;
82-
MonoDebugOptions il2cpp_mono_debug_options;
97+
Il2CppMonoDebugOptions il2cpp_mono_debug_options;
8398

8499
typedef void (*Il2CppMonoProfileFunc) (MonoProfiler *prof);
85100
typedef void (*Il2CppMonoProfileAppDomainFunc) (MonoProfiler *prof, MonoDomain *domain);

mono/mini/il2cpp-compat.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#define MonoRuntimeExceptionHandlingCallbacks Il2CppMonoRuntimeExceptionHandlingCallbacks
5151
#define debug_options il2cpp_mono_debug_options
5252
#define MonoTypeNameParse Il2CppMonoTypeNameParse
53+
#define MonoDebugOptions Il2CppMonoDebugOptions
54+
#define MonoLMF Il2CppMonoLMF
5355

5456
#define mono_image_get_entry_point il2cpp_mono_image_get_entry_point
5557
#define mono_image_get_filename il2cpp_mono_image_get_filename
@@ -258,6 +260,9 @@
258260

259261
#define mono_get_string_class il2cpp_mono_get_string_class
260262

263+
#define MONO_MAX_IREGS 1
264+
#define NOT_IMPLEMENTED do { g_assert_not_reached (); } while (0)
265+
261266
MonoMethod* il2cpp_mono_image_get_entry_point (MonoImage *image);
262267
const char* il2cpp_mono_image_get_filename (MonoImage *image);
263268
const char* il2cpp_mono_image_get_guid (MonoImage *image);

mono/mini/il2cpp-stubs.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ extern "C" {
4040
#include <mono/metadata/profiler-private.h>
4141
#include <mono/metadata/profiler.h>
4242
#include <mono/sgen/sgen-conf.h>
43-
#include <mono/mini/mini.h>
4443
#include <mono/metadata/seq-points-data.h>
4544
#include "il2cpp-c-types.h"
4645
#include <mono/metadata/il2cpp-compat-metadata.h>
@@ -970,7 +969,7 @@ MonoMethod* il2cpp_mono_marshal_method_from_wrapper(MonoMethod* wrapper)
970969
return NULL;
971970
}
972971

973-
MonoDebugOptions* il2cpp_mini_get_debug_options()
972+
Il2CppMonoDebugOptions* il2cpp_mini_get_debug_options()
974973
{
975974
IL2CPP_ASSERT(0 && "This method is not yet implemented");
976975
return NULL;
@@ -982,13 +981,13 @@ gpointer il2cpp_mono_jit_find_compiled_method_with_jit_info(MonoDomain* domain,
982981
return 0;
983982
}
984983

985-
MonoLMF** il2cpp_mono_get_lmf_addr()
984+
Il2CppMonoLMF** il2cpp_mono_get_lmf_addr()
986985
{
987986
IL2CPP_ASSERT(0 && "This method is not yet implemented");
988987
return NULL;
989988
}
990989

991-
void il2cpp_mono_set_lmf(MonoLMF* lmf)
990+
void il2cpp_mono_set_lmf(Il2CppMonoLMF* lmf)
992991
{
993992
IL2CPP_ASSERT(0 && "This method is not yet implemented");
994993
}

0 commit comments

Comments
 (0)