This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v4 09/24] btrace: add replay position to btrace thread info
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 12 Sep 2013 22:19:26 +0200
- Subject: Re: [patch v4 09/24] btrace: add replay position to btrace thread info
- Authentication-results: sourceware.org; auth=none
- References: <1372842874-28951-1-git-send-email-markus dot t dot metzger at intel dot com> <1372842874-28951-10-git-send-email-markus dot t dot metzger at intel dot com> <20130818190704 dot GG24153 at host2 dot jankratochvil dot net> <A78C989F6D9628469189715575E55B230A9CAB6A at IRSMSX104 dot ger dot corp dot intel dot com>
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