void MONO_NOINLINE __jit_debug_register_code(void);
#if !defined(MONO_LLVM_LOADED) && defined(ENABLE_LLVM) && ((LLVM_MAJOR_VERSION == 2 && LLVM_MINOR_VERSION >= 7) || LLVM_MAJOR_VERSION > 2)
+
/* LLVM already defines these */
extern struct jit_descriptor __jit_debug_descriptor;
+
#else
/* Make sure to specify the version statically, because the
debugger may check the version before we can set it. */
struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
-void MONO_NOINLINE __jit_debug_register_code(void) { };
+/* gcc seems to inline/eliminate calls to noinline functions, thus the asm () */
+void MONO_NOINLINE __jit_debug_register_code(void) {
+#if defined(__GNUC__)
+ asm ("");
+#endif
+}
+
#endif
static MonoImageWriter *xdebug_w;
/* This file will contain the IL code for methods which don't have debug info */
il_file = fopen ("xdb.il", "w");
+ if (il_file == NULL) {
+ use_gdb_interface = FALSE;
+ g_warning ("** Unable to create xdb.il. Managed symbol names won't be available.");
+ return;
+ }
if (use_gdb_interface)
return;