From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17466 invoked by alias); 10 Sep 2013 13:24:47 -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 17454 invoked by uid 89); 10 Sep 2013 13:24:47 -0000 Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Sep 2013 13:24:47 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 10 Sep 2013 06:21:44 -0700 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga001.jf.intel.com with ESMTP; 10 Sep 2013 06:24:18 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.69]) by IRSMSX102.ger.corp.intel.com ([169.254.2.234]) with mapi id 14.03.0123.003; Tue, 10 Sep 2013 14:24:16 +0100 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" Subject: RE: [patch v4 09/24] btrace: add replay position to btrace thread info Date: Tue, 10 Sep 2013 13:24:00 -0000 Message-ID: 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> In-Reply-To: <20130818190704.GG24153@host2.jankratochvil.net> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00335.txt.bz2 > -----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 =3D btrace_insn_next (&end, 1); > > + covered +=3D btrace_insn_prev (&begin, context - covered); > > + covered +=3D btrace_insn_next (&end, context - covered); > > + } > > + else > > + { > > + covered =3D btrace_insn_next (&end, context); > > + covered +=3D btrace_insn_prev (&begin, context - covered); > > + } >=20 > 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 =3D 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