From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31298 invoked by alias); 4 Jun 2014 12:37:12 -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 31287 invoked by uid 89); 4 Jun 2014 12:37:12 -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: mga03.intel.com Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jun 2014 12:37:10 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 04 Jun 2014 05:37:02 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by azsmga001.ch.intel.com with ESMTP; 04 Jun 2014 05:37:01 -0700 Received: from irsmsx105.ger.corp.intel.com (163.33.3.28) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 4 Jun 2014 13:35:45 +0100 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.136]) by IRSMSX105.ger.corp.intel.com ([169.254.7.239]) with mapi id 14.03.0123.003; Wed, 4 Jun 2014 13:35:45 +0100 From: "Metzger, Markus T" To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH v3 3/3] btrace, vdso: add vdso target sections Date: Wed, 04 Jun 2014 12:37:00 -0000 Message-ID: References: <1400655682-4014-1-git-send-email-markus.t.metzger@intel.com> <1400655682-4014-3-git-send-email-markus.t.metzger@intel.com> <5387663A.5040704@redhat.com> <53876874.3080503@redhat.com> In-Reply-To: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00150.txt.bz2 Hi Pedro, I sent this as a patch: https://sourceware.org/ml/gdb-patches/2014-06/msg00148.html There's also another patch series open that fixes an assertion when generating a core file while replaying: https://sourceware.org/ml/gdb-patches/2014-05/msg00537.html https://sourceware.org/ml/gdb-patches/2014-05/msg00539.html https://sourceware.org/ml/gdb-patches/2014-05/msg00538.html regards, markus. > -----Original Message----- > From: Metzger, Markus T > Sent: Monday, June 2, 2014 2:41 PM > To: Pedro Alves > Cc: gdb-patches@sourceware.org > Subject: RE: [PATCH v3 3/3] btrace, vdso: add vdso target sections >=20 > > -----Original Message----- > > From: Pedro Alves [mailto:palves@redhat.com] > > Sent: Thursday, May 29, 2014 7:04 PM >=20 >=20 > > Hmm, wait, nothing is removing the vdso symbols target sections, like e= ver, > > not even when the process dies, isn't it? I guess that's it. >=20 > Yes, that seems to be it. >=20 > Target sections are typically owned by an so_list object and are removed > when the so_list object is removed. >=20 > Symfile target sections are owned by an objfile object and are removed > in a free_objfile observer in symfile.c. That observer only removes targ= et > sections for OBJF_USERLOADED objfiles, though. >=20 > The vdso target sections are owned by the vdso BFD and are never removed. >=20 > When I change symfile_add_from_memory to create target sections like > this: >=20 > add_target_sections_of_objfile (objf); >=20 > and further drop the restriction to only remove OBJF_USERLOADED objfiles > in > symfile_free_objfile, the test passes. >=20 > diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c > index b29421e..ef48f7d 100644 > --- a/gdb/symfile-mem.c > +++ b/gdb/symfile-mem.c > @@ -92,7 +92,6 @@ symbol_file_add_from_memory (struct bfd *templ, > CORE_ADDR addr, > struct section_addr_info *sai; > unsigned int i; > struct cleanup *cleanup; > - struct target_section *sections, *sections_end, *tsec; >=20 > if (bfd_get_flavour (templ) !=3D bfd_target_elf_flavour) > error (_("add-symbol-file-from-memory not supported for this target"= )); > @@ -132,22 +131,7 @@ symbol_file_add_from_memory (struct bfd *templ, > CORE_ADDR addr, > from_tty ? SYMFILE_VERBOSE : 0, > sai, OBJF_SHARED, NULL); >=20 > - sections =3D NULL; > - sections_end =3D NULL; > - > - if (build_section_table (nbfd, §ions, §ions_end) =3D=3D 0) > - { > - make_cleanup (xfree, sections); > - > - /* Adjust the target section addresses by the load address. */ > - for (tsec =3D sections; tsec !=3D sections_end; ++tsec) > - { > - tsec->addr +=3D loadbase; > - tsec->endaddr +=3D loadbase; > - } > - > - add_target_sections (&nbfd, sections, sections_end); > - } > + add_target_sections_of_objfile (objf); >=20 > /* This might change our ideas about frames already looked at. */ > reinit_frame_cache (); > diff --git a/gdb/symfile.c b/gdb/symfile.c > index 64a83c6..caa0722 100644 > --- a/gdb/symfile.c > +++ b/gdb/symfile.c > @@ -3893,7 +3893,7 @@ static void > symfile_free_objfile (struct objfile *objfile) > { > /* Remove the target sections of user-added objfiles. */ > - if (objfile !=3D 0 && objfile->flags & OBJF_USERLOADED) > + if (objfile !=3D NULL) > remove_target_sections ((void *) objfile); > } >=20 > Alternatively, I could add another OBJF_ flag and another free_objfile > observer > to also remove the symfile-from-memory target sections. >=20 > 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