Pseudo Vtables

GDB uses in several places structs that contain a set of function pointers to implement a kind of "pseudo vtable". If/when GDB is implemented in C++ this kind of thing can be done differently, but until then this is what GDB uses.

One of the conventions of all functions specified by these structs is that they take a "pseudo this" parameter as the first argument, even if the parameter would be currently unused. One use of this parameter is to allow "subclassing" it to, for example, implement debug logging. See for example symfile-debug.c in the GDB sources.

None: Internals Pseudo-Vtables (last edited 2014-02-07 19:33:59 by DougEvans)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.