2009-07-01 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / driver.c
index 36e0b764eb4a6d98f3404f370cb5e7ec939c3731..7f2a70415d90235ad481ad21ba4fd28d97af1c29 100644 (file)
@@ -55,6 +55,7 @@
 #include <ctype.h>
 #include <locale.h>
 #include "version.h"
+#include "debugger-agent.h"
 
 static FILE *mini_stats_fd = NULL;
 
@@ -1105,6 +1106,7 @@ mini_usage (void)
                "Development:\n"
                "    --aot                  Compiles the assembly to native code\n"
                "    --debug[=<options>]    Enable debugging support, use --help-debug for details\n"
+               "    --debugger-agent=options Enable the debugger agent\n"
                "    --profile[=profiler]   Runs in profiling mode with the specified profiler module\n"
                "    --trace[=EXPR]         Enable tracing, use --help-trace for details\n"
                "    --help-devel           Shows more options available to developers\n"
@@ -1283,7 +1285,7 @@ mono_main (int argc, char* argv[])
                        mini_verbose++;
                } else if (strcmp (argv [i], "--version") == 0 || strcmp (argv [i], "-V") == 0) {
                        char *build = mono_get_runtime_build_info ();
-                       g_print ("Mono JIT compiler version %s (%s)\nCopyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com\n", VERSION, build);
+                       g_print ("Mono JIT compiler version %s (%s)\nCopyright (C) 2002-2009 Novell, Inc and Contributors. www.mono-project.com\n", VERSION, build);
                        g_free (build);
                        g_print (info);
                        if (mini_verbose) {
@@ -1441,6 +1443,12 @@ mono_main (int argc, char* argv[])
                        enable_debugging = TRUE;
                        if (!parse_debug_options (argv [i] + 8))
                                return 1;
+               } else if (strncmp (argv [i], "--debugger-agent=", 17) == 0) {
+                       MonoDebugOptions *opt = mini_get_debug_options ();
+
+                       mono_debugger_agent_parse_options (argv [i] + 17);
+                       opt->mdb_optimizations = TRUE;
+                       enable_debugging = TRUE;
                } else if (strcmp (argv [i], "--security") == 0) {
                        mono_verifier_set_mode (MONO_VERIFIER_MODE_VERIFIABLE);
                        mono_security_set_mode (MONO_SECURITY_MODE_CAS);
@@ -1512,6 +1520,10 @@ mono_main (int argc, char* argv[])
                   fprintf (stderr, "This mono runtime is compiled for cross-compiling. Only the --aot option is supported.");
                   exit (1);
        }
+#if SIZEOF_VOID_P == 8 && defined(TARGET_ARM)
+       fprintf (stderr, "Can't cross-compile on 64 bit platforms to arm.\n");
+       exit (1);
+#endif
 #endif
 
        if ((action == DO_EXEC) && mono_debug_using_mono_debugger ())