X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mono%2Fmini%2Fmini-runtime.c;h=190af5cec63edf4eb598a5d9811ec21587a59e26;hb=f704d56c378b28e252572db4730a6e13edc14aa0;hp=656499033cf76d28962e81fe5fc2db12515c8e63;hpb=222df67b5f5a9bd5e2c8da9e454b0f2883e1fe41;p=mono.git diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index 656499033cf..190af5cec63 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -568,7 +568,7 @@ mono_debug_count (void) { static int count = 0; static gboolean inited; - static const char *value; + static char *value; count ++; @@ -580,10 +580,13 @@ mono_debug_count (void) if (!value) return TRUE; - if (count == atoi (value)) + int int_val = atoi (value); + g_free (value); + + if (count == int_val) break_count (); - if (count > atoi (value)) + if (count > int_val) return FALSE; return TRUE; @@ -3208,13 +3211,14 @@ mini_parse_debug_option (const char *option) static void mini_parse_debug_options (void) { - const char *options = g_getenv ("MONO_DEBUG"); + char *options = g_getenv ("MONO_DEBUG"); gchar **args, **ptr; if (!options) return; args = g_strsplit (options, ",", -1); + g_free (options); for (ptr = args; ptr && *ptr; ptr++) { const char *arg = *ptr; @@ -3604,8 +3608,9 @@ mini_init (const char *filename, const char *runtime_version) mono_threads_runtime_init (&ticallbacks); - if (g_getenv ("MONO_DEBUG") != NULL) + if (g_hasenv ("MONO_DEBUG")) { mini_parse_debug_options (); + } mono_code_manager_init (); @@ -3624,15 +3629,16 @@ mini_init (const char *filename, const char *runtime_version) mono_unwind_init (); - if (mini_get_debug_options ()->lldb || g_getenv ("MONO_LLDB")) { + if (mini_get_debug_options ()->lldb || g_hasenv ("MONO_LLDB")) { mono_lldb_init (""); mono_dont_free_domains = TRUE; } #ifdef XDEBUG_ENABLED - if (g_getenv ("MONO_XDEBUG")) { - const char *xdebug_opts = g_getenv ("MONO_XDEBUG"); - mono_xdebug_init (xdebug_opts); + char *mono_xdebug = g_getenv ("MONO_XDEBUG"); + if (mono_xdebug) { + mono_xdebug_init (mono_xdebug); + g_free (mono_xdebug); /* So methods for multiple domains don't have the same address */ mono_dont_free_domains = TRUE; mono_using_xdebug = TRUE;