Ticket #1393: tt_1393_debug_prints2.diff

File tt_1393_debug_prints2.diff, 3.6 KB (added by lithos, 5 years ago)
  • src/ops/core.ops

     
    467467    Parrot_pcc_merge_signature_for_tailcall(interp, parent_call_sig, this_call_sig); 
    468468 
    469469    SUB_FLAG_TAILCALL_SET(interp->current_cont); 
     470    fprintf(stderr, "%s:%d: tailcall sub %p with continuation %p\n", 
     471            __FILE__, __LINE__, (void*)p, (void*)interp->current_cont); 
    470472    dest = VTABLE_invoke(interp, p, dest); 
    471473    goto ADDRESS(dest); 
    472474} 
  • src/pmc/retcontinuation.pmc

     
    8484 
    8585        /* recycle this PMC and make sure it doesn't get marked */ 
    8686        if (!PMC_IS_NULL(from_ctx)) 
     87        { 
     88            fprintf(stderr,"%s:%d: resetting continuation (SELF=%p) in context %p\n", 
     89                    __FILE__, __LINE__, (void*)SELF, (void*)from_ctx); 
    8790            Parrot_pcc_set_continuation(interp, from_ctx, NULL); 
     91        } 
     92        fprintf(stderr,"%s:%d: freeing myself (SELF=%p)\n", 
     93                __FILE__, __LINE__, (void*)SELF); 
    8894        Parrot_gc_free_pmc_header(interp, SELF); 
    8995 
    9096        if (INTERP->code != seg) 
  • src/pmc/sub.pmc

     
    2121#include "parrot/oplib/ops.h" 
    2222#include "sub.str" 
    2323 
     24static unsigned debug_counter = 0; 
     25 
    2426static void 
    2527print_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC *sub)) 
    2628{ 
     
    379381        ccont                = INTERP->current_cont; 
    380382        INTERP->current_cont = NULL; 
    381383 
     384        fprintf(stderr, "%d: %s:%d: sub %p invoked with ccont %p\n", 
     385                debug_counter++, __FILE__, __LINE__, (void*)SELF, (void*)ccont); 
     386 
     387#if 0 
     388        if (debug_counter-1 == 1592) 
     389            abort(); 
     390#endif 
     391 
    382392        if (ccont == NEED_CONTINUATION) 
     393        { 
    383394            ccont = new_ret_continuation_pmc(interp, (opcode_t *)next); 
     395            fprintf(stderr, "created ret continuation %p\n", (void*)ccont); 
     396        } 
    384397 
    385398        PARROT_ASSERT(!PMC_IS_NULL(ccont)); 
    386399 
     
    395408        Parrot_pcc_init_context(INTERP, context, caller_ctx); 
    396409 
    397410        Parrot_pcc_set_sub(interp, context, SELF); 
     411        fprintf(stderr, "%s:%d: setting continuation %p in context %p\n", 
     412                __FILE__, __LINE__, (void*)ccont, (void*)context); 
    398413        Parrot_pcc_set_continuation(interp, context, ccont); 
    399414        Parrot_pcc_set_constants(interp, context, sub->seg->const_table->constants); 
    400415 
  • src/gc/api.c

     
    9494#include "parrot/gc_api.h" 
    9595#include "gc_private.h" 
    9696 
     97static unsigned debug_counter = 0; 
     98 
    9799/* HEADERIZER HFILE: include/parrot/gc_api.h */ 
    98100 
    99101/* HEADERIZER BEGIN: static */ 
     
    401403    pmc->vtable         = NULL; 
    402404    PMC_data(pmc)       = NULL; 
    403405 
     406    fprintf(stderr, "%d: created pmc %p\n", debug_counter++, (void*)pmc); 
     407 
     408#if 0 
     409    if (debug_counter-1 == 28455) 
     410        abort(); 
     411#endif 
     412 
    404413    return pmc; 
    405414} 
    406415 
     
    421430    Fixed_Size_Pool * const pool = (PObj_constant_TEST(pmc)) ? 
    422431        interp->mem_pools->constant_pmc_pool : interp->mem_pools->pmc_pool; 
    423432 
     433    fprintf(stderr, "%d: free pmc %p\n", debug_counter++, (void*)pmc); 
     434 
     435#if 0 
     436    if (debug_counter-1 == 28480) 
     437        abort(); 
     438#endif 
     439 
    424440    Parrot_pmc_destroy(interp, pmc); 
    425441 
    426442    PObj_flags_SETTO((PObj *)pmc, PObj_on_free_list_FLAG);