Ejemplo n.º 1
0
void
mi_cmd_break_commands (char *command, char **argv, int argc)
{
  struct command_line *break_command;
  char *endptr;
  int bnum;
  struct breakpoint *b;

  if (argc < 1)
    error (_("USAGE: %s <BKPT> [<COMMAND> [<COMMAND>...]]"), command);

  bnum = strtol (argv[0], &endptr, 0);
  if (endptr == argv[0])
    error (_("breakpoint number argument \"%s\" is not a number."),
	   argv[0]);
  else if (*endptr != '\0')
    error (_("junk at the end of breakpoint number argument \"%s\"."),
	   argv[0]);

  b = get_breakpoint (bnum);
  if (b == NULL)
    error (_("breakpoint %d not found."), bnum);

  mi_command_line_array = argv;
  mi_command_line_array_ptr = 1;
  mi_command_line_array_cnt = argc;

  if (is_tracepoint (b))
    break_command = read_command_lines_1 (mi_read_next_line, 1,
					  check_tracepoint_command, b);
  else
    break_command = read_command_lines_1 (mi_read_next_line, 1, 0, 0);

  breakpoint_set_commands (b, break_command);
}
Ejemplo n.º 2
0
// ---------------------------------------------------------
int people2D_engine::segmentscanJDC(int lidx, std::vector<LSL_Point3D_container> &clusters)
{

	//~ bailing var
	char split_complete = 1;

	//~ numpts
	int ptsz = laserscan[lidx].data.pts.size();

	//~ avoid nulls
	if(ptsz == 0)
		return (0);
	
	//~ last break point index
	int last_breaking_idx = 0;
	
	while(split_complete)
	{
		//~ min pts number
		if(last_breaking_idx < ptsz - 1)
		{
			//~ max distance check
			int breaking_idx = get_breakpoint(laserscan[lidx].data.pts, last_breaking_idx, params.sqjumpdist);
			
			if(breaking_idx - last_breaking_idx >= L_MINCLUSTERSZ)
			{
				//~ a cluster
				LSL_Point3D_container single_cluster;
				
				//~ pump it into
				single_cluster.pts.insert(single_cluster.pts.begin(), laserscan[lidx].data.pts.begin() + last_breaking_idx, laserscan[lidx].data.pts.begin() + breaking_idx);
				clusters.push_back(single_cluster);
 
			}	
			
			//~ endpoint
			last_breaking_idx = breaking_idx;
		}
		else
		{
			//~ break cycle
			split_complete = 0;
		}
	}

	
	return(1);
}
Ejemplo n.º 3
0
// Draws one frame then returns
void run_one_frame() {
    frame_drawn = 0;

    while (!frame_drawn) {
        if (halted || stopped) {
            long current_cycles = cgb_speed ? 2 : 4;
            update_timers(current_cycles);
            sound_add_cycles(current_cycles);
            inc_serial_cycles(current_cycles);

            // If Key pressed in "stop" mode, then gameboy is "unstopped"
            if (stopped) {
                if(key_pressed()) {
                    stopped = 0;
                }
            }
            if (halted) {
                update_graphics(current_cycles);
            }
        }
        else if (!(halted || stopped)) {
            current_cycles = 0;
            current_cycles += exec_opcode(skip_bug);

        }

        cycles += current_cycles;
      
		#ifdef EFIAPI
        if (cycles > 3000) {
		#else
		if (cycles > 15000) {
		#endif
            quit |= update_keys();
            cycles = 0;
        }
        skip_bug = handle_interrupts();

        if (debug && step_count > 0 && --step_count == 0) {
            int flags = get_command();
            step_count = (flags & STEPS_SET) ? get_steps() : STEPS_OFF;
        }
    }

}

void setup_debug() {
    if (debug) {
        int flags = get_command();
        step_count = (flags & STEPS_SET) ?  get_steps() : STEPS_OFF;

        breakpoint =  (flags & BREAKPOINT_SET) ?
                      get_breakpoint() : BREAKPOINT_OFF;
    }


}

void run() {
    log_message(LOG_INFO, "About to setup debug\n");
    setup_debug();
    log_message(LOG_INFO, "About to run\n");
    while(!quit) {
        run_one_frame();
    }
}