if (start < entry->start)
p = &parent->rb_left; elseif (start > entry->end)
p = &parent->rb_right; else break;
}
/* * Didn't find anything.. there's a hole at @start, however @end might * be inside/behind the next range.
*/ if (!*p) { if (!entry) /* tree empty */ goto do_whole;
/* * If the last node is before, advance one to find the next.
*/
n = parent; if (entry->end < start) {
n = rb_next(n); if (!n) goto do_whole;
}
next = rb_entry(n, struct block_range, node);
if (next->start <= end) { /* add head: [start...][n->start...] */ struct block_range *head = malloc(sizeof(struct block_range)); if (!head) return iter;
/* * We found a range that overlapped with ours, split if needed.
*/ if (entry->start < start) { /* split: [e->start...][start...] */ struct block_range *head = malloc(sizeof(struct block_range)); if (!head) return iter;
do_tail: /* * At this point we've got: @iter.start = [@start...] but @end can still be * inside or beyond it.
*/
entry = iter.start; for (;;) { /* * If @end is inside @entry, split.
*/ if (end < entry->end) { /* split: [...end][...e->end] */ struct block_range *tail = malloc(sizeof(struct block_range)); if (!tail) return iter;
/* * If there is a hole between @entry and @next, fill it.
*/ if (entry->end + 1 != next->start) { struct block_range *hole = malloc(sizeof(struct block_range)); if (!hole) return iter;
/* * Compute coverage as: * * br->coverage / br->sym->max_coverage * * This ensures each symbol has a 100% spot, to reflect that each symbol has a * most covered section. * * Returns [0-1] for coverage and -1 if we had no data what so ever or the * symbol does not exist.
*/ double block_range__coverage(struct block_range *br)
{ struct symbol *sym; struct annotated_branch *branch;
if (!br) { if (block_ranges.blocks) return 0;
return -1;
}
sym = br->sym; if (!sym) return -1;
branch = symbol__annotation(sym)->branch; if (!branch) return -1;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.