[Dwarf-discuss] about the static member function's debuginfo

Ron 603-884-2088 brender
Mon Apr 25 09:51:48 GMT 2005


>I am now studying the DWARF output of two different c++ compiler. It seems
>that they generate different debuginfo for static member function of a
>class. Did the latest DWARF spec had any clean way to discern C++ static and
>non-static member functions? As far as I read the DWARF3 draft, there is no
>such way. If it is really like that, is there any plan for DWARF standard to
>specify an attribute to describe the static feature of a member function? or
>any other ways?

No, the DWARF document is not clear on this point.

Locally (for hp I64 OpenVMS) we adopted the following convention:

    A non-static member function of a class (or union, struct, etc)
    must have an initial parameter whose name is 'this' (which is
    reserved in C++). It should also have the DW_AT_artificial
    attribute. Any member function that does not have at least one
    parameter, or whose first parameter does not have a name, or
    whose first parameters name is other than 'this', is treated as a
    static member function.

    The type of the first parameter of a non-static member function
    will necessarily be a pointer type referring to the immediately
    containing class (or union, struct, etc). However, this is not
    checked in determining whether or not a member function is
    static.

It would certainly be appropriate for DWARF to adopt a definitive
convention.

Ron Brender





More information about the Dwarf-discuss mailing list