pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:831:   #endif    ptrdiff_t stack;    ptrdiff_t mark_stack;   };      struct backlog backlog[BACKLOG];   int backlogp=BACKLOG-1;         // begining of debugging state. we obviously will need better data structures for this. - THREAD_T stepping_thread = NULL; +    int stepping_mode = 0; -  + THREAD_T stepping_thread = NULL; + #define IS_THREAD_STEPPING(A) (stepping_thread == A)   struct svalue debugger_server = SVALUE_INIT_FREE;      static inline void low_debug_instr_prologue (PIKE_INSTR_T instr)   {    struct debug_breakpoint * bp;    struct pike_string *filep;    INT_TYPE linep;    int debug_retval = 0;   #ifdef PIKE_DEBUG -  if((stepping_mode != 0 && stepping_thread == th_self()) || (bp = Pike_fp->context->prog->breakpoints) != NULL) +  /* This block exists solely to print some debug when we execute opcodes in a thread that's stepping, +  or a program that contains breakpoints. */ +  if((stepping_mode != 0 && IS_THREAD_STEPPING(th_self())) || (bp = Pike_fp->context->prog->breakpoints) != NULL)    {    char *file = NULL, *f;    struct pike_string *filep2;       printf("stepping_mode: %d, stepping_thread: %p\n", stepping_mode, stepping_thread);    filep2 = get_line(Pike_fp->pc,Pike_fp->context->prog,&linep);    if (filep2 && !filep2->size_shift) {    file = filep2->str;    while((f=strchr(file,'/')))    file=f+1;
pike.git/src/interpret.c:866: Inside #if defined(PIKE_DEBUG)
   file ? file : "-",(long)linep,    Pike_fp->pc, Pike_fp->pc - Pike_fp->context->prog->program,    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()) || bp != NULL ) { +  /* This block performs the actual breakpoint/step behavior */ +  if((stepping_mode != 0 && IS_THREAD_STEPPING(th_self())) || bp != NULL ) {    int pause_here = 0;    if(stepping_mode != 0) {    pause_here = 1;    } else {    while(bp != NULL) {    if(bp->offset == (Pike_fp->pc - Pike_fp->context->prog->program)) {    pause_here = 1;    break;    }    bp = bp->next;