From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29364 invoked by alias); 8 May 2013 17:56:37 -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 29353 invoked by uid 89); 8 May 2013 17:56:36 -0000 X-Spam-SWARE-Status: No, score=-8.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_BJ autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 08 May 2013 17:56:36 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r48HuYEY019365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 8 May 2013 13:56:34 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r48HuWEe013510; Wed, 8 May 2013 13:56:33 -0400 Message-ID: <518A91D0.5010205@redhat.com> Date: Wed, 08 May 2013 17:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: "Blanc, Nicolas" CC: Pedro Alves , "gdb-patches@sourceware.org" Subject: Re: [PATCH 1/3] Added command remove-symbol-file. 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> <388084C8C1E6A64FA36AD1D656E4856619DF0550@IRSMSX102.ger.corp.intel.com> In-Reply-To: <388084C8C1E6A64FA36AD1D656E4856619DF0550@IRSMSX102.ger.corp.intel.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00294.txt.bz2 So what is the desirable behavior for when the user does add-symbol-file and then the program loads the same file, and then the user removes the file she added. GDB drops symbols until the next DSO event or next "sharedlibrary" command invocation? The fact that GDB reuses the same file when the addr_low happens to match looks quite brittle (it doesn't check the section offsets (passed to add-symbol-file) are the same, for instance). I wonder whether this sharing is supposed to be a valid use case, and whether it wouldn't be better and simpler to disable it, that is, /* Have we already loaded this shared object? */ ALL_OBJFILES (so->objfile) { if (filename_cmp (so->objfile->name, so->so_name) == 0 && so->objfile->addr_low == so->addr_low - && so->objfile->addr_low == so->addr_low) + && !(so->objfile->flags & OBJF_USERLOADED)) break; } ... - /* Unless the user loaded it explicitly, free SO's objfile. */ - if (gdb->objfile && ! (gdb->objfile->flags & OBJF_USERLOADED) - && !solib_used (gdb)) - free_objfile (gdb->objfile); In a way, treat manually added objfiles list and the dynamic SO list separate lists. -- Pedro Alves