pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:873: Inside #if defined(PIKE_DEBUG)
   get_opcode_name(instr),    Pike_sp-Pike_interpreter.evaluator_stack,    Pike_mark_sp-Pike_interpreter.mark_stack);    free_string(filep2);       printf("pro: %p, %p %p, %p\n", bp_prog, Pike_fp->context->prog, bp_offset, Pike_fp->pc - Pike_fp->context->prog->program);    }   */       -  -  if((stepping_mode != 0 && stepping_thread == th_self()) || ((Pike_fp->context->prog == bp_prog) && (bp_offset == (Pike_fp->pc - Pike_fp->context->prog->program)))) { -  printf("got a match!\n"); -  stepping_thread = th_self(); -  -  if(debugger_server == NULL) { -  +     /* This block performs the actual breakpoint/step behavior */    if((IS_THREAD_STEPPING(th_state)) || (bp = Pike_fp->context->prog->breakpoints) != NULL ) {    INT_TYPE linep;    struct pike_string * linefile = get_line(Pike_fp->pc,    Pike_fp->context->prog,    &linep);    printf("linep: %s:%d\n", linefile->str, linep);    printf("pro: %p, %p %p, %p\n", bp_prog, Pike_fp->context->prog, bp_offset, Pike_fp->pc - Pike_fp->context->prog->program);       int pause_here = 0;
pike.git/src/interpret.c:916: Inside #if defined(PIKE_DEBUG)
   SAFE_APPLY_MASTER("resolv", 1 );       // look up the function    safe_apply_svalue(Pike_sp-1, 0, 1);       if(TYPEOF(Pike_sp[-1]) != T_FUNCTION) {    Pike_error("Could not get debugger for breakpoint.\n");    }       // TODO check we actually got the memory. -  debugger_server = malloc(sizeof(struct svalue)); +  debugger_server = *(struct svalue *)malloc(sizeof(struct svalue));    -  assign_svalue_no_free((debugger_server), Pike_sp-1); -  add_ref_svalue((debugger_server)); +  assign_svalue_no_free((&debugger_server), Pike_sp-1); +  add_ref_svalue(&debugger_server);       pop_stack();    pop_stack();    }       filep = get_line(Pike_fp->pc,Pike_fp->context->prog,&linep);       ref_push_string(filep);    push_int(linep);    push_text(get_opcode_name(instr));       ref_push_object(Pike_fp->current_object);    -  f_debug_backtrace(0); -  //printf("applying\n"); +  f_cq___debug_backtrace(0);       // we don't want to step though any of the do_breakpoint() instructions that actually wake up the debugger.    // this seems safe for the basic scenario, but perhaps we should do this on another thread altogether?    th_state->stepping_mode = 0; -  safe_apply_svalue(&debugger_server, 5, 1); +     -  safe_apply_svalue(debugger_server, 5, 1); +  safe_apply_svalue(&debugger_server, 5, 1);    //printf("applied\n");    if(TYPEOF(*(Pike_sp - 1)) != T_INT)    {    pop_stack();    Pike_error("Wrong return type from debug callback.\n");    } else {    debug_retval = (*(Pike_sp - 1)).u.integer;    }    pop_stack();       if(debug_retval == 1) // single_step    { -  //printf("debug_retval: %d\n", debug_retval); -  stepping_mode = 1; // single_step +  th_state->stepping_mode = 1;    } else { -  stepping_mode = 0; -  stepping_thread = 0; +  th_state->stepping_mode = 0;    }    }       }   #endif /* PIKE_DEBUG */          if(Pike_interpreter.trace_level > 2)    {    char *file = NULL, *f;