2008-01-24 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 24 Jan 2008 16:29:01 +0000 (16:29 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 24 Jan 2008 16:29:01 +0000 (16:29 -0000)
* driver.c (mono_main): Add a --break-at-bb command line argument for JIT
debugging.

svn path=/trunk/mono/; revision=93813

mono/mini/driver.c
mono/mini/mini.c
mono/mini/mini.h

index 4343b04bba6ffa094b92b56ff7641dd85f1fc509..ffa4b5e5e69e8cfce09248d06d007b4d6d678214 100644 (file)
@@ -898,6 +898,7 @@ mini_usage_jitdeveloper (void)
                 "Runtime and JIT debugging options:\n"
                 "    --breakonex            Inserts a breakpoint on exceptions\n"
                 "    --break METHOD         Inserts a breakpoint at METHOD entry\n"
+                "    --break-at-bb METHOD N Inserts a breakpoint in METHOD at BB N\n"
                 "    --compile METHOD       Just compile METHOD in assembly\n"
                 "    --compile-all          Compiles all the methods in the assembly\n"
                 "    --ncompile N           Number of times to compile METHOD (default: 1)\n"
@@ -1127,6 +1128,17 @@ mono_main (int argc, char* argv[])
                        
                        if (!mono_debugger_insert_breakpoint (argv [++i], FALSE))
                                fprintf (stderr, "Error: invalid method name '%s'\n", argv [i]);
+               } else if (strcmp (argv [i], "--break-at-bb") == 0) {
+                       if (i + 2 >= argc) {
+                               fprintf (stderr, "Missing method name or bb num in --break-at-bb command line option.");
+                               return 1;
+                       }
+                       mono_break_at_bb_method = mono_method_desc_new (argv [++i], TRUE);
+                       if (mono_break_at_bb_method == NULL) {
+                               fprintf (stderr, "Method name is in a bad format in --break-at-bb command line option.");
+                               return 1;
+                       }
+                       mono_break_at_bb_bb_num = atoi (argv [++i]);
                } else if (strcmp (argv [i], "--inject-async-exc") == 0) {
                        if (i + 2 >= argc) {
                                fprintf (stderr, "Missing method name or position in --inject-async-exc command line option\n");
index 7fe5cc259a636b4ea14047e615c08cdd553abcc0..849f27789c0f7cd3cd531abb9808fd38931b0000 100644 (file)
@@ -156,6 +156,8 @@ gboolean mono_compile_aot = FALSE;
 #endif
 MonoMethodDesc *mono_inject_async_exc_method = NULL;
 int mono_inject_async_exc_pos;
+MonoMethodDesc *mono_break_at_bb_method = NULL;
+int mono_break_at_bb_bb_num;
 
 static int mini_verbose = 0;
 
index cb4301863ac46321cedb6df2c02b9f96cc06cbad..320278440b287067aa572dd7fc950fd06a1bc5d5 100644 (file)
@@ -142,6 +142,9 @@ extern gboolean mono_compile_aot;
 #endif
 extern MonoMethodDesc *mono_inject_async_exc_method;
 extern int mono_inject_async_exc_pos;
+extern MonoMethodDesc *mono_break_at_bb_method;
+extern int mono_break_at_bb_bb_num;
+extern gboolean check_for_pending_exc;
 
 struct MonoInstList {
        struct MonoInstList *next, *prev;