[sgen] Fix logging format specifiers. `t` modifier is not standard.
authorMark Probst <mark.probst@gmail.com>
Tue, 5 May 2015 22:21:58 +0000 (15:21 -0700)
committerMark Probst <mark.probst@gmail.com>
Tue, 5 May 2015 22:21:58 +0000 (15:21 -0700)
mono/metadata/sgen-mono.c
mono/sgen/sgen-debug.c
mono/sgen/sgen-los.c
mono/sgen/sgen-marksweep.c

index 0a0090ad7821fc4aa4ecfc4253466c57dec589c1..c4d96b6fc333b8261c06ead573d2997e7ff4f746 100644 (file)
@@ -623,7 +623,7 @@ sgen_client_clear_unreachable_ephemerons (ScanCopyContext ctx)
                        if (!key || key == tombstone)
                                continue;
 
-                       SGEN_LOG (5, "[%td] key %p (%s) value %p (%s)", cur - mono_array_addr (array, Ephemeron, 0),
+                       SGEN_LOG (5, "[%zd] key %p (%s) value %p (%s)", cur - mono_array_addr (array, Ephemeron, 0),
                                key, sgen_is_object_alive_for_current_gen (key) ? "reachable" : "unreachable",
                                cur->value, cur->value && sgen_is_object_alive_for_current_gen (cur->value) ? "reachable" : "unreachable");
 
@@ -677,7 +677,7 @@ sgen_client_mark_ephemerons (ScanCopyContext ctx)
                        if (!key || key == tombstone)
                                continue;
 
-                       SGEN_LOG (5, "[%td] key %p (%s) value %p (%s)", cur - mono_array_addr (array, Ephemeron, 0),
+                       SGEN_LOG (5, "[%zd] key %p (%s) value %p (%s)", cur - mono_array_addr (array, Ephemeron, 0),
                                key, sgen_is_object_alive_for_current_gen (key) ? "reachable" : "unreachable",
                                cur->value, cur->value && sgen_is_object_alive_for_current_gen (cur->value) ? "reachable" : "unreachable");
 
@@ -2270,13 +2270,13 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p
        FOREACH_THREAD (info) {
                int skip_reason = 0;
                if (info->client_info.skip) {
-                       SGEN_LOG (3, "Skipping dead thread %p, range: %p-%p, size: %td", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start);
+                       SGEN_LOG (3, "Skipping dead thread %p, range: %p-%p, size: %zd", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start);
                        skip_reason = 1;
                } else if (info->client_info.gc_disabled) {
-                       SGEN_LOG (3, "GC disabled for thread %p, range: %p-%p, size: %td", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start);
+                       SGEN_LOG (3, "GC disabled for thread %p, range: %p-%p, size: %zd", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start);
                        skip_reason = 2;
                } else if (!mono_thread_info_is_live (info)) {
-                       SGEN_LOG (3, "Skipping non-running thread %p, range: %p-%p, size: %td (state %x)", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start, info->client_info.info.thread_state);
+                       SGEN_LOG (3, "Skipping non-running thread %p, range: %p-%p, size: %zd (state %x)", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start, info->client_info.info.thread_state);
                        skip_reason = 3;
                }
 
@@ -2286,7 +2286,7 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p
                        continue;
 
                g_assert (info->client_info.suspend_done);
-               SGEN_LOG (3, "Scanning thread %p, range: %p-%p, size: %td, pinned=%zd", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start, sgen_get_pinned_count ());
+               SGEN_LOG (3, "Scanning thread %p, range: %p-%p, size: %zd, pinned=%zd", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start, sgen_get_pinned_count ());
                if (mono_gc_get_gc_callbacks ()->thread_mark_func && !conservative_stack_mark) {
                        mono_gc_get_gc_callbacks ()->thread_mark_func (info->client_info.runtime_data, info->client_info.stack_start, info->client_info.stack_end, precise, &ctx);
                } else if (!precise) {
index e713a81647959d6aac28940a7bbbdf80750777ee..953570678454ec08d02e34d2a33cadf3cb676440 100644 (file)
@@ -168,7 +168,7 @@ static gboolean missing_remsets;
        if (*(ptr) && sgen_ptr_in_nursery ((char*)*(ptr))) { \
                if (!sgen_get_remset ()->find_address ((char*)(ptr)) && !sgen_cement_lookup (*(ptr))) { \
                        GCVTable *__vt = SGEN_LOAD_VTABLE ((obj));      \
-                       SGEN_LOG (0, "Oldspace->newspace reference %p at offset %td in object %p (%s.%s) not found in remsets.", *(ptr), (char*)(ptr) - (char*)(obj), (obj), sgen_client_vtable_get_namespace (__vt), sgen_client_vtable_get_name (__vt)); \
+                       SGEN_LOG (0, "Oldspace->newspace reference %p at offset %zd in object %p (%s.%s) not found in remsets.", *(ptr), (char*)(ptr) - (char*)(obj), (obj), sgen_client_vtable_get_namespace (__vt), sgen_client_vtable_get_name (__vt)); \
                        binary_protocol_missing_remset ((obj), __vt, (int) ((char*)(ptr) - (char*)(obj)), *(ptr), (gpointer)LOAD_VTABLE(*(ptr)), object_is_pinned (*(ptr))); \
                        if (!object_is_pinned (*(ptr)))                                                         \
                                missing_remsets = TRUE;                                                                 \
@@ -230,7 +230,7 @@ is_major_or_los_object_marked (char *obj)
        if (*(ptr) && !sgen_ptr_in_nursery ((char*)*(ptr)) && !is_major_or_los_object_marked ((char*)*(ptr))) { \
                if (!sgen_get_remset ()->find_address_with_cards (start, cards, (char*)(ptr))) { \
                        GCVTable *__vt = SGEN_LOAD_VTABLE ((obj));      \
-                       SGEN_LOG (0, "major->major reference %p at offset %td in object %p (%s.%s) not found in remsets.", *(ptr), (char*)(ptr) - (char*)(obj), (obj), sgen_client_vtable_get_namespace (__vt), sgen_client_vtable_get_name (__vt)); \
+                       SGEN_LOG (0, "major->major reference %p at offset %zd in object %p (%s.%s) not found in remsets.", *(ptr), (char*)(ptr) - (char*)(obj), (obj), sgen_client_vtable_get_namespace (__vt), sgen_client_vtable_get_name (__vt)); \
                        binary_protocol_missing_remset ((obj), __vt, (int) ((char*)(ptr) - (char*)(obj)), *(ptr), (gpointer)LOAD_VTABLE(*(ptr)), object_is_pinned (*(ptr))); \
                        missing_remsets = TRUE;                         \
                }                                                                                                                               \
@@ -389,7 +389,7 @@ describe_nursery_ptr (char *ptr, gboolean need_setup)
                if (obj == ptr)
                        SGEN_LOG (0, "nursery-ptr %p", obj);
                else
-                       SGEN_LOG (0, "nursery-ptr %p (interior-ptr offset %td)", obj, ptr - obj);
+                       SGEN_LOG (0, "nursery-ptr %p (interior-ptr offset %zd)", obj, ptr - obj);
                return obj;
        }
 }
@@ -414,7 +414,7 @@ bad_pointer_spew (char *obj, char **slot)
        char *ptr = *slot;
        GCVTable *vtable = (GCVTable*)LOAD_VTABLE (obj);
 
-       SGEN_LOG (0, "Invalid object pointer %p at offset %td in object %p (%s.%s):", ptr,
+       SGEN_LOG (0, "Invalid object pointer %p at offset %zd in object %p (%s.%s):", ptr,
                        (char*)slot - obj,
                        obj, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
        describe_pointer (ptr, FALSE);
@@ -427,7 +427,7 @@ missing_remset_spew (char *obj, char **slot)
        char *ptr = *slot;
        GCVTable *vtable = (GCVTable*)LOAD_VTABLE (obj);
 
-       SGEN_LOG (0, "Oldspace->newspace reference %p at offset %td in object %p (%s.%s) not found in remsets.",
+       SGEN_LOG (0, "Oldspace->newspace reference %p at offset %zd in object %p (%s.%s) not found in remsets.",
                        ptr, (char*)slot - obj, obj, 
                        sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
 
@@ -724,7 +724,7 @@ static gboolean scan_object_for_specific_ref_precise = TRUE;
 #define HANDLE_PTR(ptr,obj) do {                                       \
                if ((GCObject*)*(ptr) == key) {                         \
                        GCVTable *vtable = SGEN_LOAD_VTABLE (*(ptr));   \
-                       g_print ("found ref to %p in object %p (%s.%s) at offset %td\n", \
+                       g_print ("found ref to %p in object %p (%s.%s) at offset %zd\n", \
                                        key, (obj), sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable), ((char*)(ptr) - (char*)(obj))); \
                }                                                       \
        } while (0)
@@ -747,7 +747,7 @@ scan_object_for_specific_ref (char *start, GCObject *key)
                for (i = 0; i < size / sizeof (mword); ++i) {
                        if (words [i] == (mword)key) {
                                GCVTable *vtable = SGEN_LOAD_VTABLE (start);
-                               g_print ("found possible ref to %p in object %p (%s.%s) at offset %td\n",
+                               g_print ("found possible ref to %p in object %p (%s.%s) at offset %zd\n",
                                                key, start, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable), i * sizeof (mword));
                        }
                }
@@ -1055,7 +1055,7 @@ static FILE *heap_dump_file = NULL;
 void
 sgen_dump_occupied (char *start, char *end, char *section_start)
 {
-       fprintf (heap_dump_file, "<occupied offset=\"%td\" size=\"%td\"/>\n", start - section_start, end - start);
+       fprintf (heap_dump_file, "<occupied offset=\"%zd\" size=\"%zd\"/>\n", start - section_start, end - start);
 }
 
 void
index 8ec09c5cf7bdf95ccddf1d2dd76ff8ecaab05b86..dcc742aceda2bd28c781fc89f89eba809670c801 100644 (file)
@@ -557,7 +557,7 @@ mono_sgen_los_describe_pointer (char *ptr)
                if (obj->data == ptr) {
                        SGEN_LOG (0, "%s (size %d pin %d)\n", los_kind, (int)size, pinned ? 1 : 0);
                } else {
-                       SGEN_LOG (0, "%s (interior-ptr offset %td size %d pin %d)",
+                       SGEN_LOG (0, "%s (interior-ptr offset %zd size %d pin %d)",
                                          los_kind, ptr - obj->data, (int)size, pinned ? 1 : 0);
                }
 
index cbc80648531afa535e6a2776a818e2788f3b7302..8ad7c5a147d6c02448ebfe617ea2a6e98492d999 100644 (file)
@@ -959,9 +959,9 @@ major_describe_pointer (char *ptr)
                                SGEN_LOG (0, "dead-object");
                } else {
                        if (live)
-                               SGEN_LOG (0, "interior-ptr offset %td", ptr - obj);
+                               SGEN_LOG (0, "interior-ptr offset %zd", ptr - obj);
                        else
-                               SGEN_LOG (0, "dead-interior-ptr offset %td", ptr - obj);
+                               SGEN_LOG (0, "dead-interior-ptr offset %zd", ptr - obj);
                }
 
                SGEN_LOG (0, " marked %d)\n", marked ? 1 : 0);