Re: [rfa/c++] cp_lookup_rtti_type, take 2

David Carlton
2003-12-05T17:38:53Z

On Fri, 5 Dec 2003 12:16:58 -0500, Daniel Jacobowitz <drow@mvista.com> said:

> How do you suggest we do it? Some new addition to the debug info? I
> don't believe we have anything at the moment that fills this need.

Hmm. I thought I'd seen something appropriate in the debug info, but
now I realize that I was looking for the slot for the vtable in the
class, which is a quite different matter.

Well, here's what I see when looking for a vtable symbol in a sample
file:

.uleb128 0x1d # (DIE (0x20d) DW_TAG_variable)
.long .LC9 # DW_AT_name: "_ZTI1C"
.long 0x21e # DW_AT_type
.byte 0x1 # DW_AT_external
.byte 0x1 # DW_AT_artificial
.byte 0x5 # DW_AT_location
.byte 0x3 # DW_OP_addr
.long _ZTI1C

So DW_TAG_variable + DW_AT_artificial is a start - looking for that
(plus perhaps guiltily peeking at the demanged name just to make sure
it starts with 'typeinfo') lets us find the vtable symbols. But that
doesn't help - the DW_AT_type doesn't actually lead us to the type
that it's the vtable for, and certainly none of the other attributes
are going to help.

Sigh.

David Carlton
carlton@kealia.com