diff options
Diffstat (limited to 'blacklst.c')
-rw-r--r-- | blacklst.c | 36 |
1 files changed, 16 insertions, 20 deletions
@@ -64,24 +64,26 @@ GC_INNER void GC_default_print_heap_obj_proc(ptr_t p) GC_INNER void (*GC_print_heap_obj)(ptr_t p) = GC_default_print_heap_obj_proc; #ifdef PRINT_BLACK_LIST -STATIC void GC_print_source_ptr(ptr_t p) -{ - ptr_t base = GC_base(p); + STATIC void GC_print_blacklisted_ptr(word p, ptr_t source, + const char *kind_str) + { + ptr_t base = GC_base(source); + if (0 == base) { - if (0 == p) { - GC_err_printf("in register"); - } else { - GC_err_printf("in root set"); - } + GC_err_printf("Black listing (%s) %p referenced from %p in %s\n", + kind_str, (ptr_t)p, source, + NULL != source ? "root set" : "register"); } else { - GC_err_printf("in object at "); /* FIXME: We can't call the debug version of GC_print_heap_obj */ /* (with PRINT_CALL_CHAIN) here because the lock is held and */ /* the world is stopped. */ - GC_default_print_heap_obj_proc(base); + GC_err_printf("Black listing (%s) %p referenced from %p in" + " object at %p of appr. %lu bytes\n", + kind_str, (ptr_t)p, source, + base, (unsigned long)GC_size(base)); } -} -#endif + } +#endif /* PRINT_BLACK_LIST */ GC_INNER void GC_bl_init_no_interiors(void) { @@ -183,10 +185,7 @@ GC_INNER void GC_unpromote_black_lists(void) if (HDR(p) == 0 || get_pht_entry_from_index(GC_old_normal_bl, index)) { # ifdef PRINT_BLACK_LIST if (!get_pht_entry_from_index(GC_incomplete_normal_bl, index)) { - GC_err_printf("Black listing (normal) %p referenced from %p ", - (ptr_t)p, source); - GC_print_source_ptr(source); - GC_err_puts("\n"); + GC_print_blacklisted_ptr(p, source, "normal"); } # endif set_pht_entry_from_index(GC_incomplete_normal_bl, index); @@ -207,10 +206,7 @@ GC_INNER void GC_unpromote_black_lists(void) if (HDR(p) == 0 || get_pht_entry_from_index(GC_old_stack_bl, index)) { # ifdef PRINT_BLACK_LIST if (!get_pht_entry_from_index(GC_incomplete_stack_bl, index)) { - GC_err_printf("Black listing (stack) %p referenced from %p ", - (ptr_t)p, source); - GC_print_source_ptr(source); - GC_err_puts("\n"); + GC_print_blacklisted_ptr(p, source, "stack"); } # endif set_pht_entry_from_index(GC_incomplete_stack_bl, index); |