I own a .NET debugger that has shipped relatively unchanged since .NET 1.0! It is for debugging Fortran and the compiler attaches attributes to some statics. These contain additional debug information. Here is one:
.field public static uint8* '/SAM_PATH_DEF/'
.custom instance void [ftn95lib]Salford.Fortran.DebugInfoAttribute::.ctor(uint8[]) = ( 01 00 40 ... 00 00 00 )
I get an IDebugField to /SAM_PATH_DEF/ (and it is that field, I can see the name using IDebugField::GetInfo). However, using Visual Studio 2013, I cannot query the attributes with IDebugCustomAttributeQuery.
CComPtr<IDebugCustomAttributeQuery> pattr;
hr = pfield->QueryInterface(IID_IDebugCustomAttributeQuery, reinterpret_cast<void**>(&pattr));
Returns E_NOINTERFACE. The documentation for IDebugCustomAttributeQuery "Represents a query for custom attributes on a method or type.". My example is a static, not a method or type. Has this changed in VS2013? If it has, how do I get the attribute now?