pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:508:   PIKEFUN int set_debugger(int i)    optflags OPT_SIDE_EFFECT;   efun;    {    int tmp = enable_debugger;    enable_debugger = i;    pop_stack();    push_int(tmp);   }    -  +    PIKECLASS debug_breakpoint {       PIKEVAR program prog flags ID_PROTECTED|ID_PRIVATE;    PIKEVAR string fname flags ID_PROTECTED|ID_PRIVATE;    PIKEVAR string within_fname flags ID_PROTECTED|ID_PRIVATE;    PIKEVAR int line_number flags ID_PROTECTED|ID_PRIVATE;    PIKEVAR int enabled flags ID_PROTECTED|ID_PRIVATE;    PIKEVAR int want_enabled flags ID_PROTECTED|ID_PRIVATE;       CVAR struct debug_breakpoint * bp;
pike.git/src/builtin.cmod:628:    THIS->enabled = 1;    return 1;   #else    return 0;   #endif /* PIKE_DEBUG */    }       void low_disable_breakpoint() {    struct debug_breakpoint * bp, *pbp;    + #ifdef PIKE_DEBUG    if((THIS->prog) && (bp = (THIS->prog->breakpoints)) != NULL) {    while(bp != NULL) {    if(bp == (THIS->bp)) {    printf("found a breakpoint to free.\n");    if(bp->next && bp->prev) { // somewhere in the middle, connect the previous and next.    bp->prev->next = bp->next;    bp->next->prev = bp->prev;    } else if(bp->next) { // only next pointer: at the beginning, so make next the new first.    bp->next->prev = NULL;    THIS->prog->breakpoints = bp->next;
pike.git/src/builtin.cmod:652:    }    pbp = bp;    bp = bp->next;    free(pbp);    THIS->bp = NULL;    } else {    bp = bp->next;    }    };    } + #endif /* PIKE_DEBUG */    }       ptrdiff_t low_add_breakpoint() {    ptrdiff_t pc_offset;       // TODO: we need to develop the line search further: a file can be included multiple times within a program, and so    // in theory, a breakpoint for a line within a file could actually be multiple breakpoints. we stop at the first one.    pc_offset = low_get_offset_for_line(THIS->prog, THIS->fname, THIS->line_number);    if(!pc_offset) return -1;    return pc_offset;