[sdb] Avoid marking seq points as nonempty-stack if they have a sym seq point. Fix...
authorZoltan Varga <vargaz@gmail.com>
Thu, 4 Jun 2015 20:45:09 +0000 (16:45 -0400)
committerZoltan Varga <vargaz@gmail.com>
Thu, 4 Jun 2015 20:45:46 +0000 (16:45 -0400)
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mono/mini/method-to-ir.c
mono/mini/mini-codegen.c
mono/mini/seq-points.c

index b6baca8a5189ca2c374dae5e8109ff1960a56f9e..e51cdc061a0accf8d07308fa4bbf81ffa194a440 100644 (file)
@@ -526,7 +526,11 @@ public class DebuggerTests
                e = step_over ();
                assert_location (e, "ss_nested");
                e = step_into ();
-               assert_location (e, "ss_nested_3");
+               assert_location (e, "ss_nested_1");
+               e = step_into ();
+               assert_location (e, "ss_nested_1");
+               e = step_into ();
+               assert_location (e, "ss_nested");
                req.Disable ();
 
                // Check DebuggerStepThrough support
index ef3d57a92088ee3f3a0a3f2d608bc20757b2ae2c..d27e1fda45c473ac244f5078f8090db9d79f94dc 100644 (file)
@@ -8190,12 +8190,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                         * Backward branches are handled at the end of method-to-ir ().
                         */
                        gboolean intr_loc = ip == header->code || (!cfg->cbb->last_ins && cfg->header->num_clauses);
+                       gboolean sym_seq_point = sym_seq_points && mono_bitset_test_fast (seq_point_locs, ip - header->code);
 
                        /* Avoid sequence points on empty IL like .volatile */
                        // FIXME: Enable this
                        //if (!(cfg->cbb->last_ins && cfg->cbb->last_ins->opcode == OP_SEQ_POINT)) {
                        NEW_SEQ_POINT (cfg, ins, ip - header->code, intr_loc);
-                       if (sp != stack_start)
+                       if ((sp != stack_start) && !sym_seq_point)
                                ins->flags |= MONO_INST_NONEMPTY_STACK;
                        MONO_ADD_INS (cfg->cbb, ins);
 
index e1914885b60d9622b911459bfb7dba53d8284e75..4fde10b791fabbd369962c611d37f097cb6000d4 100644 (file)
@@ -702,7 +702,7 @@ mono_print_ins_index (int i, MonoInst *ins)
                break;
        case OP_IL_SEQ_POINT:
        case OP_SEQ_POINT:
-               printf (" il: %x", (int)ins->inst_imm);
+               printf (" il: 0x%x%s", (int)ins->inst_imm, ins->flags & MONO_INST_NONEMPTY_STACK ? ", nonempty-stack" : "");
                break;
        default:
                break;
index b2b511f0cb49347eefabf908987a7539aceaecc8..e48696334c00629dda6476ec595866a5d32ef35e 100644 (file)
@@ -98,7 +98,8 @@ mono_save_seq_point_info (MonoCompile *cfg)
                                last = ins;
                        }
 
-                       if (bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) {
+                       /* The second case handles endfinally opcodes which are in a separate bb by themselves */
+                       if ((bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) || (bb->out_count == 1 && bb->out_bb [0]->code && bb->out_bb [0]->code->opcode == OP_ENDFINALLY)) {
                                MonoBasicBlock *bb2;
                                MonoInst *endfinally_seq_point = NULL;