From: Tom Tromey <tromey@redhat.com>
To: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Cc: <gdb-patches@sourceware.org>,
"'FPC Core Developer List'" <core@freepascal.org>
Subject: Re: [RFC] dwarf debug information: Handle Free Pascal virtual table indexes
Date: Thu, 13 May 2010 17:29:00 -0000 [thread overview]
Message-ID: <m38w7nvhz1.fsf@fleche.redhat.com> (raw)
In-Reply-To: <11064.3996195451$1273708856@news.gmane.org> (Pierre Muller's message of "Thu, 13 May 2010 02:00:45 +0200")
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> you have to take into account that
Pierre> I know about nothing about DWARF :(
No problem, don't worry about it :-)
Pierre> DW_AT_vtable_elem_location attribute a BLOCK consisting of
Pierre> a DW_OP_constu marker followed by a unsigned_leb128 value
Pierre> to indicate the offset within the virtual table of a virtual
Pierre> function.
Tom> By my reading, this is incorrect DWARF. Or is there more to the
Tom> expression than that?
Pierre> What do you exactly mean by expression here?
The value of DW_AT_vtable_elem_location is a DWARF location expression.
From the DWARF 4 (review) spec:
An entry for a virtual function also has a DW_AT_vtable_elem_location
attribute whose value contains a location description yielding the
address of the slot for the function within the virtual function table
for the enclosing class. The address of an object of the enclosing type
is pushed onto the expression stack before the location description is
evaluated.
One thing that would be helpful is if you ran "readelf -w" (or some
other DWARF dumper) on a program created by FPC that has this attribute,
then posted the DIE in question.
Also ... I forgot to mention this yesterday but I am curious to know how
gdb gets into an error state here. My reading of the code in this area
is that gdb might issue a complaint, but it won't error out. I would
expect it to ignore the attribute it can't recognize and continue on.
Pierre> I could indeed replace the call read_unsigned_leb128
Pierre> by a call to decode_locdesc using DW_BLK(attr) but this
Pierre> is still different from the other call to decode_locdesc
Pierre> earlier in the same function, because context is not set in Free Pascal
Pierre> case.
Is there some deep reason for this? (I don't know.)
Offhand it looks reasonably safe to just set it.
I realize you may still need a pascal-specific case, since gdb doesn't
handle the full generality of DWARF in this area. But if so, I think
this should be explicit.
Tom
next prev parent reply other threads:[~2010-05-13 17:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <23651.5388860882$1273672053@news.gmane.org>
2010-05-12 21:24 ` Tom Tromey
2010-05-13 7:59 ` Pierre Muller
[not found] ` <11064.3996195451$1273708856@news.gmane.org>
2010-05-13 17:29 ` Tom Tromey [this message]
2010-05-13 18:12 ` [Core] " Jonas Maebe
2010-05-13 21:13 ` Tom Tromey
2010-05-13 21:25 ` Jonas Maebe
2010-05-14 17:28 ` Tom Tromey
2010-05-12 13:47 Pierre Muller
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=m38w7nvhz1.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=core@freepascal.org \
--cc=gdb-patches@sourceware.org \
--cc=pierre.muller@ics-cnrs.unistra.fr \
/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