Пример #1
0
INLINE static int
check_breaks_gdb( struct gdb_stub_state *gdb_state,
                  struct breakpoint_gdb *bpoint_list,
                  uint32_t addr,
                  UNUSED_PARM(uint32_t size),
                  enum stop_type stop_type) {
  int found_break = 0;

  if ( gdb_state->active) {
    struct breakpoint_gdb *bpoint = bpoint_list;

    while ( bpoint != NULL && !found_break) {
      if ( addr == bpoint->addr) {
        DEBUG_LOG("Breakpoint hit at %08x\n", addr);

        /* stall the processor */
        gdb_state->cpu_ctrl->stall( gdb_state->cpu_ctrl->data);
		NDS_debug_break();


        /* indicate the break to the GDB stub thread */
        gdb_state->stop_type = stop_type;
        gdb_state->stop_address = addr;
        indicateCPUStop_gdb( gdb_state);
      }
      bpoint = bpoint->next;
    }
  }

  return found_break;
}
Пример #2
0
static void
break_execution( void *data, UNUSED_PARM(uint32_t addr), UNUSED_PARM(int thunmb)) {
  struct gdb_stub_state *stub = (struct gdb_stub_state *)data;

  /* stall the processor */
  stub->cpu_ctrl->stall( stub->cpu_ctrl->data);

  /* remove the post execution function */
  stub->cpu_ctrl->remove_post_ex_fn( stub->cpu_ctrl->data);

  /* indicate the halt */
  stub->stop_type = STOP_HOST_BREAK;
  indicateCPUStop_gdb( stub);
}
Пример #3
0
static void
step_instruction_watch( void *data, uint32_t addr, UNUSED_PARM(int thunmb)) {
  struct gdb_stub_state *stub = (struct gdb_stub_state *)data;

  DEBUG_LOG("Step watch: waiting for %08x at %08x\n", stub->step_instr_address,
      addr);

  if ( addr == stub->step_instr_address) {
    DEBUG_LOG("Step hit -> %08x\n", stub->cpu_ctrl->read_reg( stub->cpu_ctrl->data, 15));
    /* stall the processor */
    stub->cpu_ctrl->stall( stub->cpu_ctrl->data);

    /* remove the post execution function */
    stub->cpu_ctrl->remove_post_ex_fn( stub->cpu_ctrl->data);

    /* indicate the halt */
    stub->stop_type = STOP_STEP_BREAK;
    indicateCPUStop_gdb( stub);
  }
}