Re: [c++] Pointer to member overhaul

Jim Blandy
2006-12-29T19:06:08Z

This is great! I think TYPE_CODE_MEMBERPTR and TYPE_CODE_METHODPTR
are definitely the right approach; data members and member functions
are not merely a different kind of pointer target in the sense that,
say, functions are.

Since the change is so large, I just looked at the changes to the
cp-abi.h and gdbtypes.h interfaces, which I'm assuming pretty much
drive the rest of the stuff.

The comments in cp-abi.h refer to 'cplus_method_ptr_to_target', which
isn't defined anywhere.

The sentence "CONTENTS is the bytes forming the pointer to method"
isn't grammatical.

What is the use of TYPE_CODE_METHOD now? Is it equivalent to
TYPE_CODE_FUNC, except that it expects a 'this' pointer?

Is the representation of a pointer to a data member always simply an
offset from the start of the member pointer's class? It would be nice
if the comment for TYPE_CODE_MEMBERPTR said this; similarly, it would
be nice if the comment for TYPE_CODE_METHODPTR explained that the
representation varies from one ABI to the next, and one should use the
cp-abi.h methods to work with them. Say the word, and I'll write
these for you.

Why are vtable_function_descriptors and vbit_in_delta gdbarch methods
instead of cp-abi.h methods?