From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7335 invoked by alias); 9 Oct 2007 17:30:52 -0000 Received: (qmail 7297 invoked by uid 22791); 9 Oct 2007 17:30:44 -0000 X-Spam-Status: No, hits=-0.0 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS,SUBJ_HAS_SPACES,TW_DW,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 09 Oct 2007 17:30:41 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id l99HUct9024250; Tue, 9 Oct 2007 13:30:38 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l99HUb8j018037; Tue, 9 Oct 2007 13:30:37 -0400 Received: from [127.0.0.1] (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l99HUbpn029182; Tue, 9 Oct 2007 13:30:37 -0400 Message-ID: <470BBA54.9060701@redhat.com> Date: Tue, 09 Oct 2007 17:30:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: Mark Wielaard , Roland McGrath CC: Frysk Hackers Subject: dl symbol search path; Was: Corefile -arch 32 test failures with breakpoint and stacktrace tests References: <47074377.5040602@redhat.com> <1191840378.3859.20.camel@dijkstra.wildebeest.org> <470BB52E.9010606@redhat.com> In-Reply-To: <470BB52E.9010606@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00031.txt.bz2 Andrew Cagney wrote: > >> >> + static Symbol get(Dwfl dwfl, String name) >> + { >> + Symbol sym = new Symbol(); >> + sym.name = name; >> + DwflModule[] modules = dwfl.getModules(); >> + for (int i = 0; i < modules.length && ! sym.found; i++) >> + modules[i].getSymbolByName(name, sym); >> + PS: The rules for looking up an elf symbol is, unfortunately, subtle and complex. A brute force search through all the modules taking the first returned isn't correct. For instance, consider a search for open. If the current symbol scope has a local open function then that should be returned, and not the one from a library like glibc. The man page for dlsym(3) touches on the semantics. I was hoping that there was a dwfl method for doing this, but none jump out from libdwfl.h? I see DwflModule.getSymbolByName does the best it can using dwfl_module_getsymtab. Andrew