From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7158 invoked by alias); 28 Mar 2013 07:44:49 -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 7136 invoked by uid 89); 28 Mar 2013 07:44:42 -0000 X-Spam-SWARE-Status: No, score=-8.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 28 Mar 2013 07:44:39 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 28 Mar 2013 00:44:37 -0700 X-ExtLoop1: 1 Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by azsmga001.ch.intel.com with ESMTP; 28 Mar 2013 00:44:13 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.244]) by IRSMSX104.ger.corp.intel.com ([169.254.5.19]) with mapi id 14.01.0355.002; Thu, 28 Mar 2013 07:44:12 +0000 From: "Metzger, Markus T" To: Jan Kratochvil , Markus Metzger CC: "gdb-patches@sourceware.org" Subject: RE: [draft patch] unwinder for btrace [Re: [rfc 3/5] record: make it build again] Date: Thu, 28 Mar 2013 14:28:00 -0000 Message-ID: References: <1360337423-27095-1-git-send-email-markus.t.metzger@intel.com> <1360337423-27095-4-git-send-email-markus.t.metzger@intel.com> <20130210221059.GC4819@host2.jankratochvil.net> <20130211141451.GA8962@host2.jankratochvil.net> <20130211171319.GA17524@host2.jankratochvil.net> <9B969C1D-95E8-4AD5-BEF0-E269FF8771DF@gmail.com> <20130328062747.GA27157@host2.jankratochvil.net> In-Reply-To: <20130328062747.GA27157@host2.jankratochvil.net> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-03/txt/msg01053.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Thursday, March 28, 2013 7:28 AM > > > On a related but different topic, I added a btrace frame type and > > > prologue cache. The cache holds a pointer to some btrace data > > > structure that is used to compute the fake back trace. In order to > > > unwind a btrace frame, I would need to access the next frame's > > > location in this btrace data structure. > > > > > > The easiest would be to check for the next frame's type and then > > > access it's cache - which doesn't work since struct frame_info is > > > opaque. I ended up encoding the pointer into the special_addr > > > of a btrace frame's frame_id - which is somewhat ugly. Any better > > > idea? >=20 > special_addr is really not right. >=20 > dwarf2-frame-tailcall.c uses for a similar problem 'htab_t cache_htab' wh= ich > is indexed by 'struct frame_info *' which you can iterate in any directio= n so > you even do not need a new cache entry for every 'struct frame_info *'. Thanks, I'll try that. Although, in the end, it's really the same as if we= made other frames prologue cache visible. > > > Also what's the lifetime of a frame_info and frame_id object? > > > When the branch trace is cleared, any pointers to it will become > > > stale. >=20 > There is frame_unwind->dealloc_cache, any reinit_frame_cache() call insid= e GDB > will clear the prologue cache which is very common. >=20 > I see now btrace_thread_info->btrace may change more often - such as duri= ng > each "info record" command. So call reinit_frame_cache() in the cases bt= race > cache may get rebuilt. The data structure should only change when there is new trace, which requir= es the target to continue. "info record" should, like any other record-btrace= command, fetch the new trace once and then operate on the cached trace data. Is there a guarantee that frame_info and frame_id objects are destroyed when the target resumes? Or could I trigger their destruction from within btrace_clear? Thanks, 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