projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #4621 from alexanderkyte/strdup_env
[mono.git]
/
mono
/
mini
/
mini-runtime.c
diff --git
a/mono/mini/mini-runtime.c
b/mono/mini/mini-runtime.c
index 656499033cf76d28962e81fe5fc2db12515c8e63..190af5cec63edf4eb598a5d9811ec21587a59e26 100644
(file)
--- 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 int count = 0;
static gboolean inited;
- static c
onst c
har *value;
+ static char *value;
count ++;
count ++;
@@
-580,10
+580,13
@@
mono_debug_count (void)
if (!value)
return TRUE;
if (!value)
return TRUE;
- if (count == atoi (value))
+ int int_val = atoi (value);
+ g_free (value);
+
+ if (count == int_val)
break_count ();
break_count ();
- if (count >
atoi (value)
)
+ if (count >
int_val
)
return FALSE;
return TRUE;
return FALSE;
return TRUE;
@@
-3208,13
+3211,14
@@
mini_parse_debug_option (const char *option)
static void
mini_parse_debug_options (void)
{
static void
mini_parse_debug_options (void)
{
- c
onst c
har *options = g_getenv ("MONO_DEBUG");
+ char *options = g_getenv ("MONO_DEBUG");
gchar **args, **ptr;
if (!options)
return;
args = g_strsplit (options, ",", -1);
gchar **args, **ptr;
if (!options)
return;
args = g_strsplit (options, ",", -1);
+ g_free (options);
for (ptr = args; ptr && *ptr; ptr++) {
const char *arg = *ptr;
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);
mono_threads_runtime_init (&ticallbacks);
- if (g_
getenv ("MONO_DEBUG") != NULL)
+ if (g_
hasenv ("MONO_DEBUG")) {
mini_parse_debug_options ();
mini_parse_debug_options ();
+ }
mono_code_manager_init ();
mono_code_manager_init ();
@@
-3624,15
+3629,16
@@
mini_init (const char *filename, const char *runtime_version)
mono_unwind_init ();
mono_unwind_init ();
- if (mini_get_debug_options ()->lldb || g_
get
env ("MONO_LLDB")) {
+ if (mini_get_debug_options ()->lldb || g_
has
env ("MONO_LLDB")) {
mono_lldb_init ("");
mono_dont_free_domains = TRUE;
}
#ifdef XDEBUG_ENABLED
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;
/* So methods for multiple domains don't have the same address */
mono_dont_free_domains = TRUE;
mono_using_xdebug = TRUE;