Example #1
0
/*
 * Switch breakpoints state.
 * arguments:
 * 		file - breakpoints filename
 * 		line - breakpoints line
 */
void breaks_switch(const char* file, int line)
{
	/* do not process async break manipulation on modules
	that do not support async interuppt */
	enum dbs state = debug_get_state();
	if (DBS_RUNNING == state &&  !debug_supports_async_breaks())
		return;

	/* lookup for breakpoint */
	breakpoint* bp = NULL;
	if (!(bp = breaks_lookup_breakpoint(file, line)))
		return;
	
	/* change activeness */
	bp->enabled = !bp->enabled;
	
	/* handle switching instantly if debugger is idle or stopped
	and request debug module interruption overwise */
	if (DBS_IDLE == state)
	{
		on_switch(bp);
		config_set_debug_changed();
	}
	else if (DBS_STOPPED == state)
		breaks_switch_debug(bp);
	else if (DBS_STOP_REQUESTED != state)
		debug_request_interrupt((bs_callback)breaks_switch_debug, (gpointer)bp);
}
Example #2
0
void check_buttons() {
    char i;
    uint8_t switch_new = PollSwitch();
    for (i=0; i<6; i++) {
        char b_new = (switch_new & (1<<i));
        char b_old = (switch_old & (1<<i));
        if (b_new != b_old) {
            on_switch(i, b_new>0);
        }
    }
    switch_old = switch_new;
}
Example #3
0
static void breaks_switch_debug(breakpoint* bp)
{
	if (debug_set_break(bp, BSA_UPDATE_ENABLE))
	{
		on_switch(bp);
		/* mark config for saving */
		config_set_debug_changed();
	}
	else
	{
		bp->enabled = !bp->enabled;
		dialogs_show_msgbox(GTK_MESSAGE_ERROR, "%s", debug_error_message());
	}
}
Example #4
0
static void breaks_set_enabled_list_debug(GList *list)
{
	GList *iter;
	for (iter = list; iter; iter = iter->next)
	{
		breakpoint *bp = (breakpoint*)iter->data;
		if (!bp->enabled)
		{
			bp->enabled = TRUE;
			if (debug_set_break(bp, BSA_UPDATE_ENABLE))
			{
				on_switch(bp);
			}
			else
			{
				bp->enabled = FALSE;
			}
		}
	}
	g_list_free(list);

	config_set_debug_changed();
}
Example #5
0
/**
 * \brief Process a collision with the paint.
 * \param mark The mark on which the collision occurred.
 * \param that The other item of the collision.
 * \param info Some informations about the collision.
 */
void rp::switching::on_switch_up
( bear::engine::base_item& mark, bear::engine::base_item& that,
  bear::universe::collision_info& info )
{
  on_switch(mark,that,info,"move up");
} // switching::on_switch_up()