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


> -----Original Message-----
> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com]
> Sent: Sunday, August 18, 2013 9:07 PM

Thanks for your review.


> > +      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.

Regards,
Markus.

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


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