Finding the Base Class of a Function with Phoenix
This came up on an internal alias today, so I thought I would post the solution.
The issue is when there is some code like the following:
class BaseClass
{
}
class InheritedClass : BaseClass
{
void SomeFunction() { }
}
And you have a pointer to the SomeFunction function unit, how do you find out the associated base class of that function (in this case it is BaseClass).
The answer is:
functionSymbol.EnclosingAggregateType.PrimaryBaseAggregateType