Branch: Tag:

2018-12-03

2018-12-03 02:23:15 by William Welliver <william@welliver.org>

debugger: start preparing for multi-thread stepping

838:         // 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)
849:    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;
873: Inside #if defined(PIKE_DEBUG)
   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;