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 v4 09/24] btrace: add replay position to btrace thread info


On Tue, 10 Sep 2013 15:24:15 +0200, Metzger, Markus T wrote:
> > > +      if (size < 0)
> > > +	{
> > > +	  /* We want the current position covered, as well.  */
> > > +	  covered = btrace_insn_next (&end, 1);
> > > +	  covered += btrace_insn_prev (&begin, context - covered);
> > > +	  covered += btrace_insn_next (&end, context - covered);
> > > +	}
> > > +      else
> > > +	{
> > > +	  covered = btrace_insn_next (&end, context);
> > > +	  covered += btrace_insn_prev (&begin, context - covered);
> > > +	}
> > 
> > These two COVERED calculations do not seem right to me, pointer is moving
> > NEXT and PREV so the directions should be both added and subtracted.
> 
> context = abs (size).
> 
> Both iterator functions return the number of instructions they moved into
> the respective direction.

OK, I agree now; I missed &begin vs. &end probably, a bit too smart code.


Thanks,
Jan


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