From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11163 invoked by alias); 27 Nov 2012 16:17:12 -0000 Received: (qmail 11132 invoked by uid 22791); 27 Nov 2012 16:17:06 -0000 X-SWARE-Spam-Status: No, hits=-7.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Nov 2012 16:17:00 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 27 Nov 2012 08:16:34 -0800 X-ExtLoop1: 1 Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by azsmga001.ch.intel.com with ESMTP; 27 Nov 2012 08:16:32 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.95]) by IRSMSX103.ger.corp.intel.com ([169.254.3.74]) with mapi id 14.01.0355.002; Tue, 27 Nov 2012 16:16:30 +0000 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" , "markus.t.metzger@gmail.com" , "palves@redhat.com" , "tromey@redhat.com" , "kettenis@gnu.org" Subject: RE: [patch v4 00/13] branch tracing support for Atom Date: Tue, 27 Nov 2012 16:17:00 -0000 Message-ID: References: <1354013351-14791-1-git-send-email-markus.t.metzger@intel.com> <20121127131055.GB22431@host2.jankratochvil.net> <20121127143235.GA31270@host2.jankratochvil.net> <20121127153603.GA1899@host2.jankratochvil.net> In-Reply-To: <20121127153603.GA1899@host2.jankratochvil.net> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2012-11/txt/msg00752.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Tuesday, November 27, 2012 4:36 PM > To: Metzger, Markus T > Cc: gdb-patches@sourceware.org; markus.t.metzger@gmail.com; palves@redhat= .com; tromey@redhat.com; kettenis@gnu.org > Subject: Re: [patch v4 00/13] branch tracing support for Atom >=20 > On Tue, 27 Nov 2012 15:32:35 +0100, Jan Kratochvil wrote: > > On Tue, 27 Nov 2012 15:25:39 +0100, Metzger, Markus T wrote: > > > I would also expect problems with stepping, since we won't be able to= fake > > > a back trace using branch trace data. I don't expect that commands li= ke > > > reverse-next, next, and finish would work without special cases for b= trace. > > > > It is true these commands implemented on btrace would need to disassemb= le x86* > > instructions (like reverse-execution does for the memory recording purp= ose), > > as you state backtrace is not available there which they depend upon. > > It would be a larger work. >=20 > When thinking about it you can "easily" create backtrace at any point in = time > backwards as long as you check for call and ret instructions at each reco= rded > PC. >=20 > Then you would create virtual btrace frames similarly like inline-frame.c= and > dwarf2-frame-tailcall.c do. Then the finish/reverse-finish/next/reverse-= next > commands will work automatically from those virtual frames. One could ev= en > give proper frame addresses (SP) to the frames thanks to CFI (.eh_frame) = valid > at each instruction (as long as gcc -fasynchronous-unwind-tables is used). >=20 > This all could be acceptably fast with no additional overhead during reco= rding. Looks like it wouldn't be that difficult, after all. The assumption that a = ret returns to the last call we've seen might be a bit optimistic, though. = And we wouldn't be able to handle those cases where the call is not include= d in the trace. The back trace would thus be rather short. Btrace is very helpful for debugging stack corruptions. It can show you whe= re you came from even if gdb is not able to unwind properly. If we optimist= ically computed a back trace from call and ret instructions we've seen, we = might show wrong information that could be more confusing than helpful. Add= ing this assumed back trace as a separate command might make sense, though,= and might indeed be helpful in some cases. I just wouldn't give the impres= sion that this is the actual back trace. I'm not sure whether I would want control-flow trace presented via reverse-= commands as a user. Regards, Markus. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Peter Gleissner, Christian Lamprechter, Hannes Schwadere= r, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052