Beispiel #1
0
void
MR_mkdettempframe_msg(FILE *fp)
{
    MR_restore_transient_registers();

    if (!MR_lld_print_enabled) {
        return;
    }

    fprintf(fp, "\nnew det temp nondet frame");
    fprintf(fp, "\nnew  fr: ");
    MR_printnondetstack(fp, MR_maxfr);
    fprintf(fp, "\nprev fr: ");
    MR_printnondetstack(fp, MR_prevfr_slot(MR_maxfr));
    fprintf(fp, "\nredo fr: ");
    MR_printnondetstack(fp, MR_redofr_slot(MR_maxfr));
    fprintf(fp, "\nredo ip: ");
    MR_printlabel(fp, MR_redoip_slot(MR_maxfr));
    fprintf(fp, "det fr:  ");
    MR_printdetstack(fp, MR_tmp_detfr_slot(MR_maxfr));
    fprintf(fp, "\n");

    if (MR_detaildebug) {
        MR_dumpnondetstack(fp);
    }
}
Beispiel #2
0
void
MR_agc_dump_nondet_stack_frames(MR_Internal *label, MR_MemoryZone *heap_zone,
    MR_Word *stack_pointer, MR_Word *current_frame, MR_Word *max_frame)
{
    MR_Code     *success_ip;
    int         frame_size;
    MR_bool     registers_valid;

    while (max_frame > MR_nondet_stack_trace_bottom_fr) {
        registers_valid = (max_frame == current_frame);

        frame_size = max_frame - MR_prevfr_slot(max_frame);
        if (frame_size == MR_NONDET_TEMP_SIZE) {
            fprintf(stderr, "%p: nondet temp\n", max_frame);
            fprintf(stderr, " redoip: ");
            fflush(NULL);
            MR_printlabel(stderr, MR_redoip_slot(max_frame));
            fflush(NULL);
            fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));

            label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));

            if (label && label->MR_internal_layout) {
                MR_dump_live_variables(label->MR_internal_layout, heap_zone,
                    registers_valid, stack_pointer, MR_redofr_slot(max_frame));
            }

        } else if (frame_size == MR_DET_TEMP_SIZE) {
            fprintf(stderr, "%p: nondet temp\n", max_frame);
            fprintf(stderr, " redoip: ");
            fflush(NULL);
            MR_printlabel(stderr, MR_redoip_slot(max_frame));
            fflush(NULL);
            fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
            fprintf(stderr, " detfr:  %p\n", MR_tmp_detfr_slot(max_frame));

            label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));

            if (label && label->MR_internal_layout) {
                MR_dump_live_variables(label->MR_internal_layout, heap_zone,
                    registers_valid, MR_tmp_detfr_slot(max_frame), max_frame);
                // XXX Should max_frame above be
                // MR_redoip_slot(max_frame) instead?

            }

        } else {
            fprintf(stderr, "%p: nondet ordinary\n", max_frame);
            fprintf(stderr, " redoip: ");
            fflush(NULL);
            MR_printlabel(stderr, MR_redoip_slot(max_frame));
            fflush(NULL);
            fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
            fprintf(stderr, " succip: ");
            fflush(NULL);
            MR_printlabel(stderr, MR_succip_slot(max_frame));
            fflush(NULL);
            fprintf(stderr, " succfr: %p\n", MR_succfr_slot(max_frame));

            // XXX ???
            label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));

            if (label != NULL && label->MR_internal_layout) {
                MR_dump_live_variables(label->MR_internal_layout, heap_zone,
                    registers_valid, stack_pointer, MR_redofr_slot(max_frame));
                fprintf(stderr, " this label: %s\n", label->MR_internal_name);
            }
        }

        max_frame = MR_prevfr_slot(max_frame);
    }

    // XXX Lookup the address (redoip?) and dump the variables.

    fflush(NULL);
}