Exemple #1
0
static int
list_one_view(char *area_name, char *view_name, command_t * cmd)
{
	debug_info_t *db_info;
	debug_view_t *db_view;

	if ((db_info = find_debug_area(area_name)) == NULL) {
		fprintf(cmd->efp, "Debug log '%s' not found!\n", area_name);
		return -1;
	}

	db_info = get_debug_info(db_info->addr,1);

	if ((db_view = find_lcrash_debug_view(view_name)) == NULL) {
		fprintf(cmd->efp, "View '%s' not registered!\n", view_name);
		return -1;
	}
	if(dbf_version == DBF_VERSION_V1){
		debug_format_output_v1(db_info, db_view, cmd->ofp);
		free_debug_info_v1(db_info);
	} else {
		debug_format_output_v2(db_info, db_view, cmd->ofp);
		free_debug_info_v2(db_info);
	}
	return 0;
}
static void
debug_write_output(debug_info_t *db_info, debug_view_t *db_view, FILE * fp)
{
	if (dbf_version == DBF_VERSION_V1) {
		debug_format_output_v1(db_info, db_view, fp);
		free_debug_info_v1(db_info);
	} else {
		debug_format_output_v2(db_info, db_view, fp);
		free_debug_info_v2(db_info);
	}
}
static void
free_debug_areas(void)
{
	debug_info_t* next;
	debug_info_t* act_debug_info = debug_area_first;

	while(act_debug_info != NULL){
		next = act_debug_info->next;
		if(dbf_version == DBF_VERSION_V1)
			free_debug_info_v1(act_debug_info);
		else
			free_debug_info_v2(act_debug_info);
		act_debug_info = next;
	}

	debug_area_first = NULL;
	debug_area_last  = NULL;
}