public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@redhat.com>
To: Mark Wielaard <mark@klomp.org>, Roland McGrath <roland@redhat.com>
Cc: Frysk Hackers <frysk@sourceware.org>
Subject: dl symbol search path; Was: Corefile -arch 32 test failures with  breakpoint and stacktrace  	tests
Date: Tue, 09 Oct 2007 17:30:00 -0000	[thread overview]
Message-ID: <470BBA54.9060701@redhat.com> (raw)
In-Reply-To: <470BB52E.9010606@redhat.com>

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



  reply	other threads:[~2007-10-09 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-06  8:12 Phil Muldoon
2007-10-08 10:46 ` Mark Wielaard
2007-10-09 17:08   ` Andrew Cagney
2007-10-09 17:30     ` Andrew Cagney [this message]
2007-10-16  2:39       ` dl symbol search path; Was: " Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=470BBA54.9060701@redhat.com \
    --to=cagney@redhat.com \
    --cc=frysk@sourceware.org \
    --cc=mark@klomp.org \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).