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: [PATCH] Handle partially optimized out values similarly to unavailable values (Re: [patchv2] Fix crash on optimized-out entry data values)


On Wed, 16 Jul 2014 23:58:38 +0200, Jan Kratochvil wrote:
> On Mon, 14 Jul 2014 20:11:41 +0200, Pedro Alves wrote:
> > +	  /* The contents only match equal if the invalid/unavailable
> > +	     contents ranges match as well.  */
> > +	  if (!find_first_range_overlap_and_match (&rp1[i], &rp2[i],
> > +						   offset1, offset2, length,
> > +						   &l_tmp, &h_tmp))
> > +	    return 0;
> > +
> > +	  /* We're interested in the lowest/first range found.  */
> > +	  if (i == 0 || l_tmp < l)
> 
> Here should be:
>    	  if (i == 0 || l_tmp < l || (l_tmp == l && h_tmp < h))
> 
> It could skip [0]'s part which is non-equal otherwise.

No, the code was OK.  This comes from the fact that 'unavailable' and
'optimized_out' ranges cannot overlap (probably, I ask for its clarification
somewhere else in the mail).

Maybe it would be all easier to have there single map and each range mapping
into enum { VALID, OPTIMIZED_OUT, UNAVAILABLE }.


Jan


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