This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [unavailable values part 1, 16/17] don't merge almost but not quite adjacent memory ranges to collect


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]