From: Sami Wagiaalla <swagiaal@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: frysk <frysk@sourceware.org>
Subject: Re: Elfutils: Resolving class member variables (was Re: Dwarf/libdw question)
Date: Tue, 02 Oct 2007 19:59:00 -0000 [thread overview]
Message-ID: <4702A2D7.4080904@redhat.com> (raw)
In-Reply-To: <470256E2.6070703@redhat.com>
Sami Wagiaalla wrote:
> Hi Roland,
>
> Thank you for the thorough reply. You have probably answered any
> future questions I might have :)
>
> Roland McGrath wrote:
>> Hi Sami. Please use more specific Subject lines in your postings.
>> Reading the list archives' index will not be very informative to
>> someone looking years from now for discussion on this particular topic.
>>
> Good point... will do.
>> First, the name resolution per se. First there are scopes inside a
>> subprogram DIE, same as in C. When you are dealing with a class method,
>> the subprogram's specification attribute gives you the declaration
>> inside the class scope (use dwarf_formref_die (dwarf_attr (...))). Then
>> use dwarf_getscopes_die on that to see the class, namespace, etc. scopes
>> containing it. For each of those, see if they have DW_TAG_inheritance,
>> DW_TAG_imported_declaration, etc. children that contribute more scopes
>> to the name resolution logic for the language. Among those you find a
>> member, variable, subprogram, etc. DIE by the name you are looking for.
>>
> I will try that.
This works, but the following patch was needed:
Index: libdw/libdw_visit_scopes.c
===================================================================
RCS file: /cvs/frysk/frysk-imports/elfutils/libdw/libdw_visit_scopes.c,v
retrieving revision 1.4
diff -u -r1.4 libdw_visit_scopes.c
--- libdw/libdw_visit_scopes.c 22 Aug 2007 17:11:08 -0000 1.4
+++ libdw/libdw_visit_scopes.c 2 Oct 2007 19:55:06 -0000
@@ -68,6 +68,7 @@
case DW_TAG_catch_block:
case DW_TAG_try_block:
case DW_TAG_entry_point:
+ case DW_TAG_structure_type:
return match;
case DW_TAG_inlined_subroutine:
return match_inline;
prev parent reply other threads:[~2007-10-02 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 15:36 Dwarf/libdw question Sami Wagiaalla
2007-10-02 2:20 ` Roland McGrath
2007-10-02 14:34 ` Elfutils: Resolving class member variables (was Re: Dwarf/libdw question) Sami Wagiaalla
2007-10-02 19:59 ` Sami Wagiaalla [this message]
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=4702A2D7.4080904@redhat.com \
--to=swagiaal@redhat.com \
--cc=frysk@sourceware.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).