Exemple #1
0
static boolean
cs_valid_pointer_p(struct call_frame *pointer)
{
    struct thread *thread=arch_os_get_current_thread();
    return (((char *) thread->control_stack_start <= (char *) pointer) &&
            ((char *) pointer < (char *) access_control_stack_pointer(thread)));
}
Exemple #2
0
lispobj
funcall0(lispobj function)
{
    lispobj **stack_pointer
        = &access_control_stack_pointer(arch_os_get_current_thread());
    lispobj *args = *stack_pointer;

    return safe_call_into_lisp(function, args, 0);
}
Exemple #3
0
lispobj
funcall1(lispobj function, lispobj arg0)
{
    lispobj **stack_pointer
        = &access_control_stack_pointer(arch_os_get_current_thread());
    lispobj *args = *stack_pointer;

    *stack_pointer += 1;
    args[0] = arg0;

    return safe_call_into_lisp(function, args, 1);
}
Exemple #4
0
lispobj
funcall3(lispobj function, lispobj arg0, lispobj arg1, lispobj arg2)
{
    lispobj **stack_pointer
        = &access_control_stack_pointer(arch_os_get_current_thread());
    lispobj *args = *stack_pointer;

    *stack_pointer += 3;
    args[0] = arg0;
    args[1] = arg1;
    args[2] = arg2;

    return safe_call_into_lisp(function, args, 3);
}
Exemple #5
0
static void
regs_cmd(char **ptr)
{
    struct thread *thread=arch_os_get_current_thread();

    printf("CSP\t=\t%p   ", access_control_stack_pointer(thread));
#if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
    printf("CFP\t=\t%p   ", access_control_frame_pointer(thread));
#endif

#ifdef reg_BSP
    printf("BSP\t=\t%p\n", get_binding_stack_pointer(thread));
#else
    /* printf("BSP\t=\t0x%08lx\n",
           (unsigned long)SymbolValue(BINDING_STACK_POINTER)); */
    printf("\n");
#endif

#ifdef LISP_FEATURE_GENCGC
    /* printf("DYNAMIC\t=\t0x%08lx\n", DYNAMIC_SPACE_START); */
#else
    printf("STATIC\t=\t%p   ",
           SymbolValue(STATIC_SPACE_FREE_POINTER, thread));
    printf("RDONLY\t=\t0x%08lx   ",
           (unsigned long)SymbolValue(READ_ONLY_SPACE_FREE_POINTER, thread));
    printf("DYNAMIC\t=\t0x%08lx\n", (unsigned long)current_dynamic_space);
#endif

#ifdef reg_ALLOC
    printf("ALLOC\t=\t0x%08lx\n", (unsigned long)dynamic_space_free_pointer);
#else
    printf("ALLOC\t=\t0x%08lx\n",
           (unsigned long)SymbolValue(ALLOCATION_POINTER, thread));
#endif

#ifndef LISP_FEATURE_GENCGC
    printf("TRIGGER\t=\t0x%08lx\n", (unsigned long)current_auto_gc_trigger);
#endif
}
void
sigtrap_handler(int signal, siginfo_t *info, os_context_t *context)
{
    unsigned int trap;

    if (single_stepping) {
        restore_breakpoint_from_single_step(context);
        return;
    }

    /* This is just for info in case the monitor wants to print an
     * approximation. */
    access_control_stack_pointer(arch_os_get_current_thread()) =
        (lispobj *)*os_context_sp_addr(context);

    /* On entry %eip points just after the INT3 byte and aims at the
     * 'kind' value (eg trap_Cerror). For error-trap and Cerror-trap a
     * number of bytes will follow, the first is the length of the byte
     * arguments to follow. */
    trap = *(unsigned char *)(*os_context_pc_addr(context));

    handle_trap(context, trap);
}