This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [unavailable values part 1, 16/17] don't merge almost but not quite adjacent memory ranges to collect
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Feb 2011 13:01:16 +0100
- Subject: Re: [unavailable values part 1, 16/17] don't merge almost but not quite adjacent memory ranges to collect
- References: <201102071435.20804.pedro@codesourcery.com>
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