[profiler] Add an exception object field to TYPE_CLAUSE.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Sun, 18 Jun 2017 03:47:43 +0000 (05:47 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Mon, 19 Jun 2017 22:31:16 +0000 (00:31 +0200)
mono/profiler/log.c
mono/profiler/mprof-report.c

index 223bdb008b1af4f51152f211dc78d04a0a206868..ce507bdcb1b820848a374a8df32e8c921bf4b935 100644 (file)
@@ -2099,7 +2099,7 @@ throw_exc (MonoProfiler *prof, MonoObject *object)
 }
 
 static void
-clause_exc (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_num)
+clause_exc (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_num, MonoObject *exc)
 {
        ENTER_LOG (&exception_clauses_ctr, logbuffer,
                EVENT_SIZE /* event */ +
@@ -2112,6 +2112,7 @@ clause_exc (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_
        emit_byte (logbuffer, clause_type);
        emit_value (logbuffer, clause_num);
        emit_method (logbuffer, method);
+       emit_obj (logbuffer, exc);
 
        EXIT_LOG;
 }
@@ -4697,7 +4698,8 @@ mono_profiler_startup (const char *desc)
 
        if (config.effective_mask & PROFLOG_EXCEPTION_EVENTS) {
                events |= MONO_PROFILE_EXCEPTIONS;
-               mono_profiler_install_exception (throw_exc, method_exc_leave, clause_exc);
+               mono_profiler_install_exception (throw_exc, method_exc_leave, NULL);
+               mono_profiler_install_exception_clause (clause_exc);
        }
 
        if (config.effective_mask & PROFLOG_ALLOCATION_EVENTS) {
index 407da0637593c9de276661d97b62bda7165716d1..1e60ec50a6ee06b24c8187e7acaf237431dbe526 100644 (file)
@@ -2828,6 +2828,8 @@ decode_buffer (ProfContext *ctx)
                                int clause_num = decode_uleb128 (p, &p);
                                int64_t ptrdiff = decode_sleb128 (p, &p);
                                method_base += ptrdiff;
+                               if (ctx->data_version > 13)
+                                       decode_uleb128 (p, &p); // exception object
                                if (record)
                                        clause_summary [clause_type]++;
                                if (debug)