From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15819 invoked by alias); 28 Mar 2013 12:38:08 -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 15731 invoked by uid 89); 28 Mar 2013 12:38:01 -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 mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 28 Mar 2013 12:37:58 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 28 Mar 2013 05:37:56 -0700 X-ExtLoop1: 1 Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga001.jf.intel.com with ESMTP; 28 Mar 2013 05:37:55 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.244]) by IRSMSX103.ger.corp.intel.com ([169.254.3.198]) with mapi id 14.01.0355.002; Thu, 28 Mar 2013 12:37:54 +0000 From: "Metzger, Markus T" To: Jan Kratochvil CC: Markus Metzger , "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 17:37: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> <20130328091204.GA15793@host2.jankratochvil.net> In-Reply-To: <20130328091204.GA15793@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/msg01059.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcewa= re.org] On Behalf Of Jan Kratochvil > Sent: Thursday, March 28, 2013 10:12 AM > > The data structure should only change when there is new trace, which re= quires > > the target to continue. "info record" should, like any other record-bt= race command, > > fetch the new trace once and then operate on the cached trace data. >=20 > In non-stop mode I belive there will be new btrace info on each "info rec= ord" > command, won't be? I have not tried it but it seems so to me. Record_btrace_info, like any other record btrace command, calls btrace_fetc= h. This queries the target for new branch trace. If there is no new trace, it= returns. Only if there is new trace, it will call btrace_clear and then reconstruct = the branch trace. All this is per-thread, so the branch trace for each thread should only be = reconstructed when it has changed - in non-stop and stop-all mode. > > Is there a guarantee that frame_info and frame_id objects are destroyed > > when the target resumes? Or could I trigger their destruction from wit= hin > > btrace_clear? >=20 > "trigger frame_info and frame_id destruction" =3D=3D reinit_frame_cache(). >=20 > Accessing frame_info after reinit_frame_cache() is always a crash. >=20 > Accessing frame_id after reinit_frame_cache() is safe but one needs to be > prepared frame_find_by_id may return NULL if it is no longer available. >=20 > When you introduce new reinit_frame_cache() call one just needs to be car= eful > no caller holds that time a frame_info * pointer in a local variable. > It would be a bug in such caller to call some non-trivial caller while ho= lding > frame_info * but there were many such bugs in GDB. >=20 > I would not rely on any reinit_frame_cache() calls, calling > reinit_frame_cache() more times is zero-cost, I think you should call > reinit_frame_cache() from btrace_clear as you ask above. Thanks. I'm doing just that. So far, I have not seen any issues. 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