From 017dce9f15dcd2d857e13904e74e9fc20f3bc93b Mon Sep 17 00:00:00 2001 From: Mark Probst Date: Tue, 5 May 2015 15:21:58 -0700 Subject: [PATCH] [sgen] Fix logging format specifiers. `t` modifier is not standard. --- mono/metadata/sgen-mono.c | 12 ++++++------ mono/sgen/sgen-debug.c | 16 ++++++++-------- mono/sgen/sgen-los.c | 2 +- mono/sgen/sgen-marksweep.c | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c index 0a0090ad782..c4d96b6fc33 100644 --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@ -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) { diff --git a/mono/sgen/sgen-debug.c b/mono/sgen/sgen-debug.c index e713a816479..95357067845 100644 --- a/mono/sgen/sgen-debug.c +++ b/mono/sgen/sgen-debug.c @@ -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, "\n", start - section_start, end - start); + fprintf (heap_dump_file, "\n", start - section_start, end - start); } void diff --git a/mono/sgen/sgen-los.c b/mono/sgen/sgen-los.c index 8ec09c5cf7b..dcc742aceda 100644 --- a/mono/sgen/sgen-los.c +++ b/mono/sgen/sgen-los.c @@ -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); } diff --git a/mono/sgen/sgen-marksweep.c b/mono/sgen/sgen-marksweep.c index cbc80648531..8ad7c5a147d 100644 --- a/mono/sgen/sgen-marksweep.c +++ b/mono/sgen/sgen-marksweep.c @@ -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); -- 2.25.1