Ticket #1399: debug.patch

File debug.patch, 1.1 KB (added by kurahaupo, 12 years ago)

How the instrumenting was done

  • src/list.c

     
    183183*/ 
    184184 
    185185#include "parrot/parrot.h" 
     186#include <stdio.h> 
    186187 
    187188/* HEADERIZER HFILE: include/parrot/list.h */ 
    188189 
     
    19581959    if (list->start == 0) { 
    19591960        chunk       = add_chunk_at_start(interp, list, 0); 
    19601961        list->start = chunk->items; 
     1962        fprintf(stderr,"UNSHIFT: add chunk:\n" 
     1963                " list@%p[chunklist=[flags=%#lx start@%p len=%u] container=%p first=%p last=%p length=%lu start=%lu\n" 
     1964                "                     type=%#lx cap=%lu collect_runs=%lu n_chunks=%lu grow_policy=%d items_per_chunk=%d item_size=%u]\n" 
     1965                , (void*) list, *list); 
     1966        { List_chunk *c2; 
     1967        for ( c2 = list->first ; c2 ; c2 = c2->next ) 
     1968            fprintf(stderr, " chunk@%p[data=[flags=%#lx start@%p len=%u] next@%p prev@%p flags=%#lx items=%ld n_chunks=%ld n_items=%ld]\n" 
     1969                    , (void*) c2, *c2); 
     1970        } 
     1971        fprintf(stderr, "\n"); 
    19611972    } 
    19621973 
    19631974    /* XXX This chunk is unused.  Why are we getting it? */