Skip to content

Commit

Permalink
Handle the options added by options.h in mono_jit_parse_options ().
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed Mar 23, 2022
1 parent 8fa3786 commit 3a7d049
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/mono/mono/mini/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,11 +1771,23 @@ parse_qualified_method_name (char *method_name)
void
mono_jit_parse_options (int argc, char * argv[])
{
ERROR_DECL (error);
int i;
char *trace_options = NULL;
int mini_verbose_level = 0;
guint32 opt;

/* Make a copy since mono_options_parse_options () modifies argv */
char **copy_argv = g_new0 (char*, argc);
memcpy (copy_argv, argv, sizeof (char*) * argc);
argv = copy_argv;

mono_options_parse_options ((const char**)argv, argc, &argc, error);
if (!is_ok (error)) {
g_printerr ("%s", mono_error_get_message (error));
mono_error_cleanup (error);
}

/*
* Some options have no effect here, since they influence the behavior of
* mono_main ().
Expand Down Expand Up @@ -1864,6 +1876,9 @@ mono_jit_parse_options (int argc, char * argv[])

if (mini_verbose_level)
mono_set_verbose_level (mini_verbose_level);

/* Free the copy */
g_free (argv);
}

static void
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/utils/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ mono_options_print_usage (void)
}

/*
* mono_optiond_parse_options:
* mono_options_parse_options:
*
* Set options based on the command line arguments in ARGV/ARGC.
* Remove processed arguments from ARGV and set *OUT_ARGC to the
Expand Down

0 comments on commit 3a7d049

Please sign in to comment.