From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23599 invoked by alias); 30 Apr 2013 11:07:39 -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 23589 invoked by uid 89); 30 Apr 2013 11:07:38 -0000 X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_PASS,TW_BJ autolearn=ham version=3.3.1 Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 30 Apr 2013 11:07:35 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 30 Apr 2013 04:07:34 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga002.fm.intel.com with ESMTP; 30 Apr 2013 04:07:33 -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.1.355.2; Tue, 30 Apr 2013 12:06:14 +0100 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.244]) by IRSMSX105.ger.corp.intel.com ([169.254.7.14]) with mapi id 14.01.0438.000; Tue, 30 Apr 2013 12:06:14 +0100 From: "Blanc, Nicolas" To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH 1/3] Added command remove-symbol-file. Date: Tue, 30 Apr 2013 16:53:00 -0000 Message-ID: <388084C8C1E6A64FA36AD1D656E4856619DF0550@IRSMSX102.ger.corp.intel.com> References: <1366098721-18302-1-git-send-email-nicolas.blanc@intel.com> <1366098721-18302-2-git-send-email-nicolas.blanc@intel.com> <517ABA6A.5070400@redhat.com> <388084C8C1E6A64FA36AD1D656E4856619DF0224@IRSMSX102.ger.corp.intel.com> <517EC93F.2020409@redhat.com> In-Reply-To: <517EC93F.2020409@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-04/txt/msg00900.txt.bz2 Hi Pedro, I tested adding a file manually in gdb before the debuggee, as you suggeste= d, and indeed the user-added file appeared in so_list_head. There was a glitch in my fun= ction because "objfile->flags & OBJF_SHARED" was not set by GDB. So the dangling referenc= e was not removed from the list. I fixed that and now the new code for remove_user_added_file= is: /* SO_LIST_HEAD may contain user-loaded object files that can be removed out-of-band by the user. So upon notification of free_objfile remove any reference to any user-loaded file that is about to be freed. */ static void remove_user_added_objfile (struct objfile *objfile) { struct so_list *so; if (!objfile) return; if (objfile->flags & OBJF_USERLOADED) { for (so =3D so_list_head; so !=3D NULL; so =3D so->next) if (so->objfile =3D=3D objfile) so->objfile =3D NULL; } } If this is function is ok for you then I'll send a new version of the patch. Thanks again for your feedback, Nicolas 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