Branch: Tag:

2019-02-06

2019-02-06 22:33:19 by William Welliver <william@welliver.org>

debugger: backtrace frame can now access and set locals when created by the debugger.

879: Inside #if defined(PIKE_DEBUG)
   }   */    +  +  +  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;
914: Inside #if defined(PIKE_DEBUG)
   Pike_error("Could not get debugger for breakpoint.\n");    }    -  assign_svalue(&debugger_server, Pike_sp-1); +  // TODO check we actually got the memory. +  debugger_server = malloc(sizeof(struct svalue));    -  +  assign_svalue_no_free((debugger_server), Pike_sp-1); +  add_ref_svalue((debugger_server)); +     pop_stack();    pop_stack();    }
928: Inside #if defined(PIKE_DEBUG)
      ref_push_object(Pike_fp->current_object);    -  f_cq___debug_backtrace(0); +  f_debug_backtrace(0); +  //printf("applying\n");       // 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); +  //printf("applied\n");    if(TYPEOF(*(Pike_sp - 1)) != T_INT)    {    pop_stack();
946: Inside #if defined(PIKE_DEBUG)
      if(debug_retval == 1) // single_step    { -  th_state->stepping_mode = 1; +  //printf("debug_retval: %d\n", debug_retval); +  stepping_mode = 1; // single_step    } else { -  th_state->stepping_mode = 0; +  stepping_mode = 0; +  stepping_thread = 0;    }    }