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;
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;
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;
+}
typedef enum {
MONO_DEBUG_FORMAT_NONE,
MONO_DEBUG_FORMAT_MONO,
+ /* Deprecated, the mdb debugger is not longer supported. */
MONO_DEBUG_FORMAT_DEBUGGER
} MonoDebugFormat;
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.
#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);
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;
}
}
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;
}
{
MiniDebugMethodInfo *info;
- if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+ if (!mono_debug_enabled ())
return;
info = g_new0 (MiniDebugMethodInfo, 1);
{
MonoDebugMethodJitInfo *jit;
- if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+ if (!mono_debug_enabled ())
return;
if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
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);
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);
}
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;