From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16859 invoked by alias); 20 May 2014 14:10:09 -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 16846 invoked by uid 89); 20 May 2014 14:10:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mga02.intel.com Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 May 2014 14:10:06 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 20 May 2014 07:09:38 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga002.jf.intel.com with ESMTP; 20 May 2014 07:09:37 -0700 Received: from irsmsx108.ger.corp.intel.com (163.33.3.3) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 20 May 2014 15:08:29 +0100 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.98]) by IRSMSX108.ger.corp.intel.com ([169.254.11.221]) with mapi id 14.03.0123.003; Tue, 20 May 2014 15:08:28 +0100 From: "Metzger, Markus T" To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH v2 3/3] btrace, vdso: add vdso target sections Date: Tue, 20 May 2014 14:10:00 -0000 Message-ID: References: <1400587236-18836-1-git-send-email-markus.t.metzger@intel.com> <1400587236-18836-3-git-send-email-markus.t.metzger@intel.com> <537B4D25.3000303@redhat.com> In-Reply-To: <537B4D25.3000303@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00420.txt.bz2 > -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Tuesday, May 20, 2014 2:40 PM > > + sections =3D NULL; > > + sections_end =3D NULL; > > + make_cleanup (xfree, sections); >=20 > This will always xfree NULL. You either want: >=20 > make_cleanup (free_current_contents, §ions); That's what I wanted. Thanks! > or move the cleanup to within the if/then block. You also need > to make sure to discard the cleanup on success. >=20 > Or, better yet, not install a cleanup at all? build_section_table > allocates the memory, and then the array is passed directly to > add_target_sections, which can be seen as a transfer of ownership. > If something throws after that call, we don't want the sections be > be simply xfree'd as that'd leave dangling pointers in the target > sections table. add_target_sections copies the sections. > > +# capture the disassembly of gettimeofday while live debugging > > +set live_gettimeofday [capture_command_output "disassemble > gettimeofday" ""] > > + > > +# trace the test code > > +gdb_test_no_output "record btrace" > > +gdb_test "next" "main\.2.*" > > + > > +# capture the disassembly of gettimeofday while replaying > > +gdb_test "record goto begin" "main\.1.*" > > +set replay_gettimeofday [capture_command_output "disassemble > gettimeofday" ""] >=20 > I think these two capture_command_output calls generate duplicate > gdb.sum output ? That's why I had with_test_prefix in my suggestion. I overlooked that. Sorry. 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