[runtime]Hide public fields and kill MONO_DEBUG_FORMAT_DEBUGGER.
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 26 Nov 2013 15:48:49 +0000 (10:48 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 26 Nov 2013 19:25:17 +0000 (14:25 -0500)
mono/metadata/mono-debug.c
mono/metadata/mono-debug.h
mono/mini/aot-compiler.c
mono/mini/debug-mini.c
mono/mini/method-to-ir.c
mono/mini/mini.c

index 188ca0f843a91a043a347ceb63030b2bafd63521..bf49562b0deca08bb897d5eced1ee1b635f493e6 100644 (file)
@@ -106,9 +106,9 @@ typedef struct {
        guint32 size;
 } MonoDebugDelegateTrampolineEntry;
 
-MonoSymbolTable *mono_symbol_table = NULL;
-MonoDebugFormat mono_debug_format = MONO_DEBUG_FORMAT_NONE;
-gint32 mono_debug_debugger_version = 5;
+static MonoSymbolTable *mono_symbol_table = NULL;
+static MonoDebugFormat mono_debug_format = MONO_DEBUG_FORMAT_NONE;
+static gint32 mono_debug_debugger_version = 5;
 
 static gboolean mono_debug_initialized = FALSE;
 static GHashTable *mono_debug_handles = NULL;
@@ -227,6 +227,9 @@ void
 mono_debug_init (MonoDebugFormat format)
 {
        g_assert (!mono_debug_initialized);
+       if (format == MONO_DEBUG_FORMAT_DEBUGGER)
+               g_error ("The mdb debugger is no longer supported.");
+
 
        mono_debug_initialized = TRUE;
        mono_debug_format = format;
@@ -1290,3 +1293,14 @@ open_symfile_from_bundle (MonoImage *image)
 
        return NULL;
 }
+
+/**
+ * mono_debug_enabled:
+ *
+ * Returns true is debug information is enabled. This doesn't relate if a debugger is present or not.
+ */
+mono_bool
+mono_debug_enabled (void)
+{
+       return mono_debug_format != MONO_DEBUG_FORMAT_NONE;
+}
index de4315063c84f07d4f067da2c29623b583731b1d..2106a6f3e5e884456c0bed773f68005118266527 100644 (file)
@@ -36,6 +36,7 @@ typedef struct _MonoDebugList                 MonoDebugList;
 typedef enum {
        MONO_DEBUG_FORMAT_NONE,
        MONO_DEBUG_FORMAT_MONO,
+       /* Deprecated, the mdb debugger is not longer supported. */
        MONO_DEBUG_FORMAT_DEBUGGER
 } MonoDebugFormat;
 
@@ -104,6 +105,8 @@ struct _MonoDebugSourceLocation {
        uint32_t il_offset;
 };
 
+MONO_API mono_bool mono_debug_enabled (void);
+
 /*
  * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
  * where the variable is actually stored.
@@ -146,10 +149,6 @@ struct _MonoDebugVarInfo {
 #define MONO_DEBUGGER_MINOR_VERSION                    6
 #define MONO_DEBUGGER_MAGIC                            0x7aff65af4253d427ULL
 
-extern MonoSymbolTable *mono_symbol_table;
-extern MonoDebugFormat mono_debug_format;
-extern int32_t mono_debug_debugger_version;
-
 MONO_API void mono_debug_list_add (MonoDebugList **list, const void* data);
 MONO_API void mono_debug_list_remove (MonoDebugList **list, const void* data);
 
index fa91e5cdb4db06779b0044ab8c462aaf8fd91768..9723c34b4cde030930ca58d74546d61f78cd8804 100755 (executable)
@@ -8669,7 +8669,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                opt->mdb_optimizations = TRUE;
                opt->gen_seq_points = TRUE;
 
-               if (mono_debug_format == MONO_DEBUG_FORMAT_NONE) {
+               if (!mono_debug_enabled ()) {
                        fprintf (stderr, "The soft-debug AOT option requires the --debug option.\n");
                        return 1;
                }
@@ -8873,7 +8873,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
        }
 
        if (!acfg->aot_opts.nodebug || acfg->aot_opts.dwarf_debug) {
-               if (acfg->aot_opts.dwarf_debug && mono_debug_format == MONO_DEBUG_FORMAT_NONE) {
+               if (acfg->aot_opts.dwarf_debug && !mono_debug_enabled ()) {
                        fprintf (stderr, "The dwarf AOT option requires the --debug option.\n");
                        return 1;
                }
index b581ee2d14f85de4fc1ed1da5f7efa4f67b10a5d..63278b9edf7b7e9ba3943429e52713399a9400ef 100644 (file)
@@ -51,7 +51,7 @@ mono_debug_init_method (MonoCompile *cfg, MonoBasicBlock *start_block, guint32 b
 {
        MiniDebugMethodInfo *info;
 
-       if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+       if (!mono_debug_enabled ())
                return;
 
        info = g_new0 (MiniDebugMethodInfo, 1);
@@ -592,7 +592,7 @@ mono_debug_add_aot_method (MonoDomain *domain, MonoMethod *method, guint8 *code_
 {
        MonoDebugMethodJitInfo *jit;
 
-       if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+       if (!mono_debug_enabled ())
                return;
 
        if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
@@ -617,7 +617,7 @@ mono_debug_add_aot_method (MonoDomain *domain, MonoMethod *method, guint8 *code_
 void
 mono_debug_add_icall_wrapper (MonoMethod *method, MonoJitICallInfo* callinfo)
 {
-       if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+       if (!mono_debug_enabled ())
                return;
 
        // mono_debug_add_wrapper (method, callinfo->wrapper, callinfo->func);
index 9590dea3aac4e4231c47b1927e77123d26348147..03ee64790aa1aa6c31d1ad81583d5bcac03762a8 100644 (file)
@@ -6876,7 +6876,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
        if (cfg->method == method) {
                breakpoint_id = mono_debugger_method_has_breakpoint (method);
-               if (breakpoint_id && (mono_debug_format != MONO_DEBUG_FORMAT_DEBUGGER)) {
+               if (breakpoint_id) {
                        MONO_INST_NEW (cfg, ins, OP_BREAK);
                        MONO_ADD_INS (bblock, ins);
                }
index f4179165e16e4ed06bc7bb3da20d93f822a2d19d..cad17ea6709315998cde280cd7558a7e4503acb1 100644 (file)
@@ -5778,9 +5778,6 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
                if (jinfo)
                        mono_profiler_method_end_jit (method, jinfo, MONO_PROFILE_OK);
                return code;
-
-               //if (mono_debug_format != MONO_DEBUG_FORMAT_NONE) 
-               //mono_debug_add_wrapper (method, nm);
        } else if ((method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
                const char *name = method->name;
                char *full_name, *msg;