[unavailable values part 1, 16/17] don't merge almost but not quite adjacent memory ranges to collect
Jan Kratochvil
jan.kratochvil@redhat.com
Mon Feb 14 12:01:00 GMT 2011
On Mon, 07 Feb 2011 15:35:20 +0100, Pedro Alves wrote:
> --- src.orig/gdb/tracepoint.c 2011-02-07 13:17:26.276706003 +0000
> +++ src/gdb/tracepoint.c 2011-02-07 13:27:53.276706002 +0000
> @@ -841,13 +841,12 @@ memrange_sortmerge (struct collection_li
> {
> for (a = 0, b = 1; b < memranges->next_memrange; b++)
> {
> - if (memranges->list[a].type == memranges->list[b].type &&
> - memranges->list[b].start - memranges->list[a].end <=
> - MAX_REGISTER_SIZE)
> + /* If memrange b overlaps or is adjacent to memrange a,
> + merge them. */
> + if (memranges->list[a].type == memranges->list[b].type
> + && memranges->list[b].start <= memranges->list[a].end)
> {
> - /* memrange b starts before memrange a ends; merge them. */
> - if (memranges->list[b].end > memranges->list[a].end)
> - memranges->list[a].end = memranges->list[b].end;
> + memranges->list[a].end = memranges->list[b].end;
> continue; /* next b, same a */
> }
> a++; /* next a */
It is an unrelated issue to this patch but this function is not a general
normalizer for overlapping ranges, with bug(s) similar to
normalize_mem_ranges. But maybe it does not have to be so general, all the
possible contents of the tracing protocol are unknown to me.
Thanks,
Jan
More information about the Gdb-patches
mailing list