From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13114 invoked by alias); 2 Oct 2002 17:28:13 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13106 invoked from network); 2 Oct 2002 17:28:12 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 2 Oct 2002 17:28:12 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g92H9Ki19831 for ; Wed, 2 Oct 2002 13:09:20 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g92HSBf15763 for ; Wed, 2 Oct 2002 13:28:11 -0400 Received: from localhost.localdomain (vpn50-3.rdu.redhat.com [172.16.50.3]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g92HSB914755; Wed, 2 Oct 2002 13:28:11 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id g92HS5B23453; Wed, 2 Oct 2002 10:28:05 -0700 Date: Wed, 02 Oct 2002 10:28:00 -0000 From: Kevin Buettner Message-Id: <1021002172805.ZM23452@localhost.localdomain> In-Reply-To: Elena Zannoni "[RFA] solib-svr4.c fetch link map address" (Oct 1, 10:28pm) References: <15770.22961.366656.980373@localhost.redhat.com> To: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA] solib-svr4.c fetch link map address MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-10/txt/msg00059.txt.bz2 On Oct 1, 10:28pm, Elena Zannoni wrote: > + discard_cleanups (old_chain); > + return lm; > + } > + } > + /* Not the file we wanted, continue checking. */ > + lm = extract_address (objfile_lm_info.lm + lmo->l_next_offset, > + lmo->l_next_size); > + discard_cleanups (old_chain); > + } Why are the cleanups being discarded? Won't this result in a memory leak? Another concern is that there appears to be some duplication of code between svr4_current_sos() and the function that you've just written. I'm wondering if some sort of factoring could be done to minimize duplication. Finally, I'm curious about how often we'll be fetching the link map address. Is it the case that it'll be fetched once (per objfile) and never fetched again? Or will it be fetched repeatedly? If it's the former, I think your approach is fine. If the latter, we should consider saving the link map address so that it can be supplied to glibc without having to read the target. Kevin