From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29485 invoked by alias); 12 Sep 2013 20:19:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29476 invoked by uid 89); 12 Sep 2013 20:19:32 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Sep 2013 20:19:32 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8CKJTZT009653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Sep 2013 16:19:30 -0400 Received: from host2.jankratochvil.net (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r8CKJQco012534 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 12 Sep 2013 16:19:28 -0400 Date: Thu, 12 Sep 2013 20:19:00 -0000 From: Jan Kratochvil To: "Metzger, Markus T" Cc: "gdb-patches@sourceware.org" Subject: Re: [patch v4 09/24] btrace: add replay position to btrace thread info Message-ID: <20130912201926.GA7265@host2.jankratochvil.net> References: <1372842874-28951-1-git-send-email-markus.t.metzger@intel.com> <1372842874-28951-10-git-send-email-markus.t.metzger@intel.com> <20130818190704.GG24153@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00386.txt.bz2 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